tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Final remote(4) / remote(9) API proposal



On Thu, 9 Oct 2008, Jared D. McNeill wrote:

> Here's the final remote API I'm proposing. Feedback?
>
>   typedef uint32_t        remote_addr_t;

this could do with being 48-bits at least (I don't know if the Sony PS3
Bluetooth remote provides an identifier, but the bdaddr which could be
otherwise used is 48bit and in the futureworld where everything has an
IPv6 device I can see it being needed)

>   typedef uint32_t        remote_command_t;

again, I don't exactly know if this is enough for a HID remote - the only
information I have 'seems' to show that the PS3 remote provides 11 bytes
of input data (this is from a posting on the FreeBSD bluetooth list):

Input   id=1 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=1 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=2 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=3 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=4 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=5 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Feature id=6 size=8 count=11 page=Microsoft usage=0x0001, logical range 0..255
Collection page=Generic_Desktop usage=Game_Pad

but it could just be a bitmask that could be decoded to 88 individual
events.

>   struct remote_info {
>         char    ri_devid[REMOTE_DEVID_LEN];
>   };
>
>   #define REMOTE_GINFO    _IOR('r', 0, struct remote_info)

so, this would be something like "uirda0-3343" for device ID 3343 sending
events via uirda0 ?

>   struct remote_event {
>         uint8_t                 re_toggle;
>         remote_addr_t           re_address;
>         remote_command_t        re_command;
>         struct timespec         re_time;
>   };

you didn't say how events are transmitted out of the /dev/wsremote0, will
it be possible to extend the event structure in the future?

I'm not sure what the features are above, but sometimes that is a way to
set configuration options on the device. I should ignore that for now, but
it would be nice to leave room in the API for that kind of thing..

iain


Home | Main Index | Thread Index | Old Index