bluetooth-serial-port 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/BluetoothSerialPort.abi108.node +0 -0
- package/prebuilds/darwin-arm64/BluetoothSerialPort.abi115.node +0 -0
- package/prebuilds/darwin-arm64/BluetoothSerialPort.abi127.node +0 -0
- package/prebuilds/darwin-arm64/BluetoothSerialPort.abi137.node +0 -0
- package/prebuilds/linux-arm64/BluetoothSerialPortServer.abi108.node +0 -0
- package/prebuilds/linux-arm64/BluetoothSerialPortServer.abi115.node +0 -0
- package/prebuilds/linux-arm64/BluetoothSerialPortServer.abi127.node +0 -0
- package/prebuilds/linux-arm64/BluetoothSerialPortServer.abi137.node +0 -0
- package/prebuilds/linux-x64/BluetoothSerialPortServer.abi108.node +0 -0
- package/prebuilds/linux-x64/BluetoothSerialPortServer.abi115.node +0 -0
- package/prebuilds/linux-x64/BluetoothSerialPortServer.abi127.node +0 -0
- package/prebuilds/linux-x64/BluetoothSerialPortServer.abi137.node +0 -0
- package/prebuilds/win32-x64/BluetoothSerialPort.abi108.node +0 -0
- package/prebuilds/win32-x64/BluetoothSerialPort.abi115.node +0 -0
- package/prebuilds/win32-x64/BluetoothSerialPort.abi127.node +0 -0
- package/prebuilds/win32-x64/BluetoothSerialPort.abi137.node +0 -0
- package/src/linux/BTSerialPortBindingServer.cc +2 -2
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ Check whether the connection is open or not.
|
|
|
221
221
|
Writes a [Buffer](http://nodejs.org/api/buffer.html) to the serial port connection.
|
|
222
222
|
|
|
223
223
|
- buffer - the [Buffer](http://nodejs.org/api/buffer.html) to be written.
|
|
224
|
-
- callback(err, bytesWritten) - is called when the write action has been completed. When the `err` parameter is set an error has
|
|
224
|
+
- callback(err, bytesWritten) - is called when the write action has been completed. When the `err` parameter is set an error has occurred, in that case `err` is an [Error object](http://docs.nodejitsu.com/articles/errors/what-is-the-error-object). When `err` is not set the write action was successful and `bytesWritten` contains the amount of bytes that is written to the connection.
|
|
225
225
|
|
|
226
226
|
#### BluetoothSerialPort.listPairedDevices(callback)
|
|
227
227
|
|
|
@@ -284,7 +284,7 @@ Emitted when the server is closed (i.e. from calling `close` or as the result of
|
|
|
284
284
|
|
|
285
285
|
Emitted when reading from the serial port connection results in an error. The connection is closed.
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
* `err` - an [Error object](http://docs.nodejitsu.com/articles/errors/what-is-the-error-object) describing the failure.
|
|
288
288
|
|
|
289
289
|
## Typescript support
|
|
290
290
|
|
|
@@ -296,7 +296,7 @@ import * as btSerial from "bluetooth-serial-port";
|
|
|
296
296
|
btSerial.findSerialPortChannel(address: string, (channel: number) => {
|
|
297
297
|
btSerial.connect(address: string, channel: number, () => {
|
|
298
298
|
btSerial.write(Buffer.from("yes"), (err) => {
|
|
299
|
-
|
|
299
|
+
if (err) {
|
|
300
300
|
console.error(err);
|
|
301
301
|
}
|
|
302
302
|
});
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -652,7 +652,7 @@ BTSerialPortBindingServer::ClientWorker::~ClientWorker()
|
|
|
652
652
|
|
|
653
653
|
void BTSerialPortBindingServer::ClientWorker::Execute(){
|
|
654
654
|
if(mBaton == nullptr){
|
|
655
|
-
return
|
|
655
|
+
return SetErrorMessage("listen_baton_t is null!");
|
|
656
656
|
}
|
|
657
657
|
|
|
658
658
|
struct sockaddr_rc clientAddress = {
|
|
@@ -677,7 +677,7 @@ void BTSerialPortBindingServer::ClientWorker::Execute(){
|
|
|
677
677
|
break;
|
|
678
678
|
}
|
|
679
679
|
else if (select_status == -1) {
|
|
680
|
-
return
|
|
680
|
+
return SetErrorMessage("error pselect'ing socket!");
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
|