I am trying to connect and send data from my laptop to my Android phone via Bluetooth. I am using PyBluez library for that. When I am trying to call 'connect' method of BluetoothSocket:
sock=BluetoothSocket( RFCOMM )
sock.connect((host, port))
it always gives me the same error:
Traceback (most recent call last):
File "rfcomm-client.py", line 41, in <module>
sock.connect((host, port))
File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (22, 'Invalid argument')
As I understood from docs and examples, the type of host should be String, and port should be int. That I checked.
I also checked the validity of both port and host, and already paired my devices.
Could anybody help me with this issue?