Skip to content

Commit 55a5eda

Browse files
committed
use charset also for sending
1 parent d8678e8 commit 55a5eda

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

androidBluetoothSerial/src/main/java/com/harrysoft/androidbluetoothserial/BluetoothManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public Single<BluetoothSerialDevice> openSerialDevice(String mac) {
6161
/**
6262
* @param mac The MAC address of the device
6363
* you are trying to connect to
64-
* @param charset The Charset to use to decode incoming stream
64+
* @param charset The Charset to use for input/output streams
6565
* @return An RxJava Single, that will either emit
6666
* a BluetoothSerialDevice or a BluetoothConnectException
6767
*/

androidBluetoothSerial/src/main/java/com/harrysoft/androidbluetoothserial/BluetoothSerialDevice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static BluetoothSerialDevice getInstance(String mac, BluetoothSocket socket, Cha
4747
*/
4848
public Completable send(String message) {
4949
requireNotClosed();
50-
return Completable.fromAction(() -> { if (!closed) outputStream.write(message.getBytes()); });
50+
return Completable.fromAction(() -> { if (!closed) outputStream.write(message.getBytes(charset)); });
5151
}
5252

5353
/**

0 commit comments

Comments
 (0)