Last active
August 29, 2015 14:22
-
-
Save cgreening/9b283859a0149fd4922c to your computer and use it in GitHub Desktop.
Scan for peripherals
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
nodule.scanForPeripherals(<NAME REGEX>, [<SERVICE UUIDS>]); | |
// e.g. Scan for all peripherals with names ending in Temperature | |
nodule.scanForPeripherals(/.*Temperature/); | |
// e.g. Scan for all peripherals that advertise battery level and heart rate services | |
nodule.scanForPeripherals(/.*/, ['180F', '180D']); | |
nodule.on('scan', function(peripherals) { | |
// peripherals is an array of matching peripherals | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment