What is the process of sending long (chunked) messages over NUS?

Hiya. We're building a custom appliance on top of a Nordic chip that talks to an Android/iOS app developed with Flutter and a custom cross-platform Bluetooth plugin. 

We use Nordic UART Service extensively and just noticed that some of our messages are cut. E.g. a message leaving from our app BLE plugin such as "move 629 1 662 27 688 7 719 30 746 28" become "move 629 1 662 27 68" on the peripheral. Of course this makes total sense because of the 20 bytes limitation on BLE Characteristics. However sending the same message over the Android Nordic app magically works!

I went through the source of https://github.com/NordicSemiconductor/Android-BLE-Library to find the spell, but I could not locate it. So I thought maybe best ask the experts here: what is the procedure to cut NUS messages into chunks so that the chip in the other end will join them together?

For further information our plugin is just basically doing this to write messages: 

// This is Kotlin code for Android
val RxService = device!!.getService(RX_SERVICE_UUID)
val RxChar = RxService!!.getCharacteristic(RX_CHAR_UUID)

// I'm guessing I need to insert magical process here
RxChar!!.setValue(value)
val status = device!!.writeCharacteristic(RxChar)

Parents Reply Children
No Data
Related