sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
463 stars 179 forks source link

How to send a string over characteristics #98

Closed iqbalpalemad closed 8 years ago

iqbalpalemad commented 8 years ago

hai

i want to send a 18 character string to my blend micro over a characteristics. for this which characteristic i have to use . i have tried BLEFixedLengthCharacteristic but which shows an error unknown type name.So please tell me which characteristic is best suitable for transmitting a string...?

sandeepmistry commented 8 years ago

@iqbalpalemad please see the second version of setValue: https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/API.md#set-value

I would recommend the generic BLECharacteristic with the max length of 20 for strings, unless the string will be fixed length.

In the future, please provide a minimal sample sketch that has the issue/question and compile output.

mrdc commented 4 years ago

@sandeepmistry Will you be so kind to show how to send a string properly? When I use BLEFixedLengthCharacteristic I get this error: no matching function for call to 'BLEFixedLengthCharacteristic::BLEFixedLengthCharacteristic(const char [5], int)'

TamojitSaha commented 4 years ago

@sandeepmistry can you help us ?