I am sending simple data from My Arduino Nano 33 BLE to RaspberryPi. I don't have any problems to send characteristic with data. One characteristic one value -> one variable.
According to the describtion of usage of BLE from Arduino BLE libary site I want to send many variables in one characteristic. How I can do that ?
Probably I have to send string data, but how i can do this ?
Someone of You do this before ? I will be gratefull for any help
Text about which I talking:
Service design patterns
A characteristic value can be up to 512 bytes long. This is a key constraint in designing services. Given this limit, you should consider how best to store data about your sensors and actuators most effectively for your application. The simplest design pattern is to store one sensor or actuator value per characteristic, in ASCII encoded values.
Accelerometer X 200
Accelerometer Y 134
Accelerometer Z 150
This is also the most expensive in memory terms, and would take the longest to read. But it's the simplest for development and debugging.
You could also combine readings into a single characteristic, when a given sensor or actuator has multiple values associated with it.
Motor Speed, Direction 150,1
Accelerometer X, Y, Z 200,133,150
This is more efficient, but you need to be careful not to exceed the 512-byte limit. The accelerometer characteristic above, for example, takes 11 bytes as a ASCII-encoded string.