Instantiates a MPC.
The session used to communicate with the MPC.
Optionalinfo: Partial<Pick<Readonly<{ Protected Readonly_msgProtected Readonly_serializerReadonlyisReadonlytypeDevice type is Pixels MPC.
StaticMutableGets the MPC battery level (percentage).
Always return "unknown".
Always return "0".
Always return "0".
Always return "unknown".
Gets the MPC firmware build date.
Gets whether the MPC battery is charging or not. Returns 'true' if fully charged but still on charger.
Gets the number of LEDs for the MPC, may be 0 until connected to device.
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.
Gets the MPC name, may be empty until connected to device.
Gets the unique Pixel id of the MPC, may be 0 until connected.
Always return "unknown".
Gets the last RSSI value notified by the MPC.
Call () to automatically update the RSSI value.
ProtectedsessionGets the Pixel last known connection status.
Gets the unique id assigned by the system to the MPC Bluetooth peripheral.
Protected_emitProtected_internalProtected_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_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.
Requests the MPC to blink and wait for a confirmation.
Blink color.
Optionalopt: { Optionalcount?: numberNumber of blinks.
Optionalduration?: numberTotal duration of the animation in milliseconds.
OptionalfaceSelect which faces to light up.
Optionalfade?: numberAmount of in and out fading, 0: sharp transition, 1: maximum fading.
OptionalloopHow many times to loop the animation.
A promise that resolves once the die has confirmed receiving the message.
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.
Requests the MPC to regularly send its measured RSSI value.
Optionalactivate: booleanWhether to turn or turn off this feature.
OptionalminInterval: numberThe minimum time interval in milliseconds between two RSSI updates.
A promise that resolves once the message has been send.
Sends a message to the MPC 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.
Sends a message to the MPC 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.
Sends a message to the MPC.
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.
Update MPC info from an external source such as scanning data.
The updated info.
Represents a Pixels Multi Purpose Controller (MPC). Most of its methods require the instance to be connected to the MPC. Call the () method to initiate a connection.
Call addEventListener to get notified for rolls, connection and disconnection events and more.
Call addPropertyListener to get notified on property changes.