First I do this:
Code: Select all
esp_bt_uuid_t AlgCharGuid = 0xbe;
Code: Select all
esp_err_t add_char_ret = _alg.RegisterCharacteristicWithGatt(serviceHandle, AlgCharGuid);
Code: Select all
sp_err_t BleGattCharacteristic::RegisterCharacteristicWithGatt(uint16_t serviceHandle, esp_bt_uuid_t charGuid)
{
ESP_LOGV(REGISTER_CHARACTERISTIC_WITH_GATT, "Calling esp_ble_gatts_add_char()...");
if (nullptr == charGuid)
{
ESP_LOGV(REGISTER_CHARACTERISTIC_WITH_GATT, "Passed in NULL pointer for characteristic GUID");
return 0;
}
_add_char_ret = esp_ble_gatts_add_char(serviceHandle, charGuid, ESP_GATT_PERM_WRITE,
_gattProperty, &_attrValue, NULL);
ESP_LOGV(REGISTER_CHARACTERISTIC_WITH_GATT, "Called esp_ble_gatts_add_char().");
//_attrValue.attr_len = charGuid->len;
//_attrValue.attr_len = GATT_CHAR_SIZE;
//_char_uuid.uuid128 = charGuid;
memcpy(charGuid, _char_uuid, sizeof(charGuid));
ESP_LOGV(REGISTER_CHARACTERISTIC_WITH_GATT, "Characteristic attribute size set.");
if (_add_char_ret)
{
ESP_LOGE(REGISTER_CHARACTERISTIC_WITH_GATT, "add characteristic failed, error code =%x",_add_char_ret);
}
return _add_char_ret;
}
Code: Select all
../main/BleIdToken.h:85:30: error: could not convert '190' from 'int' to 'esp_bt_uuid_t'
esp_bt_uuid_t AlgCharGuid = 0xbe;
Thanks!