I'm using the library BLEPeripheral.h and an nRF52-DK for sending data from sensors to an app.
I want to send the data by byte packages. I manage to do it with 4 bytes as the characteristic type is set as INT.
The problem is if I want to send more bytes (as int has only 4 bytes).
My code (not all):
instead of using a BLEUnsignedIntCharacteristic which sets the size to an unsigned int as you noticed, you should create your own characteristic for the service using
I'm trying but I don't know how to declare it.
What would be the equivalent to BLEUnsignedLongCharacteristic wifiIP1_Char("faa1", BLERead | BLENotify | BLEWrite);?
Any example?
no instance of constructor "BLECharacteristic::BLECharacteristic" matches the argument list`
no matching function for call to 'BLECharacteristic::BLECharacteristic(const char [5], int, int, bool)'
And then if I try to set the value with: wifiIP1_Char.setValue(ip); I have:
no instance of overloaded function "BLECharacteristic::setValue" matches the argument list
(the function setValue expects unsigned char so you should provide this for type coherence and an IP only has numbers between 0 and 255 so you don't want a signed char - which some compilers could give you)