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) */
}
1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

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.  

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Federica Bossi
ST Employee

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.  

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Please use this button to properly post source code:

AndrewNeil_0-1709824062519.png