2015-01-23 10:10:57

by Gilbert Gao

[permalink] [raw]
Subject: RE: BlueZ question about HID profile


Hi,

I add KEYB to sdp:
#sdptool add KEYB

And HID service can be found and connected by a remote dongle on PC,
>From log, connect_event_cb() is called, but this function calls input_device_set_channel(), in which find_device() returns NULL, because the global variable "devices" is NULL, so the connection can not be established.
I want to know how to modify here for successful connection as a keyboard.

And I'm not very clear which interfaces should be called for HID device role to send data(such as a key press).

Sicerely expect your advice! Thank you!

Best Regards,
Gilbert


-----Original Message-----
From: Gilbert Gao
Sent: Tuesday, January 06, 2015 10:26 AM
To: 'Marcel Holtmann'
Cc: [email protected]
Subject: RE: BlueZ question about HID profile

Dear Marcel,

Thank you very much!
But now I'm not very clear about BlueZ HID implementation.
Could you help to point out how to modify for a HID device role or any sample code?

Best Regards,
Gilbert

-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Tuesday, January 06, 2015 9:38 AM
To: Gilbert Gao
Cc: [email protected]
Subject: Re: BlueZ question about HID profile

Hi Gilbert,

> Here is an emergent question about BlueZ feature:
> I read the doc "supported-features.txt", which says BlueZ supports HID host.
> And my question is whether HID device is supported?
> Or can I use BlueZ HID profile to implement the Bluetooth HID device such as a Bluetooth mouse or keyboard?

it should be pretty simple to implement a HID device role. There have been external projects in the past that did this. The reason why this is not in BlueZ is mainly due to the fact that we would need to get the input events from some kind of source. So if you have that figured out, then it should be simple to provided HID device role.

Regards

Marcel


**********************Confidentiality Notice************************
The opinions and views expressed in this e-mail are solely those of the author and do not necessarily represent our company and its affiliates. If this e-mail is not originally intended for you, or received by you in error, do not disclose its content to anyone and delete it immediately. This e-mail may contain information that is legally privileged, confidential or exempt from disclosure.


2015-01-27 08:50:40

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: BlueZ question about HID profile

Hi,

On Tue, Jan 27, 2015 at 5:44 AM, Gilbert Gao <[email protected]> wrote:
> Hi Luiz,
>
> Thanks a lot!
> Assuming we have the input source and BlueZ working as a HID device,
> what interface BlueZ will expose for us to send a key press to remote? /d=
ev/xxx or function call?
> In another word, how to transfer the key press from input device to BlueZ=
?

I guess you did not pay attention to the comment about top posting in the l=
ist:

http://www.bluez.org/development/lists/

Regarding the mechanism to hand over the events, as I said it already,
you probably need to come up with a proposal, something like
InputManager.Register("/dev/xxx") could work but I did not think about
the details and we could perhaps have the kernel doing some sort of
pass-through mode if the source input is already an HID device.

