2021-11-17 06:42 PM
In the sensor_service.c source file, I add the char_prop_read flag in the below, but now the SensorTile does not even start BLE properly. Any help is appreciated.
starting at line 1074,
COPY_ACC_GYRO_MAG_W2ST_CHAR_UUID(uuid);
ret = aci_gatt_add_char(HWServW2STHandle, UUID_TYPE_128, uuid, 2+3*3*2,
CHAR_PROP_NOTIFY|CHAR_PROP_READ,
ATTR_PERMISSION_NONE,
GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
16, 0, &AccGyroMagCharHandle);
Solved! Go to Solution.
2021-11-26 02:24 AM
Hi @MCoop.1 ,
Welcome to ST Community. I checked with our experts, and they confirmed me that is is not enough to add the CHAR_PROP_READ, but it is necessary to add a section of code in order to enable the BLE feature in reading.
The suggestion is to reply what implemented for the environmental, and in particular check the “EnvironmentalCharHandle�? handle throughout the code.
You will see some "if function" as follow, that have to be completed with the code to be executed when they are called:
if(handle == EnvironmentalCharHandle + 1)
{
… //code to be executed when the feature is in the reading phase
}
if(handle == EnvironmentalCharHandle + 2)
{
… //code to be executed when the feature is in the notification phase
}
On the other side, for the “AccGyroMagCharHandle�? handle you'll find only the function managing the notification phase:
if(attr_handle == AccGyroMagCharHandle + 2)
{
… //code to be executed when the feature is in the notification phase
}
Basically, the code to be executed when the feature is in reading phase is missing.
Writing only "CHAR_PROP_READ" statement you are just adding a feature that can also be read in addition to the notification.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-11-26 02:24 AM
Hi @MCoop.1 ,
Welcome to ST Community. I checked with our experts, and they confirmed me that is is not enough to add the CHAR_PROP_READ, but it is necessary to add a section of code in order to enable the BLE feature in reading.
The suggestion is to reply what implemented for the environmental, and in particular check the “EnvironmentalCharHandle�? handle throughout the code.
You will see some "if function" as follow, that have to be completed with the code to be executed when they are called:
if(handle == EnvironmentalCharHandle + 1)
{
… //code to be executed when the feature is in the reading phase
}
if(handle == EnvironmentalCharHandle + 2)
{
… //code to be executed when the feature is in the notification phase
}
On the other side, for the “AccGyroMagCharHandle�? handle you'll find only the function managing the notification phase:
if(attr_handle == AccGyroMagCharHandle + 2)
{
… //code to be executed when the feature is in the notification phase
}
Basically, the code to be executed when the feature is in reading phase is missing.
Writing only "CHAR_PROP_READ" statement you are just adding a feature that can also be read in addition to the notification.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon