I am in the process of writing the sensor glue for the os4000-t digital compass/accel device. This reports nmea style string via TTL.
I have modeled my file after sensors_qemu.c example. I have it working partially. The first process which tries to use SensorManager is able to receive orientation updates. Any processes launched afterward are not. I believe I have traced it to the "open_data_source" and "data_open" functions. It seems that the "data_open" function is not receiving the FD that "open_data_source" retrieves. From my logs, it seems that "open_data_source" is actually called from the first process (system screen orientation) when the second process (android app) tries to open sensor up for polling. data_open is invoked under the pid of the second process but it does not receive the right FD. I assumed that: int (*data_open)(struct sensors_data_device_t *dev, int fd); the fd there would be from: int (*open_data_source)(struct sensors_control_device_t *dev); but it is not happening. As I mentioned, the first app, whether it be the system screen orientation manager (when enabled) or a standalone app which utilizies SensorManager, everything works great. If I try to relaunch the app (since it would be under different PID) it isn't able to obtain valid FD to talk to the device. If you have any experience with writing the sensors.c glue for any devices, would greatly appreciate any hints or tips. --~--~---------~--~----~------------~-------~--~----~ unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---