> Best Regards,
> Gilbert
>
> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:[email protected]]
> Sent: Tuesday, January 27, 2015 12:13 AM
> To: Gilbert Gao
> Cc: Marcel Holtmann; [email protected]
> Subject: Re: BlueZ question about HID profile
>
> Hi,
>
> On Fri, Jan 23, 2015 at 12:10 PM, Gilbert Gao <[email protected]> wro=
te:
>>
>> Hi,
>>
>> I add KEYB to sdp:
>> #sdptool add KEYB
>>
>> And HID service can be found and connected by a remote dongle on PC,
>> From log, connect_event_cb() is called, but this function calls input_de=
vice_set_channel(), in which find_device() returns NULL, because the global=
variable "devices" is NULL, so the connection can not be established.
>> I want to know how to modify here for successful connection as a keyboar=
d.
>>
>> And I'm not very clear which interfaces should be called for HID device =
role to send data(such as a key press).
>>
>> Sicerely expect your advice! Thank you!
>
> First of all, no top posting in the mailing list please, second the
> sdptool shall not be used since you did not have any plugin to
> implement it won't work, in order for this to work input plugin
> probably needs changes, it just happens to connect because the PSM are
> the same for both roles but since there is no actual record for the
> host the plugin will never be initialize to work with the device
> connecting thus the error you are seeing.
>
> We could in theory enable HID device record but then input needs to
> handle incoming connections and interface with some event input that
> you might have to register over D-Bus, if you don't really have an
> input device to be used as a source you could use uinput to emulate
> one then bluetoothd would have to listen to the events, translate (not
> sure if this step is really needed though) them to HID and then send
> to the remote.
>
>> Best Regards,
>> Gilbert
>>
>>
>> -----Original Message-----
>> From: Gilbert Gao
>> Sent: Tuesday, January 06, 2015 10:26 AM
>> To: 'Marcel Holtmann'
>> Cc: [email protected]
>> Subject: RE: BlueZ question about HID profile
>>
>> Dear Marcel,
>>
>> Thank you very much!
>> But now I'm not very clear about BlueZ HID implementation.
>> Could you help to point out how to modify for a HID device role or any s=
ample code?
>>
>> Best Regards,
>> Gilbert
>>
>> -----Original Message-----
>> From: Marcel Holtmann [mailto:[email protected]]
>> Sent: Tuesday, January 06, 2015 9:38 AM
>> To: Gilbert Gao
>> Cc: [email protected]
>> Subject: Re: BlueZ question about HID profile
>>
>> Hi Gilbert,
>>
>>> Here is an emergent question about BlueZ feature:
>>> I read the doc "supported-features.txt", which says BlueZ supports HID =
host.
>>> And my question is whether HID device is supported?
>>> Or can I use BlueZ HID profile to implement the Bluetooth HID device su=
ch as a Bluetooth mouse or keyboard?
>>
>> it should be pretty simple to implement a HID device role. There have be=
en external projects in the past that did this. The reason why this is not =
in BlueZ is mainly due to the fact that we would need to get the input even=
ts from some kind of source. So if you have that figured out, then it shoul=
d be simple to provided HID device role.
>>
>> Regards
>>
>> Marcel
>>
>>
>> **********************Confidentiality Notice************************
>> The opinions and views expressed in this e-mail are solely those of the =
author and do not necessarily represent our company and its affiliates. If =
this e-mail is not originally intended for you, or received by you in error=
, do not disclose its content to anyone and delete it immediately. This e-m=
ail may contain information that is legally privileged, confidential or exe=
mpt from disclosure.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetoot=
h" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Luiz Augusto von Dentz
> **********************Confidentiality Notice************************
> The opinions and views expressed in this e-mail are solely those of the a=
uthor and do not necessarily represent our company and its affiliates. If t=
his e-mail is not originally intended for you, or received by you in error,=
do not disclose its content to anyone and delete it immediately. This e-ma=
il may contain information that is legally privileged, confidential or exem=
pt from disclosure.



--=20
Luiz Augusto von Dentz

2015-01-27 03:44:49

by Gilbert Gao

[permalink] [raw]
Subject: RE: BlueZ question about HID profile

Hi Luiz,

Thanks a lot!
Assuming we have the input source and BlueZ working as a HID device,
what interface BlueZ will expose for us to send a key press to remote? /dev/xxx or function call?
In another word, how to transfer the key press from input device to BlueZ?

Best Regards,
Gilbert

-----Original Message-----
From: Luiz Augusto von Dentz [mailto:[email protected]]
Sent: Tuesday, January 27, 2015 12:13 AM
To: Gilbert Gao
Cc: Marcel Holtmann; [email protected]
Subject: Re: BlueZ question about HID profile

Hi,

On Fri, Jan 23, 2015 at 12:10 PM, Gilbert Gao <[email protected]> wrote:
>
> Hi,
>
> I add KEYB to sdp:
> #sdptool add KEYB
>
> And HID service can be found and connected by a remote dongle on PC,
> From log, connect_event_cb() is called, but this function calls input_device_set_channel(), in which find_device() returns NULL, because the global variable "devices" is NULL, so the connection can not be established.
> I want to know how to modify here for successful connection as a keyboard.
>
> And I'm not very clear which interfaces should be called for HID device role to send data(such as a key press).
>
> Sicerely expect your advice! Thank you!

First of all, no top posting in the mailing list please, second the
sdptool shall not be used since you did not have any plugin to
implement it won't work, in order for this to work input plugin
probably needs changes, it just happens to connect because the PSM are
the same for both roles but since there is no actual record for the
host the plugin will never be initialize to work with the device
connecting thus the error you are seeing.

We could in theory enable HID device record but then input needs to
handle incoming connections and interface with some event input that
you might have to register over D-Bus, if you don't really have an
input device to be used as a source you could use uinput to emulate
one then bluetoothd would have to listen to the events, translate (not
sure if this step is really needed though) them to HID and then send
to the remote.

