Hi Ken,
You can have several "entities" (be it drivers, or userspace code)
write into the *same* /dev/input/event#.
Then, on the application side, the "data" sensor HAL module can read
from that /dev/input node, which it receives through the data_open()
"fd" parameter. There is no need to poll() several drivers.
>From userspace, for instance you can do something like:
static int control__wake(struct sensors_control_context_t *dev)
{
int err = 0;
int fd = open_input(O_WRONLY);
if (fd > 0) {
struct input_event event[1];
event[0].type = EV_SYN;
event[0].code = SYN_CONFIG;
event[0].value = 0;
err = write(fd, event, sizeof(event));
LOGD_IF(err<0, "control__wake, err=%d (%s)", errno, strerror(errno));
close(fd);
}
return err;
}
This event will be received by whoever is reading from this event
node. Drivers can use the same strategy and push events into the same
event node.
Mathias
On Thu, Jan 29, 2009 at 4:17 PM, Ken Schultz <[email protected]> wrote:
>
> It seems the the sensors HAL can only reference a single /dev/input/
> event#, but if you have multiple sensor drivers how would you have
> them all reference the same event node? Is this even possible? I was
> under the impression each input driver should have its own event node.
> >
>
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---