question: private void writePacket ( final BluetoothGatt gatt , final BluetoothGattCharacteristic characteristic , final byte [ ] buffer , final int size ) { byte [ ] locBuffer = buffer ; if ( size <= 0 ) return ; if ( buffer . length != size ) { locBuffer = new byte [ size ] ; System . arraycopy ( buffer , 0 , locBuffer , 0 , size ) ; } characteristic . setWriteType ( BluetoothGattCharacteristic . WRITE_TYPE_NO_RESPONSE ) ; characteristic . setValue ( locBuffer ) ; gatt . writeCharacteristic ( characteristic ) ; }
target:  Writes the buffer to the characteristic. The maximum size of the buffer is 20 bytes. This method is ASYNCHRONOUS and returns immediately after adding the data to TX queue.