From af93d31a0fe668cfa63203fcde1573a01e8c1e93 Mon Sep 17 00:00:00 2001 From: zwsd Date: Thu, 4 Aug 2022 14:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=9C=8D=E5=8A=A1uuid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/ble_spp_server_demo.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/main/ble_spp_server_demo.c b/main/ble_spp_server_demo.c index 7c6ef41..4c2321e 100644 --- a/main/ble_spp_server_demo.c +++ b/main/ble_spp_server_demo.c @@ -37,8 +37,23 @@ static uint16_t table_handle_m; #define SAMPLE_DEVICE_NAME s_module->bleName // The Device Name Characteristics in GAP #define SPP_SVC_INST_ID 0 +static const uint8_t spp_service_uuid128[16] = { + /* LSB <--------------------------------------------------------------------------------> MSB */ + 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x01, 0x00, 0x40, 0x6E, // +}; + +// static const uint8_t spp_char_uuid128_rx[16] = { +// /* LSB <--------------------------------------------------------------------------------> MSB */ +// 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x02, 0x00, 0x40, 0x6E, // +// }; + +// static const uint8_t spp_char_uuid128_tx[16] = { +// /* LSB <--------------------------------------------------------------------------------> MSB */ +// 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x03, 0x00, 0x40, 0x6E, // +// }; + /// SPP Service -static const uint16_t spp_service_uuid = 0xABF0; +// static const uint16_t spp_service_uuid = 0xABF0; /// Characteristic UUID #define ESP_GATT_UUID_SPP_DATA_RECEIVE 0xABF1 #define ESP_GATT_UUID_SPP_DATA_NOTIFY 0xABF2 @@ -174,7 +189,8 @@ static const uint8_t spp_heart_beat_ccc[2] = {0x00, 0x00}; /// Full HRS Database Description - Used to add attributes into the database static const esp_gatts_attr_db_t spp_gatt_db[SPP_IDX_NB] = { // SPP - Service Declaration - [SPP_IDX_SVC] = {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ, sizeof(spp_service_uuid), sizeof(spp_service_uuid), (uint8_t *)&spp_service_uuid}}, + [SPP_IDX_SVC] = {{ESP_GATT_AUTO_RSP}, + {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ, sizeof(spp_service_uuid128), sizeof(spp_service_uuid128), (uint8_t *)&spp_service_uuid128}}, // SPP - data receive characteristic Declaration [SPP_IDX_SPP_DATA_RECV_CHAR] = {{ESP_GATT_AUTO_RSP},