Last active
June 1, 2016 12:32
-
-
Save marchbold/8609d4dcb6901cf9d81d to your computer and use it in GitHub Desktop.
Bluetooth LE: Start scanning as a central for advertising peripheral devices
This file contains hidden or 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
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.DISCOVERED, central_peripheralDiscoveredHandler ); | |
if (!BluetoothLE.service.centralManager.scanForPeripherals()) | |
{ | |
// There was an error starting to scan, check the state of the adapter! | |
} | |
... | |
private function central_peripheralDiscoveredHandler( event:PeripheralEvent ):void | |
{ | |
// event.peripheral will contain a Peripheral object with information about the Peripheral | |
trace( "peripheral discovered: "+ event.peripheral.name ); | |
} | |
// com.distriqt.BluetoothLE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment