python 2.7 - PyBlues Bluetooth L2CAP -


my problem get:

raise valueerror ("invalid protocol") valueerror: invalid protocol 

from line of code:

sock=bluetooth.bluetoothsocket(bluetooth.rfcomm) 

i don't understand why i'm getting error.

the reason i'm using because want send keyboard event device connected via bluetooth.

your question tag "l2cap" inconsistent code snippet refers rfcomm. in experience, on windows7, sock=bluetooth.bluetoothsocket(bluetooth.rfcomm) not raise error sock=bluetooth.bluetoothsocket(bluetooth.l2cap) raise error. if did want rfcomm, hardware issue. example, if bluetooth resides on usb bluetooth dongle, software should raise error when dongle unplugged. rest of answer assumes trying l2cap.

generally error raised because protocol not supported driver. have found l2cap not accessible in pybluez in python2 or python3 on windows 7. in python3 on linux l2cap accessible "import socket".

it unclear me whether pybluez limitation present in both widcomm , msbt stacks on win7. unclear me whether more pybluez work fix issue if service unavailable in driver pybluez trying wrap.

hope helps.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -