2
votes

I am trying to connect and send data from my android application to a microship RN4871 Bluetooth low energy module.

I want to use the transparent UART mode.

For that, I am scanning the device with a BroadcastReceiver and then i am connecting to the module with the following code :

socket = device.createRfcommSocketToServiceRecord(UUID.fromString("00002A00-0000-1000-8000-00805F9B34FB"));
receiveStream = socket.getInputStream();
sendStream = socket.getOutputStream();

Where "00002A00-0000-1000-8000-00805F9B34FB" is the seriial port uuid

and then I send data with :

        String data = "test";
        sendStream.write(data.getBytes());
        sendStream.flush();

The problem is that i don't receive any data on my microcontroller..

Do you know what could be the problem ?

1

1 Answers

2
votes

I think that you should use the service :

49535343-fe7d-4ae5-8fa9-9fafd205e455

that is used by microchip devices with the characteristics :

49535343-8841-43f4-a8d4-ecbe34729bb3

that is used to write data