android BluetoothGatt.writeCharacteristic()기록 반환 false

http://stackoverflow.com/questions/23879869/bluetoothgatt-writecharacteristic-always-returns-false
BluetoothGatt    :

byte[] data_to_write; // Your data
BluetoothManager mBluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SREVICE);
BluetoothAdapter mBluetoothAdapter = mBluetoothManager.getAdapter();
BluetoothDevice mDevice = mBluetoothAdapter.getRemoteDevice(....);
BluetoothGatt mBG = mDevice.connectGatt(....);

BluetoothGattService mSVC = mBG.getService(service_uuid);
BluetoothGattCharacteristic mCH = mSVC.getCharacteristic(characteristic_uuid);
mCH.setValue(data_to_write);
mBG.writeCharacteristic(mCH);

좋은 웹페이지 즐겨찾기