bluetooth-hci-socket
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -15,2 +15,10 @@ var events = require('events'); | ||
BluetoothHciSocket.prototype.getAddress = function() { | ||
return this.getAddressBytes().toString('hex').match(/.{1,2}/g).reverse().join(':'); | ||
}; | ||
BluetoothHciSocket.prototype.getAddressType = function() { | ||
return 'public'; | ||
}; | ||
module.exports = BluetoothHciSocket; |
{ | ||
"name": "bluetooth-hci-socket", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Bluetooth HCI socket binding for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,2 +43,18 @@ # node-bluetooth-hci-socket | ||
#### Address | ||
Get the device (Bluetooth/BT) address. __Note:__ must be called after ```bind```. | ||
``` | ||
var btAddress = bluetoothHciSocket.getAddress(); | ||
``` | ||
#### Address Type | ||
Get the device (Bluetooth/BT) address type. __Note:__ must be called after ```bind```. | ||
``` | ||
var btAddressType = bluetoothHciSocket.getAddressType(); // returns: 'public' or 'random' | ||
``` | ||
#### Is Device Up | ||
@@ -49,3 +65,3 @@ | ||
``` | ||
bluetoothHciSocket.isDevUp(); // returns: true or false | ||
var isDevUp = bluetoothHciSocket.isDevUp(); // returns: true or false | ||
``` | ||
@@ -52,0 +68,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28706
11
397
115