android通过蓝牙向低功耗蓝牙设备写数据
2018-01-19 17:08
330 查看
设备:
android 手机BLE 蓝牙模块
Arduino Due
备注:
蓝牙连接暂时不写,等手机蓝牙连接BLE蓝牙模块和树莓派内置蓝牙模块2种方式程序写完后,在回来补充。向BLE蓝牙设备写数据:
写字符串
currentcharac.setValue("test"); m_BT.writeCharacteristic(currentcharac); //currentcharac是BluetoothGattCharacteristic类型 //m_BT是BluetoothGatt类型
写字节
byte[] bb1 = "12345".getBytes(); currentcharac.setValue(bb); m_BT.writeCharacteristic(currentcharac); //手机上回显 byte[] bb2 = currentcharac.getValue(); String str = new String(bb2);
相关文章推荐
- Android 低功耗蓝牙的多设备连接与数据接收,简单实现
- android 通过蓝牙和设备通信 收发数据
- 在Android 8.0(API第26级)和更高版本的设备上,您可以在试图通过蓝牙、BLE和wi - fi对其他设备进行配对时定制配对请求对话框
- android通过Environment 来访问手机环境变量和存储设备数据
- Android通过蓝牙获取设备的通讯录、通话记录等
- win7与android设备通过蓝牙串口的连接方法
- android通过蓝牙实现两台手机传输数据
- Android蓝牙搜索设备,向其发送数据并接收
- Android设备通过NTRIP协议获取差分数据实现高精度定位
- Android BLE低功耗蓝牙开发(下) BLE客户端(中央设备)与GATT服务的通讯
- [Android分享] 通过蓝牙,在两台设备之间传递音频(包括音乐,通话)
- App 和设备通过蓝牙连接收发数据
- Android蓝牙搜索设备,向其发送数据并接收-刘宇
- Android Bluetooth蓝牙开发:Bluetooth蓝牙设备之间数据传输(4)
- 如何优雅的抓取低功耗蓝牙ble的数据(未经测试,需要花钱买ble设备,类似网卡)
- 在Android手持设备与穿戴设备之间通过蓝牙传递assert(如图片)
- Android Bluetooth蓝牙开发:Bluetooth蓝牙设备之间数据传输(4)
- Android: AudioRecord 通过蓝牙设备录制声音
- ionic项目中JavaScript与ble(低功耗蓝牙)设备传输数据
- win7与android设备通过蓝牙串口的连接方法