大家好、我使用的是 SDK 1.50.00.58简单 perperperial observer。
我希望通过将 Eddystone 的特定 UUID 添加到白名单中、从而仅搜索这些 UUID。
我想知道如何将 Eddystone 的 UUID 添加到白名单。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
大家好、我使用的是 SDK 1.50.00.58简单 perperperial observer。
我希望通过将 Eddystone 的特定 UUID 添加到白名单中、从而仅搜索这些 UUID。
我想知道如何将 Eddystone 的 UUID 添加到白名单。
// Discovey 模式(受限、通用、全部)
#define DEFAULT_DISCOVERY_MODE DEVDISC_MODE_ALL
// true 以使用活动扫描
#define DEFAULT_DISCOVERY_ACTIVE_SCAN TRUE
// True,在发现期间使用白名单
#define DEFAULT_DISCOVERY_WHITY_LIST TRUE
#define 白名单_namespace_LEN 10
uint8_t eddyston_namespace[10]={0x53、0x61、0x6d、0x73、0x75、 0x6e、0x67、0x45、0x64、0x64};
void addEddystoneToWhitelist (uint8_t addrType、uint8_t * devAddr){
HCI_LE_AddWhiteListCmd (addrType、eddyston_namespace);
}
uint8 rs_data[50];
静态 void SimpleBLEPeripheral_CB(gapPeriObsRoleEvent_pEvent) Observer_State
{
switch (pEvent->gap.opcode)
{
案例 GAP_DEVICE_INFO_EVENT:
{
// gapDeviceInfoEvent_t *pDevInfoMsg;
//
// if (pDevInfoMsg = iCall_malloc (sizeof (gapDeviceInfoEvent_t)))
//{
// memcpy (pDevInfoMsg、pEvent、sizeof (gapDeviceInfoEvent_t));
//
// if (pDevInfoMsg->pEvtData = iCall_malloc (pEvent->deviceInfo.dataLen))
//{
// memcpy (pDevInfoMsg->pEvtData、pEvent->deviceInfo.pEvtData、
// pEvent->deviceInfo.dataLen);
// SimpleBLEPeripheral_enqueueMsg (SBP_Observer_State_EVT、Success、
//(uint8 *) pDevInfoMsg);
if (observer_mode=1){
// g452.52 Role_Start (default_discovery_mode、default_discovery_active_scan、default_discovery_white_list);
if (pEvent->deviceInfo.dataLen == 28){
Util_stopClock (&uartReadClock);
memcpy (rsp_data、pEvent->deviceInfo.pEvtData、pEvent->deviceInfo.dataLen);
if (memcmp (rsp_data + 10、eddyston_namespace、whitelet_namespace_len)== 0){//命名空间
//if (! RssiSendTimeFlag)
{
UART_printf ("Buzzon");
/sprintf (rssi_data、"%d"、pEvent->deviceInfo.rssi);
//UART_printf ("%s"、RSSI_DATA);
//Util_startClock (&RssiClock);
//RssiSendTimeFlag = 0;
}
}
util_startClock (&uartReadClock);
}
}
//}
//其他
//{
// iCall_freeMsg (pDevInfoMsg);
//}
//}
中断;
}
案例 GAP_DEVICE_DISCOVERY_EVENT:
{
if (observer_mode=1){
Role_Cancel 案;
G3872 Role_Start (default_discovery_mode、default_discovery_active_scan、default_discovery_white_list);
if (RssiSendTimeFlag)
{
uart_printf ("正在运行");
//RssiSendTimeFlag = 0;
}
}
当前代码状态:此外、在此函数中
基于
我应该使用的 Eddystone 命名空间 void addEddystoneToWhitelist addrType 部分:公共地址还是随机地址?
您好!
SimpleSerialSocketClient_findSerialStreamServer()函数展示了解析广播数据中128位 UUID 的方法。 https://github.com/TexasInstruments/ble_examples/blob/simplelink_cc2640r2_sdk-2.20/examples/rtos/CC2640R2_LAUNCHXL/bleapps/simple_serial_socket_client/src app/simple_serial_socket_client.c#L979
我希望这将有所帮助。
此致、