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 ChargerMessageTypeValues: { readonly none: number; readonly whoAreYou: number; readonly iAmALCC: number; readonly bulkSetup: number; readonly bulkSetupAck: number; readonly bulkData: number; readonly bulkDataAck: number; readonly transferSettings: number; readonly transferSettingsAck: number; readonly transferSettingsFinished: number; readonly debugLog: number; readonly requestSettings: number; readonly blink: number; readonly blinkAck: number; readonly requestBatteryLevel: number; readonly batteryLevel: number; readonly requestRssi: number; readonly rssi: number; readonly notifyUser: number; readonly notifyUserAck: number; readonly programDefaultParameters: number; readonly programDefaultParametersFinished: number; readonly setName: number; readonly setNameAck: number; readonly requestTemperature: number; readonly temperature: number; readonly testBulkSend: number; readonly testBulkReceive: number; readonly attractMode: number; readonly printA2DReadings: number; readonly printAnimationControllerState: number; }; /** * The names for the "enum" type {@link ChargerMessageTypeValues}. * @category Message */ export type ChargerMessageType = keyof typeof ChargerMessageTypeValues; /** * Union type of {@link PixelMessage} and {@link ChargerMessageType} types. * Messages without parameter have no {@link PixelMessage} class to represent them, * instead they are represent by the corresponding {@link ChargerMessageTypeValues}. * @category Message */ export type ChargerMessageOrType = PixelMessage | ChargerMessageType; /** * Charger 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; } /** * Charger general info message chunk. * @category Message */ export declare class ChargerInfoChunk implements ChunkMessage { /** Size in bytes of the charger info data chunk. */ chunkSize: number; /** The charger unique Pixel id. */ pixelId: number; chipModel: number; /** Number of LEDs. */ ledCount: number; } /** * Charger name message chunk. * @category Message */ export declare class ChargerNameChunk implements ChunkMessage { chunkSize: number; name: string; } /** * Charger settings message chunk. * @category Message */ export declare class SettingsInfoChunk implements ChunkMessage { /** Size in bytes of the settings info data chunk. */ chunkSize: number; /** Amount of available flash to store data. */ availableFlash: number; /** Total amount of flash that can be used to store data */ totalUsableFlash: number; } /** * Charger 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; } /** * Message send by a Charger after receiving a "WhoAmI" message. * @category Message */ export declare class IAmALCC implements PixelMessage { readonly type: number; readonly versionInfo: VersionInfoChunk; readonly chargerInfo: ChargerInfoChunk; readonly dieName: ChargerNameChunk; readonly settingsInfo: SettingsInfoChunk; readonly statusInfo: StatusInfoChunk; } export declare class LegacyIAmALCC implements PixelMessage { /** Type of the message. */ readonly type: number; /** Number of LEDs. */ ledCount: number; /** Hash of the uploaded profile. */ dataSetHash: number; /** The charger unique Pixel id. */ pixelId: number; /** Amount of available flash. */ availableFlashSize: number; /** UNIX timestamp in seconds for the date of the firmware. */ buildTimestamp: number; /** The battery charge level in percent. */ batteryLevelPercent: number; /** The charging state of the battery. */ batteryState: number; /** Byte size of the LegacyIAmALCC message. */ static readonly expectedSize = 20; } /** * Message send to a Charger 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 Charger 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 Charger after receiving a BulkData request. * @category Message */ export declare class BulkDataAck implements PixelMessage { /** Type of the message. */ readonly type: number; offset: number; } /** * Message send by a Charger 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 to a Charger 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 Charger 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 Charger 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 Charger 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 Charger 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 charger 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 Charger 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 Charger 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; } /** * Message send by a Charger 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 charger 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; } export declare const serializer: MessageSerializer<"none" | "whoAreYou" | "iAmALCC" | "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">; //# sourceMappingURL=ChargerMessages.d.ts.map