Trying to bind bluetooth socket to PSM 17 and 19 returns EACCESS on MeeGo
Asked Answered
E

2

7

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 (e.g 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?

Estis answered 16/11, 2011 at 11:12 Comment(0)
E
1

The program must be run as root.

Estis answered 10/2, 2013 at 14:44 Comment(0)
A
2

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).

Archle answered 9/2, 2013 at 7:18 Comment(4)
The EACCESS I am getting is not when I am trying to connect to N9, instead I am getting this error when I am trying to make the N9 a HID device. The small program implements mouse and keyboard portion of the HID profile. This is the kind of error you get when you try to listen on a port less than 1024 in Linux as a non-root user without some permission trickery. Correct me if I am wrong, but your answer sounds like "you can't listen on port 80 because you don't have a web server running".Estis
So are you running this program on the N9 ? (How are you making it a HID device ?) Relating to the web-server analogy I was basically saying that - you cannot connect to port 80 because there is no web-server running. I assumed that you are running this small program on a PC or external device and from there trying to connect to the N9, but it seems like you are running this program on the N9 itself and trying to make it a HID device.Archle
Yes, exactly, I am running this program on N9.Estis
please see my EDIT above in the answerArchle
E
1

The program must be run as root.

Estis answered 10/2, 2013 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.