forked from noble/noble
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: lint issues within new features
- Loading branch information
1 parent
1e0b643
commit d9b60eb
Showing
6 changed files
with
81 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
const noble = require('../with-custom-binding') | ||
const noble = require('../with-custom-binding'); | ||
|
||
// Needs to export env: BLUETOOTH_HCI_SOCKET_FORCE_UART=1 | ||
|
||
const noble_uart_a = noble ({ bindParams: { uart: { port: "/dev/tty.usbmodem1..." } } } ) | ||
const noble_uart_b = noble ({ bindParams: { uart: { port: "/dev/tty.usbmodem2..." } } } ) | ||
const nobleUartA = noble({ bindParams: { uart: { port: '/dev/tty.usbmodem1...' } } }); | ||
const nobleUartB = noble({ bindParams: { uart: { port: '/dev/tty.usbmodem2...' } } }); | ||
|
||
noble_uart_a.on('discover', peripheral => { | ||
console.log("UART A", peripheral.address) | ||
}) | ||
nobleUartA.on('discover', peripheral => { | ||
console.log('UART A', peripheral.address); | ||
}); | ||
|
||
noble_uart_b.on('discover', peripheral => { | ||
console.log("UART B", peripheral.address) | ||
}) | ||
nobleUartB.on('discover', peripheral => { | ||
console.log('UART B', peripheral.address); | ||
}); | ||
|
||
noble_uart_a.on('stateChange', state => { | ||
if(state === 'poweredOn') { | ||
noble_uart_a.setAddress("00:11:22:33:44:01"); | ||
noble_uart_a.startScanning() | ||
} | ||
nobleUartA.on('stateChange', state => { | ||
if (state === 'poweredOn') { | ||
nobleUartA.setAddress('00:11:22:33:44:01'); | ||
nobleUartA.startScanning(); | ||
} | ||
}); | ||
|
||
noble_uart_b.on('stateChange', state => { | ||
if(state === 'poweredOn') { | ||
noble_uart_b.setAddress("00:11:22:33:44:02"); | ||
noble_uart_b.startScanning() | ||
} | ||
nobleUartB.on('stateChange', state => { | ||
if (state === 'poweredOn') { | ||
nobleUartB.setAddress('00:11:22:33:44:02'); | ||
nobleUartB.startScanning(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters