값을 받는것이 아니라,, 보내는 작업을 하려고 합니다.
ble통신할 때 한 번에 보낼 수있는 byte가 최대 20이라고 하는데 이건 문제가 없구요..
해당 앱에서 버튼A라는 녀석을 눌렀을 때 byte 배열(byte[])에 값을 넣어서 보내려고 합니다.
byte a=1;
byte b=2;
byte[] send = {a,b};
mBluetoothLeService.writeCharacteristic(mWriteCharacteristic, send );
-
public void writeCharacteristic(BluetoothGattCharacteristic characteristic,
byte[] send)
{
if (mBluetoothAdapter == null || mBluetoothGatt == null)
{
Log.w(TAG, "BluetoothAdapter not initialized");
return;
}
mBluetoothGatt.writeCharacteristic(characteristic);
}
이런식으로 보내려고 하는데 맞는 방법인가요..?