> Best Regards,
> Gilbert
>
>
> -----Original Message-----
> From: Gilbert Gao
> Sent: Tuesday, January 06, 2015 10:26 AM
> To: 'Marcel Holtmann'
> Cc: [email protected]
> Subject: RE: BlueZ question about HID profile
>
> Dear Marcel,
>
> Thank you very much!
> But now I'm not very clear about BlueZ HID implementation.
> Could you help to point out how to modify for a HID device role or any sample code?
>
> Best Regards,
> Gilbert
>
> -----Original Message-----
> From: Marcel Holtmann [mailto:[email protected]]
> Sent: Tuesday, January 06, 2015 9:38 AM
> To: Gilbert Gao
> Cc: [email protected]
> Subject: Re: BlueZ question about HID profile
>
> Hi Gilbert,
>
>> Here is an emergent question about BlueZ feature:
>> I read the doc "supported-features.txt", which says BlueZ supports HID host.
>> And my question is whether HID device is supported?
>> Or can I use BlueZ HID profile to implement the Bluetooth HID device such as a Bluetooth mouse or keyboard?
>
> it should be pretty simple to implement a HID device role. There have been external projects in the past that did this. The reason why this is not in BlueZ is mainly due to the fact that we would need to get the input events from some kind of source. So if you have that figured out, then it should be simple to provided HID device role.
>
> Regards
>
> Marcel
>
>
> **********************Confidentiality Notice************************
> The opinions and views expressed in this e-mail are solely those of the author and do not necessarily represent our company and its affiliates. If this e-mail is not originally intended for you, or received by you in error, do not disclose its content to anyone and delete it immediately. This e-mail may contain information that is legally privileged, confidential or exempt from disclosure.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Luiz Augusto von Dentz
**********************Confidentiality Notice************************
The opinions and views expressed in this e-mail are solely those of the author and do not necessarily represent our company and its affiliates. If this e-mail is not originally intended for you, or received by you in error, do not disclose its content to anyone and delete it immediately. This e-mail may contain information that is legally privileged, confidential or exempt from disclosure.

2015-01-26 16:12:47

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: BlueZ question about HID profile

Hi,

On Fri, Jan 23, 2015 at 12:10 PM, Gilbert Gao <[email protected]> wrote=
:
>
> Hi,
>
> I add KEYB to sdp:
> #sdptool add KEYB
>
> And HID service can be found and connected by a remote dongle on PC,
> From log, connect_event_cb() is called, but this function calls input_dev=
ice_set_channel(), in which find_device() returns NULL, because the global =
variable "devices" is NULL, so the connection can not be established.
> I want to know how to modify here for successful connection as a keyboard=
.
>
> And I'm not very clear which interfaces should be called for HID device r=
ole to send data(such as a key press).
>
> Sicerely expect your advice! Thank you!

First of all, no top posting in the mailing list please, second the
sdptool shall not be used since you did not have any plugin to
implement it won't work, in order for this to work input plugin
probably needs changes, it just happens to connect because the PSM are
the same for both roles but since there is no actual record for the
host the plugin will never be initialize to work with the device
connecting thus the error you are seeing.

We could in theory enable HID device record but then input needs to
handle incoming connections and interface with some event input that
you might have to register over D-Bus, if you don't really have an
input device to be used as a source you could use uinput to emulate
one then bluetoothd would have to listen to the events, translate (not
sure if this step is really needed though) them to HID and then send
to the remote.

> Best Regards,
> Gilbert
>
>
> -----Original Message-----
> From: Gilbert Gao
> Sent: Tuesday, January 06, 2015 10:26 AM
> To: 'Marcel Holtmann'
> Cc: [email protected]
> Subject: RE: BlueZ question about HID profile
>
> Dear Marcel,
>
> Thank you very much!
> But now I'm not very clear about BlueZ HID implementation.
> Could you help to point out how to modify for a HID device role or any sa=
mple code?
>
> Best Regards,
> Gilbert
>
> -----Original Message-----
> From: Marcel Holtmann [mailto:[email protected]]
> Sent: Tuesday, January 06, 2015 9:38 AM
> To: Gilbert Gao
> Cc: [email protected]
> Subject: Re: BlueZ question about HID profile
>
> Hi Gilbert,
>
>> Here is an emergent question about BlueZ feature:
>> I read the doc "supported-features.txt", which says BlueZ supports HID h=
ost.
>> And my question is whether HID device is supported?
>> Or can I use BlueZ HID profile to implement the Bluetooth HID device suc=
h as a Bluetooth mouse or keyboard?
>
> it should be pretty simple to implement a HID device role. There have bee=
n external projects in the past that did this. The reason why this is not i=
n BlueZ is mainly due to the fact that we would need to get the input event=
s from some kind of source. So if you have that figured out, then it should=
be simple to provided HID device role.
>
> Regards
>
> Marcel
>
>
> **********************Confidentiality Notice************************
> The opinions and views expressed in this e-mail are solely those of the a=
uthor and do not necessarily represent our company and its affiliates. If t=
his e-mail is not originally intended for you, or received by you in error,=
do not disclose its content to anyone and delete it immediately. This e-ma=
il may contain information that is legally privileged, confidential or exem=
pt from disclosure.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth=
" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--=20
Luiz Augusto von Dentz