2023-10-09 04:10 PM
I am working on a WTM32WB55RG BLE application that reads a sensor via I2C and sends the output of some calculations to a BLE characteristic running on the p2pserver on the same WB55RG. I'm able to successfully send an Integer to the BLE characteristic but I'm struggling to understand the "best" or "proper" way to send, let's say 6 x uint32_t for example.
Option 1: Step 1: Assemble the 6 x uint32_t in an array. Step 2: Then it appears I need to reverse the byte order before I send so when I look at the values in the iPhone ST BLE Toolbox I get recognizable data. Step 3: Make a call to Custom_STM_App_Update_Char(CUSTOM_STM_CharSensor, (uint8_t*) dataArray); This is what I'm doing today. I've tested it with 2 uint32_t in an array and it works, so assume it would work for 6.
Option 2: I originally wanted to build a struct that contains all of the data (in case all data values to be sent aren't the same number of bytes) I want to send, but the byte order issue has me thinking "there must be a better way" and I am missing it.
So, my questions are:
Thank you very much.
2023-10-18 01:23 AM
you can try 6 different characteristics instead of using an array or extend the characteristics size to 6 then store that in a variable and reverse it using a simple ascending or descending order program,