Thank you Salem!!
Originally Posted by
Salem
>
Perhaps your payload would be better as
Code:
struct s_sampling
{
struct {
int16_t imu[6];
int16_t pressure[8];
int16_t counter[2];
} payload;
uint8_t index; // maybe rename to pressure_index
int32_t packet_counter;
bool force_sensor;
uint8_t sensors_counter;
uint8_t num_sensors;
};
When the payload is ready it is assigned to a pointer. This pointer belongs to an SDK provided my the manufacturer of the Bluetooth IC I use.
Code:
ble_gatts_hvx_params_t hvx_params;
hvx_params.p_data = sampling->payload;
Code:
typedef struct
{
uint16_t handle; /**< Characteristic Value Handle. */
uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */
uint16_t offset; /**< Offset within the attribute value. */
uint16_t *p_len; /**< Length in bytes to be written, length in bytes written after return. */
uint8_t const *p_data; /**< Actual data content, use NULL to use the current attribute value. */
} ble_gatts_hvx_params_t;
So, if I do the payload as you suggested, how could I assign the payload to the p_data pointer?