nrf51822添加UUID
来源:互联网 发布:数据库表格模板 编辑:程序博客网 时间:2024/06/06 19:12
问题 :添加一个自己的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
- nrf51822 --- 特征值添加描述
- nrf51822-添加DFU服务
- nrf51822-添加DFU服务
- Nrf51822中设置128bit UUID service
- nrf51822-使用16位自定义UUID
- nrf51822-使用16位自定义UUID
- nrf51822, How to use a vendor specific UUID?
- nRF51822 自定义UUID,ble_advdata_set的时候 NRF_ERROR_DATA_SIZE 错误的解决
- NRF51822
- nRF51822
- nrf51822开发问题汇总【持续添加】
- PHP添加uuid()模块支持
- TI BLE 添加自己UUID
- NRF51822开发中常见问题和解决办法汇总----持续添加
- 给 TI BLE 添加自己UUID
- 给 TI BLE 添加自己UUID
- 给 TI BLE 添加自己UUID
- 开源中国 Maven 库使用帮助
- Qt creator 调试器未设置 unkown debugger type
- Quartz2D 学习札记
- 使用ssh连接centos出现密钥错误的解决方法
- LeetCode 206. Reverse Linked List
- nrf51822添加UUID
- 用R简单实现分词
- zabbix监控之redis自动发现并监控
- Jmeter监控服务器性能
- Poj 2785 4 Values whose Sum is 0【二分查找】
- java高并发
- 音乐播放器
- Fragment生命周期
- 使用 OpenSSL API 进行安全编程