Hello.
It is developed using nrf52832 (S132 v7.0.1, SDK v17.0.0) as a peripheral device.
I want to know the handle value of the characteristic set as Generic Access and Generic Attribute.
My service setting method is as follows.
ret_code_t err_code;
uint16_t m_service_handle;
ble_uuid_t service_uuid;
ble_uuid128_t service_uuid_base = {SERVICE_UUID_BASE};
// service setting
err_code = sd_ble_uuid_vs_add(&service_uuid_base, &service_uuid.type);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &service_uuid, &m_service_handle);
APP_ERROR_CHECK(err_code);
My characteristic setting method is as follows.
#define CHAR_UUID_BASE {0x77, 0x77, 0x66, 0x66, 0x55, 0x55, 0x44, 0x44, 0x33, 0x33, 0x22, 0x22, 0x11, 0x11, 0x00, 0x00}
static uint16_t m_service_handle;
static ble_gatts_char_handles_t m_char_handles;
// Characteristic
static ble_add_char_params_t char_data =
{
.uuid = BLE_UUID_CHAR,
.uuid_type = NULL,
.max_len = 1,
.init_len = 1,
.is_var_len = false,
.char_props.indicate = 1,
.cccd_write_access = SEC_OPEN,
};
// UUID Base
static ble_uuid128_t ble_char_uuid_base[1] =
{
CHAR_UUID_BASE,
};
ret_code_t err_code;
ble_uuid_t char_uuid;
// characteristic setting
err_code = sd_ble_uuid_vs_add(&char_uuid_base[0], &char_uuid.type);
APP_ERROR_CHECK(err_code);
char_data.uuid_type = char_uuid.type;
err_code = characteristic_add(m_service_handle, &char_data, &m_char_handles);
APP_ERROR_CHECK(err_code);
In this code the characteristic can get the handle value with "m_char_handles".
However, this handle value that can be obtained seems to be the handle value of Value.
Is there a way to get the handle value of a characteristic declaration?
Also, I want to get the handle values for Generic Access and Generic Attribute.
The settings are "Device Name", "Appearance", "Peripheral Preferred Connection Parameters", and "Service Changed".
Is there a way to get it?
Best regards.