2024-01-16 07:09 AM - last edited on 2024-03-07 09:09 AM by SofLit
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) */
}
Solved! Go to Solution.
2024-03-07 07:04 AM
Hi @Flare ,
Welcome to ST Community!
The ST BLE Sensor App by definition does not support more than one sample per characteristic. You could check the definition of the characteristic used for sending IMU data here in section 6.As an alternative, you could increase the frequency of sending samples, to have bigger data chunks at the same time as before.
If you need a custom application that sends more than one sample, you should modify not only the board FW, but also the SDK code and the application source code accordingly. In this case however the application would only work with your customizations.
2024-03-07 07:04 AM
Hi @Flare ,
Welcome to ST Community!
The ST BLE Sensor App by definition does not support more than one sample per characteristic. You could check the definition of the characteristic used for sending IMU data here in section 6.As an alternative, you could increase the frequency of sending samples, to have bigger data chunks at the same time as before.
If you need a custom application that sends more than one sample, you should modify not only the board FW, but also the SDK code and the application source code accordingly. In this case however the application would only work with your customizations.
2024-03-07 07:07 AM
Please use this button to properly post source code: