Hi Palanivel, The *open_input()* function in *sensors.cpp* will search for all the input devices and pick the device depending on its name. Look through your *open_input()* function for the name (string) it is comparing with to identify the sensor device.
Ensure that this name is unique and no other device shares the same name. ( In your case the usb-keyboard.) *NOTE*: 1. Please don't send private questions to me. All such questions should be posted on public forums, where I and others can see and answer them. 2. Before sharing code outside/online, make sure you have the permission to do so. Hence I am not including your attachment here. Regards CVS On Wed, Mar 23, 2011 at 6:19 PM, <palanivel.durais...@wipro.com> wrote: > Hi, > > > > I got your mail ID in Android discussion forum. > > > > I have developed a gyro sensor device driver and integrated into Android > 2.3.1(Gingerbread) running on imx51 board. > > Now, I want to develop sensor HAL so that my Android application can read > the sensor data. > > > > I got sample code from the Internet and developed the sensor HAL. When I > boot the system, sensor service activates the sensor. > > Events are received at sensor HAL. But, the system is not detecting the key > press (USB keyboard connected to the board). > > The line “nread = read(fd, &event, sizeof(event));” is causing the > problem. If I remove this line key press is getting detected. > > I am not sure what value should be returned by poll function. > > > > I have attached the sensor HAL file. > > > > Could you help me on how to handle the events in sensor HAL? > > > > Also, when no sensor application is started, why sensor activate api is > called? > > > > Regards > > Palanivel > > * Please do not print this email unless it is absolutely necessary. * > > The information contained in this electronic message and any attachments to > this message are intended for the exclusive use of the addressee(s) and may > contain proprietary, confidential or privileged information. If you are not > the intended recipient, you should not disseminate, distribute or copy this > e-mail. Please notify the sender immediately and destroy all copies of this > message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus transmitted > by this email. > > www.wipro.com > -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting