Search code examples
androidbluetoothrfcomm

connecting to an android phone in PC side


I am working on a project that a program in an android phone connects to a PC via Bluetooth and sends some commands.

Now my problem is connecting to an android phone with RFCOMM in PC side. Any codes, samples, tutorials, libraries can help me so please share them. Also it's better to be in a native language like C and Delphi not Java or .Net .

Thanks in advance


Solution

  • Without a specific language or details of the bluetooth stack or operating system you are using providing a detailed answer is impossible so this answer is necessarily vague.

    Your android application is almost certainly using SPP (Serial Port Profile) over RFComm. If you configure your phone as the slave device the bluetooth stack on your PC should see it as a Com Port.

    You talk to this port in the same way as any other serial port. just open a connection and send/receive characters).

    The only complexity is that you will need to pair your phone with the PC using the normal configuration menus.