sdk/modules/bluetooth/bluetooth_le_gatt.c
/****************************************************************************
 * Name: ble_add_characteristic
 *
 * Description:
 *   BLE add Characteristic to service
 *
 ****************************************************************************/
ble_add_characteristic
Description:
BLE add Characteristic to service
ble_add_characteristic Description : BLE add Characteristic to service
int ble_add_characteristic(struct ble_gatt_service_s *service, struct ble_gatt_char_s *charc)
{
  if (!service)
    {
      _err("%s [BLE][GATT] BLE add characteristic failed(service not created).\n", __func__);
      return BT_FAIL;
    }
  if (service->num < BLE_MAX_CHARACTERISTICS)
    {
      service->chars[service->num] = charc;
      service->num ++;
    }
  else
    {
      _err("%s [BLE][GATT] BLE create service failed(max services reached).\n", __func__);
      return BT_FAIL;
    }
  return BT_SUCCESS;
}
int ble_add_characteristic ( struct ble_gatt_service_s * service , struct ble_gatt_char_s * charc ) { if ( ! service ) { _err ( " \n " , __func__ ) ; return BT_FAIL ; } if ( service -> num < BLE_MAX_CHARACTERISTICS ) { service -> chars [ service -> num ] = charc ; service -> num ++ ; } else { _err ( " \n " , __func__ ) ; return BT_FAIL ; } return BT_SUCCESS ; }
Name: ble_add_characteristic
 Description:
   BLE add Characteristic to service
Name : ble_add_characteristic Description : BLE add Characteristic to service