美文网首页
BLE_ST-beacon更新设备名称

BLE_ST-beacon更新设备名称

作者: 董占峰 | 来源:发表于2018-12-28 10:02 被阅读0次

    设备:blueNRG-132
    SDK:

    sdk.png

    更改对象:BLE_Beacon_main.c

    更改函数:

    void Device_Init(void)
    

    添加内容如下

      /* Update device name */
      ret = aci_gatt_update_char_value_ext(0, service_handle, dev_name_char_handle, 0,sizeof(device_name), 0, sizeof(device_name), device_name);
      if(ret != BLE_STATUS_SUCCESS) {
        printf("aci_gatt_update_char_value_ext() failed: 0x%02x\r\n", ret);
      }
    

    更改函数:

    static void Start_Beaconing(void)
    

    添加内容:

    uint8_t local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'}; 
    
      /* put device in non connectable mode */
      ret = aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR, NO_WHITE_LIST_USE, sizeof(local_name), local_name, 0, NULL, 0, 0); 
    

    更改宏定义

    #define ENABLE_FLAGS_AD_TYPE_AT_BEGINNING 0
    

    相关文章

      网友评论

          本文标题:BLE_ST-beacon更新设备名称

          本文链接:https://www.haomeiwen.com/subject/eoxslqtx.html