Private
Readonly
_evPrivate
_keepPrivate
_lastPrivate
_minPrivate
Optional
_notifyPrivate
Optional
_onPrivate
Readonly
_pixelsPrivate
Optional
_prunePrivate
_scanPrivate
Optional
_startPrivate
_statusPrivate
Readonly
_touchedPrivate
Static
Readonly
_sharedWhether a scan may be started.
The duration in milliseconds for which a Scanned Pixel should be considered available since the last received advertisement. A value of 0 keeps the dice forever.
5000.
The minimum time interval in milliseconds between two "scanListOperations" notifications. (calls to PixelScanner.scanListener). A value of 0 will generate a notification on every scan event.
200.
An optional filter to only keep certain Pixels in the list. Setting a new filter will only affect new scan events, the current list of scanned Pixels will stay unchanged.
A copy of the list of scanned Pixels (cleared on loosing Bluetooth access if PixelScanner.keepAliveDuration is greater than zero). Only Pixels matching the PixelScanner.scanFilter are included.
The scan status of this instance.
Private
_clearPrivate
_emitPrivate
_notifyPrivate
_processPrivate
_processReadonly
scanOptional
Readonly
stopReadonly
type: "status"Private
_processPrivate
_prunePrivate
_scheduleRegisters a listener function that will be called when the specified event is raised. See PixelScannerEventMap for the list of events and their associated data.
A case-sensitive string representing the event type to listen for.
The callback function.
Unregisters a listener from receiving events identified by the given event name. See PixelScannerEventMap for the list of events and their associated data.
A case-sensitive string representing the event type.
The callback function to unregister.
Queues a command to start a Bluetooth scan for Pixels and update the list as advertisement packets are being received. If the instance is already scanning it will just notify of pending list operations or clear the list if clearOnStop is true.
A promise.
Calls to the async methods of this class are queued and executed in order.
On Android, BLE scanning will fail without error when started more than 5 times over the last 30 seconds.
Generated using TypeDoc
Represents a list of scanned Pixels that is updated when scanning. Set a callback to PixelScanner.scanListener to get notified when the list is updated.
When powered on but not yet connected, a Pixels die will periodically emit information which is picked up by the scanner. Typically the information is send a few times per second.
Calls to the async methods of this class are queued and executed in order across all instances.
Remarks
Even though the roll state and roll face are included in a ScannedPixel instance, this data is not emitted in a reliable way.
To get reliably notified for rolls, first connect to the die and listen for roll events.