I'm following the gatt_client tutorial, and I need to modify the code to connect to a gatt server that is advertising a 128 bit custom service UUID.
I have added the required custom UUID in a define: -
- #define REMOTE_SERVICE_UUID {0x12, 0x34, 0x56, 0x0E, 0x53, 0xF4, 0xF5, 0xA4, 0xAE, 0x42, 0xF9, 0x24, 0x12, 0x34, 0x56, 0xE8}
- #define REMOTE_NOTIFY_CHAR_UUID {0x89, 0x78, 0x12, 0x34, 0x53, 0xF4, 0xF5, 0xA4, 0xAE, 0x42, 0xF9, 0x24, 0x12, 0x34, 0x56, 0xE8}
- static esp_bt_uuid_t remote_filter_service_uuid = {
- .len = ESP_UUID_LEN_16,
- .uuid = {.uuid16 = REMOTE_SERVICE_UUID,},
- };
- static esp_bt_uuid_t remote_filter_char_uuid = {
- .len = ESP_UUID_LEN_16,
- .uuid = {.uuid16 = REMOTE_NOTIFY_CHAR_UUID,},
- };
- static esp_bt_uuid_t remote_filter_service_uuid = {
- .len = ESP_UUID_LEN_128,
- .uuid = {
- .uuid128 = REMOTE_SERVICE_UUID,
- },
- };
- static esp_bt_uuid_t remote_filter_char_uuid = {
- .len = ESP_UUID_LEN_128,
- .uuid = {
- .uuid128 = REMOTE_NOTIFY_CHAR_UUID,
- },
- };
- if( p_data->search_res.srvc_id.uuid.uuid.uuid128 == REMOTE_SERVICE_UUID)
- In function 'gattc_profile_event_handler':
- ../components/ble_comms/ble_comms.c:37:37: error: expected expression before '{' token
- #define REMOTE_SERVICE_UUID {0x12, 0x34, 0x56, 0x0E, 0x53, 0xF4, 0xF5, 0xA4, 0xAE, 0x42, 0xF9, 0x24, 0x12, 0x34, 0x56, 0xE8}
- ^
- ../components/ble_comms/ble_comms.c:195:69: note: in expansion of macro 'REMOTE_SERVICE_UUID'
- if( p_data->search_res.srvc_id.uuid.uuid.uuid128 == REMOTE_SERVICE_UUID)