Trying to bind bluetooth socket to PSM 17 and 19 returns EACCESS on MeeGo
I am trying to use Nokia N9 (meego) as a virtual Bluetooth mouse/keyboard. I am trying to use this small program as a starting point but I am running into problem: when I am running this program I get an error telling me that "Bind error (PSM 19): Permission denied". This is when a bluetooth socket is being bound to PSM 19.
I get access denied when I run the program as a normal user, also when running as root.
Searching the internet I found that PSM (ports) below 0x1000 are reserved, and that in other bluetooth implementations inability to bind to these PSM is a feature (eg jsr-82).
I tried the same program with PSM above 0x1000 and it worked, although, other devices could no see that there is a HID device nearby :(
Is there a way to bind to these PSM without resorting to hacking the bluetooth stack itself?
PSM 17 & 19 is for HID profile usage. The phone you mentioned Nokia N9 does not support the HID profile, so it makes sense that the connection request is being rejected. You can see the supported features / profiles on any Bluetooth device at the Bluetooth Qualified listings site .. This phones features are listed here https://www.bluetooth.org/tpg/QLI_viewQDL.cfm?qid=18246
EDIT: Per comments below it seems like you are trying to make the N9 a HID device by running the program on the N9 where you are getting the bind error. Possible reasons could be - Some other service / deamon is already bound to this same PSM, or the stack is configured not to accept dynamic binding to reserved PSMs and thus reject binds to PSM for profiles it does not support. The last one makes sense since it is a qualified stack and does not want to allow profile extensions via applications (like the small program trying to make it a HID client).
该程序必须以root身份运行。
链接地址: http://www.djcxy.com/p/10000.html上一篇: C数字常数后缀为“short”