import { ChunkMessage } from "./ChunkMessage"; import { MessageSerializer } from "./MessageSerializer"; import { PixelMessage } from "./PixelMessage"; /** * Lists all the Pixel dice message types. * The value is used for the first byte of data in a Pixel message to identify it's type. * These message identifiers have to match up with the ones on the firmware. * @enum * @category Message */ export declare const MessageTypeValues: { readonly none: number; readonly whoAreYou: number; readonly iAmADie: number; readonly rollState: number; readonly telemetry: number; readonly bulkSetup: number; readonly bulkSetupAck: number; readonly bulkData: number; readonly bulkDataAck: number; readonly transferAnimationSet: number; readonly transferAnimationSetAck: number; readonly transferAnimationSetFinished: number; readonly transferSettings: number; readonly transferSettingsAck: number; readonly transferSettingsFinished: number; readonly transferTestAnimationSet: number; readonly transferTestAnimationSetAck: number; readonly transferTestAnimationSetFinished: number; readonly debugLog: number; readonly playAnimation: number; readonly playAnimationEvent: number; readonly stopAnimation: number; readonly remoteAction: number; readonly requestRollState: number; readonly requestAnimationSet: number; readonly requestSettings: number; readonly requestTelemetry: number; readonly programDefaultAnimationSet: number; readonly programDefaultAnimationSetFinished: number; readonly blink: number; readonly blinkAck: number; readonly requestDefaultAnimationSetColor: number; readonly defaultAnimationSetColor: number; readonly requestBatteryLevel: number; readonly batteryLevel: number; readonly requestRssi: number; readonly rssi: number; readonly calibrate: number; readonly calibrateFace: number; readonly notifyUser: number; readonly notifyUserAck: number; readonly testHardware: number; readonly storeValue: number; readonly storeValueAck: number; readonly setTopLevelState: number; readonly programDefaultParameters: number; readonly programDefaultParametersFinished: number; readonly setDesignAndColor: number; readonly setDesignAndColorAck: number; readonly setCurrentBehavior: number; readonly setCurrentBehaviorAck: number; readonly setName: number; readonly setNameAck: number; readonly powerOperation: number; readonly exitValidation: number; readonly transferInstantAnimationSet: number; readonly transferInstantAnimationSetAck: number; readonly transferInstantAnimationSetFinished: number; readonly playInstantAnimation: number; readonly stopAllAnimations: number; readonly requestTemperature: number; readonly temperature: number; readonly setBatteryControllerMode: number; readonly _unused: number; readonly discharge: number; readonly blinkId: number; readonly blinkIdAck: number; readonly transferTest: number; readonly transferTestAck: number; readonly transferTestFinished: number; readonly clearSettings: number; readonly clearSettingsAck: number; readonly testBulkSend: number; readonly testBulkReceive: number; readonly setAllLEDsToColor: number; readonly attractMode: number; readonly printNormals: number; readonly printA2DReadings: number; readonly lightUpFace: number; readonly setLEDToColor: number; readonly printAnimationControllerState: number; }; /** * The names for the "enum" type {@link MessageTypeValues}. * @category Message */ export type MessageType = keyof typeof MessageTypeValues; /** * Union type of {@link PixelMessage} and {@link MessageType} types. * Messages without parameter have no {@link PixelMessage} class to represent them, * instead they are represent by the corresponding {@link MessageTypeValues}. * @category Message */ export type MessageOrType = PixelMessage | MessageType; /** * Pixel version info message chunk. * @category Message */ export declare class VersionInfoChunk implements ChunkMessage { /** Size in bytes of the version info data chunk. */ chunkSize: number; firmwareVersion: number; buildTimestamp: number; settingsVersion: number; compatStandardApiVersion: number; compatExtendedApiVersion: number; compatManagementApiVersion: number; } /** * Pixel general info message chunk. * @category Message */ export declare class DieInfoChunk implements ChunkMessage { /** Size in bytes of the die info data chunk. */ chunkSize: number; /** The unique Pixel id. */ pixelId: number; chipModel: number; dieType: number; /** Number of LEDs. */ ledCount: number; /** Die look. */ colorway: number; } /** * Pixel custom design & color name message chunk. * @category Message */ export declare class CustomDesignAndColorNameChunk implements ChunkMessage { chunkSize: number; name: string; } /** * Pixel name message chunk. * @category Message */ export declare class DieNameChunk implements ChunkMessage { chunkSize: number; name: string; } /** * Pixel settings message chunk. * @category Message */ export declare class SettingsInfoChunk implements ChunkMessage { /** Size in bytes of the settings info data chunk. */ chunkSize: number; /** Hash of the uploaded profile. */ profileDataHash: number; /** Amount of available flash to store data. */ availableFlash: number; /** Total amount of flash that can be used to store data */ totalUsableFlash: number; } /** * Pixel status message chunk. * @category Message */ export declare class StatusInfoChunk implements ChunkMessage { /** Size in bytes of the battery info data chunk. */ chunkSize: number; /** The battery charge level in percent. */ batteryLevelPercent: number; /** The charging state of the battery. */ batteryState: number; /** Current roll state. */ rollState: number; /** Face index, starts at 0. */ currentFaceIndex: number; } /** * Message send by a Pixel after receiving a "WhoAmI" message. * @category Message */ export declare class IAmADie implements PixelMessage { readonly type: number; readonly versionInfo: VersionInfoChunk; readonly dieInfo: DieInfoChunk; readonly customDesignAndColorName: CustomDesignAndColorNameChunk; readonly dieName: DieNameChunk; readonly settingsInfo: SettingsInfoChunk; readonly statusInfo: StatusInfoChunk; } /** * Message send by a Pixel running a legacy firmware, * after receiving a "WhoAmI" message. * @category Message */ export declare class LegacyIAmADie implements PixelMessage { /** Type of the message. */ readonly type: number; /** Number of LEDs. */ ledCount: number; /** Die color. */ colorway: number; /** Type of die. */ dieType: number; /** Hash of the uploaded profile. */ dataSetHash: number; /** The unique Pixel id. */ pixelId: number; /** Amount of available flash. */ availableFlashSize: number; /** UNIX timestamp in seconds for the date of the firmware. */ buildTimestamp: number; /** Current roll state. */ rollState: number; /** Index of the face that is currently facing up. */ currentFaceIndex: number; /** The battery charge level in percent. */ batteryLevelPercent: number; /** The charging state of the battery. */ batteryState: number; /** Byte size of the LegacyIAmADie message. */ static readonly expectedSize = 22; } /** * Message send by a Pixel to notify of its rolling state. * @category Message */ export declare class RollState implements PixelMessage { /** Type of the message. */ readonly type: number; /** Current roll state. */ state: number; /** Index of the face facing up (if applicable). */ faceIndex: number; } /** * Available Pixel battery controller modes. * @enum * @category Message */ export declare const PixelBatteryControllerModeValues: { /** Charging allowed. */ readonly default: number; /** Disable charging. */ readonly forceDisableCharging: number; /** Ignore battery temperature. */ readonly forceEnableCharging: number; }; /** * The names for the "enum" type {@link PixelBatteryControllerModeValues}. * @category Message */ export type PixelBatteryControllerMode = keyof typeof PixelBatteryControllerModeValues; /** * Message send by a Pixel to notify of its telemetry data. * @category Message */ export declare class Telemetry implements PixelMessage { /** Type of the message. */ readonly type: number; accXTimes1000: number; accYTimes1000: number; accZTimes1000: number; faceConfidenceTimes1000: number; /** Firmware time in ms for when the data was gathered. */ timeMs: number; /** Current roll state. */ rollState: number; /** Index of the face facing up (if applicable). */ faceIndex: number; /** The battery charge level in percent. */ batteryLevelPercent: number; /** The charging state of the battery. */ batteryState: number; /** The internal state of the battery controller itself. */ batteryControllerState: number; /** The measured battery voltage multiplied by 50. */ voltageTimes50: number; /** The measured coil voltage multiplied by 50. */ vCoilTimes50: number; /** The RSSI value, in dBm. */ rssi: number; /** The data channel index of which the RSSI is measured. */ channelIndex: number; /** * The microcontroller temperature, in celsius, times 100 (i.e. 500 == 5 degrees C). * If the die was unable to read the temperature, value will be 0xffff. */ mcuTemperatureTimes100: number; /** * The battery temperature, in celsius, times 100 (i.e. 500 == 5 degrees C). */ batteryTemperatureTimes100: number; /** Internal charge state */ internalChargeState: boolean; /** Internal disabling of charging (because of temperature for instance) */ batteryControllerMode: number; /** led power draw in mA */ ledCurrent: number; } /** * Message send to a Pixel to request a transfer of data. * This is usually done after initiating an animation transfer request * and followed by BulkData messages with the actual data. * @category Message */ export declare class BulkSetup implements PixelMessage { /** Type of the message. */ readonly type: number; size: number; } /** * Message send to a Pixel to request to transfer a piece of data. * A BulkSetup message must be send first. * @category Message */ export declare class BulkData implements PixelMessage { /** Type of the message. */ readonly type: number; size: number; offset: number; data?: ArrayBufferLike; } /** * Message send by a Pixel after receiving a BulkData request. * @category Message */ export declare class BulkDataAck implements PixelMessage { /** Type of the message. */ readonly type: number; offset: number; } /** * Message send to a Pixel to request a transfer of a * full animation data set (stored in flash memory). * @category Message */ export declare class TransferAnimationSet implements PixelMessage { /** Type of the message. */ readonly type: number; paletteSize: number; rgbKeyFrameCount: number; rgbTrackCount: number; keyFrameCount: number; trackCount: number; animationCount: number; animationSize: number; conditionCount: number; conditionSize: number; actionCount: number; actionSize: number; ruleCount: number; brightness: number; } /** * Message send by a Pixel after receiving a TransferAnimationSet request. * @category Message */ export declare class TransferAnimationSetAck implements PixelMessage { /** Type of the message. */ readonly type: number; result: number; } /** * Message send to a Pixel to request a transfer of a * test animation (stored in RAM memory). * @category Message */ export declare class TransferTestAnimationSet implements PixelMessage { /** Type of the message. */ readonly type: number; paletteSize: number; rgbKeyFrameCount: number; rgbTrackCount: number; keyFrameCount: number; trackCount: number; animationCount: number; animationSize: number; hash: number; } /** * Transfer animation ack values. * @enum * @category Message */ export declare const TransferInstantAnimationsSetAckTypeValues: { /** Die is ready to download animation set. */ readonly download: number; /** Die already has the contents of the animation set. */ readonly upToDate: number; /** Die doesn't have enough memory to store animation set. */ readonly noMemory: number; }; /** * The names for the "enum" type {@link TransferInstantAnimationsSetAckTypeValues}. * @category Message */ export type TransferInstantAnimationsSetAckType = keyof typeof TransferInstantAnimationsSetAckTypeValues; /** * Message send by a Pixel after receiving a TransferTestAnimationSet request. * @category Message */ export declare class TransferTestAnimationSetAck implements PixelMessage { /** Type of the message. */ readonly type: number; /** The expected action to be taken upon receiving this message. */ ackType: number; } /** * Message send by a Pixel to report a log message to the application. * @category Message */ export declare class DebugLog implements PixelMessage { /** Type of the message. */ readonly type: number; /** The message to log. */ message: string; } /** * Message send by a Pixel to request running a specific remote action. * @category Message */ export declare class RemoteAction implements PixelMessage { /** Type of the message. */ readonly type: number; /** Type of remote action. */ /** The action id to run. */ actionId: number; } /** * Message send to a Pixel to have it start or stop sending telemetry messages. * @category Message */ export declare class RequestTelemetry implements PixelMessage { /** Type of the message. */ readonly type: number; requestMode: number; minInterval: number; } /** * Message send to a Pixel to have it blink its LEDs. * @category Message */ export declare class Blink implements PixelMessage { /** Type of the message. */ readonly type: number; /** Number of flashes. */ count: number; /** Total duration in milliseconds. */ duration: number; /** Color to blink. */ color: number; /** Select which faces to light up. */ faceMask: number; /** Amount of in and out fading, 0: sharp transition, 255: max fading. */ fade: number; /** How many times to loop the animation. */ loopCount: number; } /** * Message send by a Pixel to notify of its battery level and state. * @category Message */ export declare class BatteryLevel implements PixelMessage { /** Type of the message. */ readonly type: number; /** The battery charge level in percent. */ levelPercent: number; /** The charging state of the battery. */ state: number; } /** * Message send to a Pixel to configure RSSI reporting. * @category Message */ export declare class RequestRssi implements PixelMessage { /** Type of the message. */ readonly type: number; /** Telemetry mode used for sending the RSSI update(s). */ requestMode: number; /** * Minimum interval in milliseconds between two updates. * (0 for no cap on rate) */ minInterval: number; } /** * Message send by a Pixel to notify of its measured RSSI. * @category Message */ export declare class Rssi implements PixelMessage { /** Type of the message. */ readonly type: number; /** The RSSI value, in dBm. */ value: number; } /** * Message send by a Pixel to request the application to show * a message to the user, and with optionally a required action. * @category Message */ export declare class NotifyUser implements PixelMessage { /** Type of the message. */ readonly type: number; /** Timeout after which the die won't listen for an answer. */ timeoutSec: number; /** Whether to display the OK button. */ ok: boolean; /** Whether to display the Cancel button. */ cancel: boolean; /** Message to show to the user. */ message: string; } /** * Message send to a Pixel in response to getting a NotifyUser request. * @category Message */ export declare class NotifyUserAck implements PixelMessage { /** Type of the message. */ readonly type: number; /** Whether the use selected OK or Cancel. */ okCancel: boolean; } /** * Message send to a Pixel to store a 32 bits value. * @category Message */ export declare class StoreValue implements PixelMessage { /** Type of the message. */ readonly type: number; /** Value to write. */ value: number; } /** * The different possible result of requesting to store a value. * @enum * @category Message */ export declare const StoreValueResultValues: { /** Value stored successfully. */ readonly success: number; /** Some error occurred. */ readonly unknownError: number; /** Store is full, value wasn't saved. */ readonly storeFull: number; /** * Store request was discarded because the value is outside of the * valid range (value can't be 0). */ readonly invalidRange: number; readonly notPermitted: number; }; /** * The names for the "enum" type {@link StoreValueResultValues}. * @category Message */ export type StoreValueResult = keyof typeof StoreValueResultValues; /** * Message send by a Pixel is response to receiving a * {@link StoreValue} message. * @category Message */ export declare class StoreValueAck implements PixelMessage { /** Type of the message. */ readonly type: number; /** Store operation result. */ result: number; /** Index at which the value was written. */ index: number; } /** * Message send to a Pixel to configure the die type and color. * @category Message */ export declare class SetDesignAndColor implements PixelMessage { /** Type of the message. */ readonly type: number; /** A value from the {@link PixelDieType} enumeration.*/ dieType: number; /** A value from the {@link PixelColorwayValues} enumeration.*/ colorway: number; } /** * Message send to a Pixel to change its Bluetooth name. * @category Message */ export declare class SetName implements PixelMessage { /** Type of the message. */ readonly type: number; /** The name to set. */ name: string; } /** * The different power operations available on a Pixel. * @enum * @category Message */ export declare const PixelPowerOperationValues: { readonly turnOff: number; readonly reset: number; readonly sleep: number; }; /** * Message send to a Pixel to modify it's power state. * @category Message */ export declare class PowerOperation implements PixelMessage { /** Type of the message. */ readonly type: number; /** The name to set. */ operation: number; } /** * Message send to a Pixel to request a transfer of a set of * instant animations (stored in RAM memory) * @category Message */ export declare class TransferInstantAnimationSet implements PixelMessage { /** Type of the message. */ readonly type: number; paletteSize: number; rgbKeyFrameCount: number; rgbTrackCount: number; keyFrameCount: number; trackCount: number; animationCount: number; animationSize: number; hash: number; } /** * Message send by a Pixel after receiving a TransferInstantAnimationSet request. * @category Message */ export declare class TransferInstantAnimationSetAck implements PixelMessage { /** Type of the message. */ readonly type: number; /** The expected action to be taken upon receiving this message. */ ackType: number; } /** * Message send to a Pixel to have it play an already uploaded instant animation. * @category Message */ export declare class PlayInstantAnimation implements PixelMessage { /** Type of the message. */ readonly type: number; /** Animation index to play. */ animation: number; /** Face index on which to play the animation. */ faceIndex: number; /** How many times to loop the animation. */ loopCount: number; } /** * Message send by a Pixel to notify of its internal temperature. * @category Message */ export declare class Temperature implements PixelMessage { /** Type of the message. */ readonly type: number; /** * The microcontroller temperature, in celsius, times 100 (i.e. 500 == 5 degrees C). * If the die was unable to read the temperature, value will be 0xffff. */ mcuTemperatureTimes100: number; /** * The battery temperature, in celsius, times 100 (i.e. 500 == 5 degrees C). */ batteryTemperatureTimes100: number; } /** * Message send to a Pixel to set its battery controller mode. * @category Message */ export declare class SetBatteryControllerMode implements PixelMessage { /** Type of the message. */ readonly type: number; /** * The battery controller mode to set. */ mode: number; } /** * Message send to a Pixel to make it light up its LEDs to quickly discharge the battery. * @category Message */ export declare class Discharge implements PixelMessage { /** Type of the message. */ readonly type: number; /** * The current draw, in mA, or 0 to reset. */ currentMA: number; } /** * Message send to a Pixel to make it blink it Pixel Id. * @category Message */ export declare class BlinkId implements PixelMessage { /** Type of the message. */ readonly type: number; /** * The brightness of the blinking LEDs. */ brightness: number; /** How many times to loop the animation. */ loopCount: number; } /** * Message send to a Pixel to test transfer rates. * @category Message */ export declare class TransferTest implements PixelMessage { /** Type of the message. */ readonly type: number; /** * The amount of data to be send. */ size: number; } /** * Message send to a Pixel to play an animation from the stored profile. * @category Message */ export declare class PlayProfileAnimation implements PixelMessage { /** Type of the message. */ readonly type: number; /** Index of the animation in the profile's animation list. */ animationIndex: number; /** Face on which to play the animation (the animations are designed assuming that the higher face value is up). */ remapToFace: number; /** How many times to loop the animation. */ loopCount: number; } export declare const serializer: MessageSerializer<"none" | "whoAreYou" | "bulkSetup" | "bulkSetupAck" | "bulkData" | "bulkDataAck" | "transferSettings" | "transferSettingsAck" | "transferSettingsFinished" | "debugLog" | "requestSettings" | "blink" | "blinkAck" | "requestBatteryLevel" | "batteryLevel" | "requestRssi" | "rssi" | "notifyUser" | "notifyUserAck" | "programDefaultParameters" | "programDefaultParametersFinished" | "setName" | "setNameAck" | "requestTemperature" | "temperature" | "testBulkSend" | "testBulkReceive" | "attractMode" | "printA2DReadings" | "printAnimationControllerState" | "iAmADie" | "rollState" | "telemetry" | "transferAnimationSet" | "transferAnimationSetAck" | "transferAnimationSetFinished" | "transferTestAnimationSet" | "transferTestAnimationSetAck" | "transferTestAnimationSetFinished" | "playAnimation" | "playAnimationEvent" | "stopAnimation" | "remoteAction" | "requestRollState" | "requestAnimationSet" | "requestTelemetry" | "programDefaultAnimationSet" | "programDefaultAnimationSetFinished" | "requestDefaultAnimationSetColor" | "defaultAnimationSetColor" | "calibrate" | "calibrateFace" | "testHardware" | "storeValue" | "storeValueAck" | "setTopLevelState" | "setDesignAndColor" | "setDesignAndColorAck" | "setCurrentBehavior" | "setCurrentBehaviorAck" | "powerOperation" | "exitValidation" | "transferInstantAnimationSet" | "transferInstantAnimationSetAck" | "transferInstantAnimationSetFinished" | "playInstantAnimation" | "stopAllAnimations" | "setBatteryControllerMode" | "_unused" | "discharge" | "blinkId" | "blinkIdAck" | "transferTest" | "transferTestAck" | "transferTestFinished" | "clearSettings" | "clearSettingsAck" | "setAllLEDsToColor" | "printNormals" | "lightUpFace" | "setLEDToColor">; //# sourceMappingURL=DieMessages.d.ts.map