Hi,

I'm not sure what type of device you are working on.
As a result, implementing it as an input device may not be the best choice.
Anyway, we may solve the problem by treating it as a generic character
device driver.
Below is one of the solutions for your reference.

First, you may need to implement a Service for the event in Android
Application (Framework) layer.
Upon receiving the event, the Service will be able to notify the user
through the Notification Manager.
For the Service to receive the event from the device, through the help of
native code (by way of JNI), the Service may poll (with poll(), read(), or
ioctl(), etc.) the event through the device file (or sysfs) of the device
driver that you implement. (Of course, you need to do this in a thread in
the Service.)
In the device driver, you can implement the poll() (or read(), ioctl()...)
file operations so as to wait the event of the IRQ, which
when triggered will wake up the blocked task (i.e. the thread of the
Service).

William Liang
http://www.ntut.edu.tw/~wyliang

2011/8/22 ramon <ramon.fr...@gmail.com>

> Hey,
> I've written a wiegand device driver for as a char device in Linux,
> and I want to integrate it to android.
> the device I written is asynchronous IRQ driven char device. I want to
> integrate it in a way, that when the device notify that a message
> received, a pop-up notification will show up on the android screen.
> How do you suggest is the best way to achieve that ?
> I found some info on the net, suggesting to write the driver as an
> input device, and let the android poll the events. is it the best
> way ?
>
> If someone have experience with that I will glad to hear some
> thoughts...
>
> Thanks
>
> Ramon.
>
> --
> unsubscribe: android-kernel+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-kernel

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

Reply via email to