SimpleBluetoothLeTerminal icon indicating copy to clipboard operation
SimpleBluetoothLeTerminal copied to clipboard

How to configure UUID in SerialSocket.java

Open suoko opened this issue 2 years ago • 4 comments

Hi, I was able to configure the original app where you can insert devices while using configuring the app on the phone. I see that this app does not allow to do so, but you have to put the UUIDs in the code. I tried putting Service UUID, Read Characteristic UUID and Write Characteristic UUID taken from the full app into the serialSocket.java file as below:

    private static final UUID BLUETOOTH_LE_TIO_SERVICE          = UUID.fromString("xxxx-xxxx-xxxx-xxxx-xxxx");
    private static final UUID BLUETOOTH_LE_TIO_CHAR_TX          = UUID.fromString("yyyy-xxxx-xxxx-xxxx-xxxx"); // WNR
    private static final UUID BLUETOOTH_LE_TIO_CHAR_RX          = UUID.fromString("zzzz-xxxx-xxxx-xxxx-xxxx"); // N
    private static final UUID BLUETOOTH_LE_TIO_CHAR_TX_CREDITS  = UUID.fromString("yyyy-xxxx-xxxx-xxxx-xxxx"); // W
    private static final UUID BLUETOOTH_LE_TIO_CHAR_RX_CREDITS  = UUID.fromString("zzzz-xxxx-xxxx-xxxx-xxxx"); // I

I considered RX as READ, and TX as WRITE, but I got "read credits characteristic not found". What am I missing ? Thanks

suoko avatar Mar 09 '24 16:03 suoko

Sometimes I have GATT status 133 Sometimes I have "read characteristic CCCD descriptor not writable

suoko avatar Mar 09 '24 16:03 suoko

LE_TIO is not a good example to clone from, as this has special flow control credits. Better try with the simpler ones.

kai-morich avatar Mar 23 '24 07:03 kai-morich

simpler ones

Thanks, but what are you referring to with "simpler ones" ?

These are data I got from BLE-SCAN which are the same as those used in the full-version app

ble-scan  -d 48:87:2D:11:5A:4B 
Started general BLE scan

48:87:2D:11:5A:4B (rssi=-65): ELEGOO BT16

Finished general BLE scan
Started deep scan of 48:87:2D:11:5A:4B

Found device 48:87:2D:11:5A:4B: ELEGOO BT16 (out of 1)
SERVICE 0000ffe0-0000-1000-8000-00805f9b34fb (Handle: 1): Vendor specific
     CHARACTERISTIC 0000ffe2-0000-1000-8000-00805f9b34fb (Handle: 5): Vendor specific ['write-without-response']
     CHARACTERISTIC 0000ffe1-0000-1000-8000-00805f9b34fb (Handle: 2): Vendor specific ['notify']
         DESCRIPTOR 00002902-0000-1000-8000-00805f9b34fb (Handle: 4): Client Characteristic Configuration

Completed deep scan of 48:87:2D:11:5A:4B

suoko avatar Apr 20 '24 14:04 suoko

you need a mixture of Cc245XDelegate and MicrochipDelegate class. UUIDs from the first, but separate characteristics from the second.

kai-morich avatar Apr 21 '24 08:04 kai-morich