使用stm32l053r8t6 nucleo与BLueNRG进行无线通信
大家好使用stm32l053r8t6 nucleo与BLueNRG进行无线通信,stm32,bluenrg,Stm32,Bluenrg,大家好 I am beginner to BLE technology since kindly help me out by clearing the issue 我试图向x-cube ble(“”)添加一个新的GATT服务,但不幸的是,ble调试器()中没有显示该服务 代码中已经存在的服务是可见的,但是没有形成一个具有新uuid的新服务 /************************************ Ref code
I am beginner to BLE technology since kindly help me out by clearing the issue
我试图向x-cube ble(“”)添加一个新的GATT服务,但不幸的是,ble调试器()中没有显示该服务
代码中已经存在的服务是可见的,但是没有形成一个具有新uuid的新服务
/************************************ Ref code *********************************************************/
(主标题下)
可能您没有在main.c文件中调用函数
Add\u UV\u Sensor\u Service()
,其中有用于初始化服务的空间。可能您没有在main.c文件中调用函数Add\u UV\u Sensor\u Service()
,其中有用于初始化服务的空间
ret = Add_UV_Sensor_Service();
if(ret == BLE_STATUS_SUCCESS)
PRINTF("Environmental Sensor service added successfully.\n");
else
PRINTF("Error while adding Environmental Sensor service.\n");
(under service .c)
#define COPY_UUID_128(uuid_struct, uuid_15, uuid_14, uuid_13, uuid_12, uuid_11, uuid_10, uuid_9, uuid_8, uuid_7, uuid_6, uuid_5, uuid_4, uuid_3, uuid_2, uuid_1, uuid_0) \
do {\
uuid_struct[0] = uuid_0; uuid_struct[1] = uuid_1; uuid_struct[2] = uuid_2; uuid_struct[3] = uuid_3; \
uuid_struct[4] = uuid_4; uuid_struct[5] = uuid_5; uuid_struct[6] = uuid_6; uuid_struct[7] = uuid_7; \
uuid_struct[8] = uuid_8; uuid_struct[9] = uuid_9; uuid_struct[10] = uuid_10; uuid_struct[11] = uuid_11; \
uuid_struct[12] = uuid_12; uuid_struct[13] = uuid_13; uuid_struct[14] = uuid_14; uuid_struct[15] = uuid_15; \
}while(0)
#define COPY_UV_SENS_SERVICE_UUID(uuid_struct) COPY_UUID_128 (uuid_struct,0x0e,0xd4,0x4b,0x69, 0x20,0xd1, 0x4b,0xc4, 0x9f,0xb0, 0xcf,0xf6,0xf1,0xf1,0xd0,0x71)
tBleStatus Add_UV_Sensor_Service(void)
{
tBleStatus ret;
uint8_t uuid[16];
uint16_t uuid16;
charactFormat charFormat;
uint16_t descHandle;
COPY_UV_SENS_SERVICE_UUID(uuid);
ret = aci_gatt_add_serv(UUID_TYPE_128, uuid, PRIMARY_SERVICE , 5,
&uvSerHandle);
if (ret != BLE_STATUS_SUCCESS) goto fail;
fail:
PRINTF("Error while adding UV_SENS service.\n");
return BLE_STATUS_ERROR ;
}