cancel
Showing results for 
Search instead for 
Did you mean: 

Implement & understand BLE Read Property

GMacw.1
Associate II

Hi,

I want to implement BLE read property.

I found Blood pressure example but not able to execute and understand it properly.

Thanks.

1 REPLY 1
Remi QUINTIN
ST Employee

The Heart Rate project includes a characteristic with the READ property.

#if (BLE_CFG_HRS_BODY_SENSOR_LOCATION_CHAR != 0)

 /**

  * Add Body Sensor Location Characteristic

  */

 uuid = SENSOR_LOCATION_UUID;

 hciCmdResult = aci_gatt_add_char(HRS_Context.HeartRateSvcHdle,

                                  UUID_TYPE_16,

                                  (Char_UUID_t *) &uuid ,

                                  1, /* bytes */

                                  CHAR_PROP_READ,

                                  ATTR_PERMISSION_NONE,

                                  GATT_DONT_NOTIFY_EVENTS, /* gattEvtMask */

                                  10, /* encryKeySize */

                                  0, /* isVariable: 0 */

                                  &(HRS_Context.BodySensorLocationCharHdle));

The Blood Pressure project too.

#if (BLE_CFG_BLS_SUPPORTED_FEATURES == 1)

   /**

    * Add Blood Pressure supported features Characteristic

    */

 uuid = BLOOD_PRESSURE_FEATURE_CHAR_UUID;

 hciCmdResult = aci_gatt_add_char(BLS_Context.SvcHdle,

                                    UUID_TYPE_16,

                                    (Char_UUID_t *) &uuid ,

                                    2,

                                    CHAR_PROP_READ,

                                    ATTR_PERMISSION_NONE,

                                    GATT_DONT_NOTIFY_EVENTS, /* gattEvtMask */

                                    10, /* encryKeySize */

                                    CHAR_VALUE_LEN_CONSTANT, /* isVariable */

                                  &(BLS_Context.FeatureCharHdle));

   if (hciCmdResult == BLE_STATUS_SUCCESS)

   {

   BLE_DBG_BLS_MSG("BLS Pressure Feature Characteristic Added Successfully %04X \n",

                BLS_Context.FeatureCharHdle);

    }

   else

    {

   BLE_DBG_BLS_MSG ("FAILED to add BLS Pressure Feature Characteristic, Error: %02X !!\n",

                   hciCmdResult);

   } 

#endif