What are the permissions of the /dev/input/event2 file? Perhaps you
need to open it up so that everyone can open/access it?

Regards
-- Ashwin



On Thu, Apr 29, 2010 at 5:54 PM, dirtytofu <simon...@gmail.com> wrote:
> I am new to writing device drivers and I would like some guidance on
> this matter.
>
> I am trying to get a sensor working using Eclair.
>
> On the kernel side I have set up the sensor to update its current
> state as an input device.  By using adb shell I have confirmed that my
> sensor is functioning by using:
>
> cat /dev/input/event2
>
> Now my issue arises as I try to implement the HAL portion for the
> sensor.  Like KeyInputQueue and EventHub.cpp I am trying to open the
> input event file and poll the input event.  However if I perform an
> ioctl on the opened input event file I constantly receive an ENOTTY
> error.
>
> Here is the portion of the code that is giving me issues:
>
>        char szName[80];
>
>        if(ioctl(fd, EVIOCGNAME(sizeof(szName) - 1), &szName) < 1) {
>            SFH7743_LOGD("Unable to find device name: %s",
> strerror(errno));
>            szName[0] = '\0';
>        }
>
> Funny thing is EventHub.cpp does the exact same operation to my device
> as it scans the input directory and EventHub is able to successfully
> retrieve the device's name.
>
> I have been stuck on this for a while and any help would be wonderful.
>
> Thanks!
>
> --
> unsubscribe: android-porting+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to