android蓝牙write,java – Android蓝牙状态133在onCharacteristicwrite

我是

Android的新手,现在正在做一个简单的应用程序,需要将一些数据写入外围设备.

三星GT-S7272C设备其实没有什么问题.但是当我切换到Sony LT29i时,当我试图写入某个特性时,总是会有一个状态133.我会给出一些简短的代码.

BluetoothGattService syncService = gatt.getService(SYNC_DATA_SERVICE);

BluetoothGattCharacteristic tChar = syncService.getCharacteristic(SYNC_TIME_INPUT_CHAR);

if (tChar == null) throw new AssertionError("characteristic null when sync time!");

int diff = /*a int*/;

tChar.setValue(diff,BluetoothGattCharacteristic.FORMAT_SINT32,0);

gatt.writeCharacteristic(tChar);

和onCharacteristicWrite函数:

@Override

public void onCharacteristicWrite(BluetoothGatt gatt,BluetoothGattCharacteristic characteristic,int status) {

Log.d(TAG,String.format("Sync: onCharWrite,status = %d",status));

try {

if (status != BluetoothGatt.GATT_SUCCESS) throw new AssertionEr


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部