AbstractProtectedconstructorProtected Readonly_msgProtected Readonly_serializerReadonlyisAbstracttypeStaticMutableAbstractbatteryThe Pixel battery level (percentage).
AbstractcolorwayThe Pixel color.
AbstractcurrentThe value of the die face that is currently facing up.
AbstractcurrentThe 0-based index of the die face that is currently facing up.
A D20 die will have face indices ranging from 0 to 19.
Index 0 corresponds to face 1 and index 19 to face 20.
D10 and D00 share the same face indices but have different face values.
Index 0 corresponds to face 0 of both dice types.
Index 9 corresponds to face 9 for a D10 and to face 90 for a D00.
The fudge die returns the following indices:
- O and 5 for the "+" face .
- 1 and 4 for the "-" face.
- 2 and 3 for the "blank" face.
AbstractdieThe Pixel die type.
AbstractfirmwareThe Pixel firmware build date.
AbstractisWhether the Pixel battery is charging or not. Set to 'true' if fully charged but still on charger.
AbstractledThe number of LEDs of the Pixel.
Set logger to use by this instance.
Toggle logging information about each send and received message.
Toggle logging the serialized (binary) data for each send and received message.
AbstractnameThe Pixels die name.
AbstractpixelThe unique Pixel id of the device.
AbstractrollThe Pixel roll state.
AbstractrssiThe last RSSI value measured by the Pixel.
ProtectedsessionGets the Pixel last known connection status.
AbstractsystemThe unique id assigned by the system to the Pixel Bluetooth peripheral.
Protected_emitProtected Abstract_internalProtected Abstract_internalProtected_internalSends a message to the Pixel and wait for a specific response.
Message with the data to send or just a message type.
Expected response type.
OptionaltimeoutMs: numberTimeout in mill-seconds before aborting waiting for the response.
A promise resolving to the response in the form of a message type or a message object.
Protected_internalSends a message to the Pixel and wait for a specific response which is returned casted to the expected type.
Message with the data to send or just a message type.
Expected response class type.
OptionaltimeoutMs: numberA promise resolving to a message object of the expected type.
Protected_internalSends a message to the Pixel.
Message with the data to send or just a message type.
OptionalwithoutAck: booleanWhether to request a confirmation that the message was received.
A promise that resolves once the message has been send.
Protected Abstract_internalProtected_internalWaits for a message from the Pixel.
Type of the message to expect.
OptionaltimeoutMs: numberTimeout before aborting the wait.
A promise with the received message of the expected type.
Protected_logProtected_logProtected_tagProtected_warnRegisters a listener function that will be called when the specified event is raised. See PixelEventMap for the list of events and their associated data.
A case-sensitive string representing the event type to listen for.
The callback function.
Registers a listener function that will be called on receiving raw messages of a given type from the Pixel.
The type of message to watch for.
The callback function.
Adds the given listener function for the specified property.
The name of the property.
The callback function.
Asynchronously tries to connect to the device. Throws on connection error.
OptionaltimeoutMs: numberDelay before giving up (may be ignored when having concurrent calls to connect()). It may take longer than the given timeout for the function to return.
A promise that resoles to this instance once the connection has been established.
Will throw a PixelConnectError if it fails to connect in time.
Immediately disconnects from the device.
A promise that resolves once the disconnect request has been processed.
ProtectedemitUnregisters a listener from receiving events identified by the given event name. See PixelEventMap for the list of events and their associated data.
A case-sensitive string representing the event type.
The callback function to unregister.
Unregisters a listener from receiving raw messages of a given type.
The type of message to watch for.
The callback function to unregister.
Removes the given listener function for the specified property.
The name of the property.
The callback function to unregister.
Abstract class that represents a connection to a Pixel device (die, charger, etc.).