cancel
Showing results for 
Search instead for 
Did you mean: 

Send large chunks of data via BLE

Flare
Associate II

Hello,

I want to use the SensorTile.box to collect IMU data over BLE. I tried modifying the BLESensors source code to suit my requirements (by increasing the characteristic size etc.). But the ST BLE Sensor app doesn't seem to support this. I only receive one sample at a time. Is there any way to do this? 

Code Snippet 1:

#define BUFFER_SIZE ( 32 )

if (InertialFeaturesEnabled.AccIsEnable == 1U)

{

for(int i = 0; i < BUFFER_SIZE; i++)

{

STORE_LE_16(buff + BuffPos, ((uint16_t)Acc[i].Axis_x));

BuffPos += 2U;

STORE_LE_16(buff + BuffPos, ((uint16_t)Acc[i].Axis_y));

BuffPos += 2U;

STORE_LE_16(buff + BuffPos, ((uint16_t)Acc[i].Axis_z));

BuffPos += 2U;

}

}

 

if (InertialFeaturesEnabled.GyroIsEnable == 1U)

{

for(int i = 0; i < BUFFER_SIZE; i++)

{

STORE_LE_16(buff + BuffPos, ((uint16_t)Gyro[i].Axis_x));

BuffPos += 2U;

STORE_LE_16(buff + BuffPos, ((uint16_t)Gyro[i].Axis_y));

BuffPos += 2U;

STORE_LE_16(buff + BuffPos, ((uint16_t)Gyro[i].Axis_z));

BuffPos += 2U;

}

}

 

 

ret = ACI_GATT_UPDATE_CHAR_VALUE(&BleCharInertial, 0, InertialCharSize, buff);

 Code Snippet 2:

if (AccEnable == 1U)

{

BleCharPointer->uuid[14] |= 0x80U;

InertialCharSize += BUFFER_SIZE * 3U * 2U;

#if (BLE_DEBUG_LEVEL>1)

BLE_MANAGER_PRINTF("\t--> Accelerometer feature enabled\r\n");

#endif /* (BLE_DEBUG_LEVEL>1) */

}

 

/* Enables BLE gyroscope feature */

if (GyroEnable == 1U)

{

BleCharPointer->uuid[14] |= 0x40U;

InertialCharSize += BUFFER_SIZE * 3U * 2U;

#if (BLE_DEBUG_LEVEL>1)

BLE_MANAGER_PRINTF("\t--> Gyroscope feature enabled\r\n");

#endif /* (BLE_DEBUG_LEVEL>1) */

}

 

0 REPLIES 0