蓝牙学习 (8)配对raspberryPi和SensorTag CC2650

8 篇文章 0 订阅

在上一篇中,用raspberryPi能够扫描到Ti SensorTag. 但是没有获得更多的数据,并且发现sensor Tag并没有回复scan request。
https://blog.csdn.net/feiwatson/article/details/82946621

这里我们利用gatttool来配对。

pi@raspberrypi:~ $ gatttool --help
Usage:
  gatttool [OPTION...]

Application Options:
  -i, --adapter=hciX                        Specify local adapter interface
  -b, --device=MAC                          Specify remote Bluetooth address
  -t, --addr-type=[public | random]         Set LE address type. Default: public
  -m, --mtu=MTU                             Specify the MTU size
  -p, --psm=PSM                             Specify the PSM for GATT/ATT over BR/EDR
  -l, --sec-level=[low | medium | high]     Set security level. Default: low
  -I, --interactive                         Use interactive mode
pi@raspberrypi:~ $ sudo gatttool -b 54:6C:0E:80:B4:86 --interactive 
[54:6C:0E:80:B4:86][LE]> help
help                                           Show this help
exit                                           Exit interactive mode
quit                                           Exit interactive mode
connect         [address [address type]]       Connect to a remote device
disconnect                                     Disconnect from a remote device
primary         [UUID]                         Primary Service Discovery
included        [start hnd [end hnd]]          Find Included Services
characteristics [start hnd [end hnd [UUID]]]   Characteristics Discovery
char-desc       [start hnd] [end hnd]          Characteristics Descriptor Discovery
char-read-hnd   <handle>                       Characteristics Value/Descriptor Read by handle
char-read-uuid  <UUID> [start hnd] [end hnd]   Characteristics Value/Descriptor Read by UUID
char-write-req  <handle> <new value>           Characteristic Value Write (Write Request)
char-write-cmd  <handle> <new value>           Characteristic Value Write (No response)
sec-level       [low | medium | high]          Set security level. Default: low
mtu             <value>                        Exchange MTU for GATT/ATT
[54:6C:0E:80:B4:86][LE]> 

建立Interactive Session, 读取温度值

[54:6C:0E:80:B4:86][LE]> connect
Attempting to connect to 54:6C:0E:80:B4:86
Connection successful
[54:6C:0E:80:B4:86][LE]> char-read-hnd 0x21
Characteristic value/descriptor: 04 00 ad 27 01 11 31 
[54:6C:0E:80:B4:86][LE]> disconnect
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
新的 SimpleLink 多标准 SensorTag 物联网套件邀请您将自己的云连接产品创意付诸实践。该套件包含 10 个低功耗 MEMS 传感器,采用小尺寸封装,可以使用 DevPack 实现扩展,易于添加您自己的传感器或传动器。 通过 Bluetooth Smart:registered: 连接到云,在三分钟内在线获得传感器数据。SensorTag 开箱即可使用,带有 iOS 和 Android 应用,无需编程经验即可开始使用。 新 SensorTagCC2650 无线 MCU 为基础,功耗比此前的蓝牙智能产品低 75%。因此,SensorTag 可以使用电池供电,一个纽扣电池就可以使用几年。 蓝牙智能 SensorTag 包含 iBeacon 技术。该技术使您的电话可以根据 SensorTag 数据和物理位置启动应用程序并自定义内容。 此外,可通过 ZigBee:registered: 和 6LoWPAN 技术启用 SensorTag。 ► 核心技术优势 Ti CC2650 穿戴式演示套件 ► 方案规格 支持 10 个低功耗传感器,包括环境光、数字麦克风、磁传感器、湿度、压力、加速计、陀螺仪、磁力计、物体温度以及环境温度 超低功耗,通过单个纽扣电池提供数年的电池寿命,并通过高性能 ARM:registered: Cortex:registered:-M3 CC2650 无线 MCU 实现无电池应用。 可借助云连接从任意地点访问和控制您的 SensorTag 可借助多标准支持通过简单的固件升级启用 ZigBee 或 6LoWPAN DevPack 让您可以按照自己的设计扩展 SensorTag 方案来源于大大通。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值