WLT8016:模组通信调试
Posted 旧年不在cd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WLT8016:模组通信调试相关的知识,希望对你有一定的参考价值。
WLT8016:模组通信调试
一、模组与手机*APP(LightBlue)*通信调试
- 透传服务
- 读写特征值
二、模组与MT7921在命令行下通信调试
- 扫描可以得到模组信息
Device 57:4C:54:37:72:4A WLT8016_724A
- 连接
connect 57:4C:54:37:72:4A
- 切换到GATT菜单
[WLT8016_724A]# menu gatt
Menu gatt:
Available commands:
-------------------
list-attributes [dev/local] List attributes
select-attribute <attribute/UUID> Select attribute
attribute-info [attribute/UUID] Select attribute
read [offset] Read attribute value
write <data=xx xx ...> [offset] [type] Write attribute value
acquire-write Acquire Write file descriptor
release-write Release Write file descriptor
acquire-notify Acquire Notify file descriptor
release-notify Release Notify file descriptor
notify <on/off> Notify attribute value
clone [dev/attribute/UUID] Clone a device or attribute
register-application [UUID ...] Register profile to connect
unregister-application Unregister profile
register-service <UUID> [handle] Register application service.
unregister-service <UUID/object> Unregister application service
register-includes <UUID> [handle] Register as Included service in.
unregister-includes <Service-UUID><Inc-UUID> Unregister Included service.
register-characteristic <UUID> <Flags=read,write,notify...> [handle] Register application characteristic
unregister-characteristic <UUID/object> Unregister application characteristic
register-descriptor <UUID> <Flags=read,write...> [handle] Register application descriptor
unregister-descriptor <UUID/object> Unregister application descriptor
back Return to main menu
version Display version
quit Quit program
exit Quit program
help Display help about this program
export Print environment variables
- 列出设备的所有属性
[WLT8016_724A]# list-attributes
Primary Service (Handle 0x4590)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000a
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000a/char000b
00002a05-0000-1000-8000-00805f9b34fb
Service Changed
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000a/char000b/desc000d
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
Primary Service (Handle 0x6e94)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e
0000180a-0000-1000-8000-00805f9b34fb
Device Information
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e/char000f
00002a25-0000-1000-8000-00805f9b34fb
Serial Number String
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e/char0011
00002a28-0000-1000-8000-00805f9b34fb
Software Revision String
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e/char0013
00002a27-0000-1000-8000-00805f9b34fb
Hardware Revision String
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e/char0015
00002a29-0000-1000-8000-00805f9b34fb
Manufacturer Name String
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service000e/char0017
00002a24-0000-1000-8000-00805f9b34fb
Model Number String
Primary Service (Handle 0x6e94)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019
0000fff0-0000-1000-8000-00805f9b34fb
Unknown
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001a
0000fff1-0000-1000-8000-00805f9b34fb
Unknown
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001a/desc001c
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001a/desc001d
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic (Handle 0x0240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001e
0000fff2-0000-1000-8000-00805f9b34fb
Unknown
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001e/desc0020
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Primary Service (Handle 0x6e94)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021
0000ffe0-0000-1000-8000-00805f9b34fb
Unknown
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021/char0022
0000ffe1-0000-1000-8000-00805f9b34fb
Unknown
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021/char0022/desc0024
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021/char0022/desc0025
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic (Handle 0x41b0)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021/char0026
0000ffe2-0000-1000-8000-00805f9b34fb
Unknown
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0021/char0026/desc0028
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Primary Service (Handle 0x6e94)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029
02f00000-0000-0000-0000-00000000fe00
Vendor specific
Characteristic (Handle 0xb240)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char002a
02f00000-0000-0000-0000-00000000ff03
Vendor specific
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char002a/desc002c
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic (Handle 0x5ee0)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char002d
02f00000-0000-0000-0000-00000000ff02
Vendor specific
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char002d/desc002f
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char002d/desc0030
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic (Handle 0x7740)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char0031
02f00000-0000-0000-0000-00000000ff00
Vendor specific
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char0031/desc0033
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic (Handle 0x7ba0)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char0034
02f00000-0000-0000-0000-00000000ff01
Vendor specific
Descriptor (Handle 0x0000)
/org/bluez/hci0/dev_57_4C_54_37_72_4A/service0029/char0034/desc0036
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
- 选中要操作的属性值0xFFF1
[WLT8016_724A]# select-attribute 0000fff1-0000-1000-8000-00805f9b34fb
[WLT8016_724A:/service0019/char001a]#
- 查看属性信息
[WLT8016_724A]# attribute-info 0000fff1-0000-1000-8000-00805f9b34fb
Characteristic - Unknown
UUID: 0000fff1-0000-1000-8000-00805f9b34fb
Service: /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019
Notifying: no
Flags: notify
- 开启/关闭notify
[WLT8016_724A:/service0019/char001a]# notify on
[CHG] Attribute /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001a Notifying: yes
Notify started
[WLT8016_724A:/service0019/char001a]# notify off
[CHG] Attribute /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001a Notifying: no
Notify stopped
- 选中要操作的属性值0xFFF2
[WLT8016_724A:/service0019/char001a]# select-attribute 0000fff2-0000-1000-8000-00805f9b34fb
[WLT8016_724A:/service0019/char001e]#
- 查看属性信息
[WLT8016_724A:/service0019/char001e]# attribute-info 0000fff2-0000-1000-8000-00805f9b34fb
Characteristic - Unknown
UUID: 0000fff2-0000-1000-8000-00805f9b34fb
Service: /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019
Flags: write-without-response
- 写数据
[WLT8016_724A:/service0019/char001e]# write 0xaa
Attempting to write /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001e
[WLT8016_724A:/service0019/char001e]# write '0xaa 0xbb'
Attempting to write /org/bluez/hci0/dev_57_4C_54_37_72_4A/service0019/char001e
以上是关于WLT8016:模组通信调试的主要内容,如果未能解决你的问题,请参考以下文章