日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nrf51822添加UUID

發布時間:2023/12/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nrf51822添加UUID 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

問題 :添加一個自己的uuid

I’m new to use nordic and I would like to add a new custom service (2320EE58-8654-4132-95F7-0A872AC0958F) with a custom characteristic(23200000-8654-4132-95F7-0A872AC0958F) I’m using nRF51 and mBed compiler. Thank’s for a further reply and for the time. Regardes

添加uuid的步驟

Hi Epasta,

Nordic’s application note nAN-36 is the best guide for implementing custom services and characteristics.

Generally speaking, your service will take the form ABCDxxxx-EF12-3456-7890-ABCDEF123456 as a “base UUID” and then the 16-bits are used to identify the service itself and the characteristics under it. The lowercase x’s are where you specify your service/characteristc. For example, I implemented my service as f30900010-4903-4c71-8d16-549852aba4c5 and added a characteristic to it that had a full UUID as f3090011-4903-4c71-8d16-549852taba4c5 using the following code:

#define PIP_UUID_BASE {0xC5, 0xA4, 0xAB, 0x52, 0x98, 0x54, 0x16, 0x8D, 0x71, 0x4C, 0x03, 0x4A, 0x00, 0x00, 0x09, 0xF3} #define LTES_UUID_SERVICE 0x0010 #define LTES_UUID_DISCIP_CHAR 0x0011

From there, you have to add your register your base uuid with softdevice using:

sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type)

Then add your service using:

sd_ble_gatts_service_add(uint8_t type, ble_uuid_t const *p_uuid, uint16_t *p_handle)

Then add your characteristic using:

sd_ble_gatts_characteristic_add(uint16_t service_handle, ble_gatts_char_md_t const *p_char_md, ble_gatts_attr_t const *p_attr_char_value, ble_gatts_char_handles_t *p_handles)

Hope this helps!

Regards, michael

總結

以上是生活随笔為你收集整理的nrf51822添加UUID的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。