### Save Layout Command Example Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Demonstrates the hexadecimal structure of the `layoutSave` command, highlighting specific parameter sections. ```hex 0xFF6000160A00000000012FFF0F00010100EE1E0401AA ``` -------------------------------- ### List Configurations Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Lists all available configurations on the device, including their size, usage, and install counters. This helps in managing memory and selecting configurations. ```text cfgList ``` -------------------------------- ### 1-bit per Pixel Image Save Command Examples Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md These are examples of hexadecimal commands used to save a 1-bit per pixel image. They include commands for writing configuration, saving the image metadata, and the image data itself. ```hex 0xFFD0001244656D6F00000000000001E240AA ``` ```hex 0xFF41000D0A00000014000F01AA ``` ```hex 0xFF410019C001300608080410022001400140814062211C1EAA ``` -------------------------------- ### Display Layout with Speed Argument Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This example demonstrates displaying a layout with a specific argument, such as speed. The argument '12.5 km/h' is provided if the layout is saved in the device with this configuration. ```Assembly 0xFF62000B0D31322E35AA ``` -------------------------------- ### Save Font Command Syntax Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This example shows the syntax for the `fontSave` command, demonstrating how to save font 10 with a specific size and character definitions for numbers 0-9. The data is presented in multiple chunks. ```text 1st chunk: 0xFF 0x51 0x00 0x08 0x0A 0x01 0x15 0xAA 2nd chunk: 0xFF 0x51 0x00 0x2B 0x02 0x16 0x00 0x30 0x00 0x39 0x00 0x00 0x00 0x1F 0x00 0x35 0x00 0x4C 0x00 0x64 0x00 0x7D 0x00 0x94 0x00 0xAF 0x00 0xC4 0x00 0xE0 0x1F 0x0D 0x00 0x0A 0x25 0x77 0x59 0x34 0x33 0x34 0x34 0x24 0xAA 3rd chunk: 0xFF 0x51 0x00 0x2B 0x34 0x24 0x34 0x24 0x34 0x24 0x34 0x24 0x34 0x24 0x34 0x24 0x34 0x24 0x33 0x49 0x57 0x75 0x40 0x16 0x0D 0x00 0x0A 0x52 0x85 0x67 0x67 0x61 0x24 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0xAA 4th chunk: 0xFF 0x51 0x00 0x2B 0x94 0x94 0x40 0x17 0x0D 0x00 0x0A 0x25 0x68 0x4A 0x34 0x24 0x33 0x43 0xA3 0x94 0x94 0x84 0x84 0x84 0x84 0x84 0x8B 0x2B 0x2B 0x10 0x18 0x0D 0x00 0x0A 0x16 0x69 0x3A 0x34 0x34 0x94 0x84 0x66 0xAA 5th chunk: 0xFF 0x51 0x00 0x2B 0x76 0x77 0xA4 0x94 0x23 0x44 0x24 0x34 0x2A 0x48 0x75 0x40 0x19 0x0D 0x00 0x0A 0x54 0x85 0x76 0x76 0x67 0x67 0x53 0x14 0x43 0x24 0x43 0x24 0x33 0x34 0x3B 0x2B 0x2B 0x84 0x94 0x94 0x20 0x17 0xAA 6th chunk: 0xFF 0x51 0x00 0x2B 0x0D 0x00 0x0A 0x09 0x49 0x49 0x43 0xA3 0x98 0x5A 0x3A 0xA4 0x94 0x94 0x23 0x44 0x24 0x33 0x49 0x48 0x75 0x40 0x1B 0x0D 0x00 0x0A 0x44 0x76 0x67 0x55 0x83 0x94 0x14 0x4A 0x3A 0x34 0x34 0x24 0xAA 7th chunk: 0xFF 0x51 0x00 0x2B 0x34 0x24 0x34 0x24 0x34 0x24 0x34 0x39 0x57 0x75 0x40 0x15 0x0D 0x00 0x09 0x7B 0x2B 0x2B 0x93 0x94 0x93 0x94 0x94 0x84 0x94 0x93 0x94 0x93 0x94 0x94 0x84 0x70 0x1C 0x0D 0x00 0x0A 0x25 0x68 0xAA 8th chunk: 0xFF 0x51 0x00 0x2B 0x59 0x34 0x33 0x34 0x33 0x43 0x24 0x48 0x67 0x59 0x34 0x33 0x34 0x34 0x24 0x34 0x24 0x34 0x2A 0x49 0x65 0x40 0x1B 0x0D 0x00 0x0A 0x24 0x87 0x59 0x34 0x33 0x34 0x34 0x24 0x34 0x24 0x34 0x24 0xAA 9th chunk: 0xFF 0x51 0x00 0x06 0x34 0x2B 0x3A 0x44 0x13 0x94 0x84 0x67 0x66 0x74 0x60 0xAA ``` -------------------------------- ### Stream Image Data (1bpp) Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Example of streaming image data using the imgStream command for 1bpp images. Includes header and image data. ```python ## 20 bytes, 15 pixels width, x = 50, y = 80 0xFF44001000000014000F0032005001AA ## image data, 10 lines of 2 bytes 0xFF440019C001300608080410022001400140814062211C1EAA ``` -------------------------------- ### Display Layout with Time Argument Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md To display a layout, send the layout command followed by the layout number and the layout argument. This example shows how to display layout 10, which is used for time by default. ```Assembly 0xFF62000B0A31353A3338AA ``` -------------------------------- ### Display Image at Negative Coordinates Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Example command to display image #10 at negative coordinates (-64, -64). ```text 0xFF42000A0AFFC0FFC0AA ``` -------------------------------- ### Python: Save Image Data with ActiveLook API Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Example Python code demonstrating the sequence of commands to save an image using the ActiveLook API, including configuration, image header, and image data transmission. ```python ## write config "Demo" 0xFFD0001244656D6F00000000000001E240AA ## save image #10, 80 bytes, 15 pixel width 0xFF41000D0A00000096000F08AA ## image data, 10 lines of 15 bytes 0xFF41009B000000FF0F0000000000FF00F00F000000F0000000F00000000F000000000F00F00000000000F0000F0000000000000F0F0000000000000F0F0000F00000000FF000F00F0F00AA ``` -------------------------------- ### Heatshrink Image Compression in Python Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This Python snippet demonstrates how to convert an image to 4 bits per pixel and then apply Heatshrink compression. Ensure the 'heatshrink2' library is installed. ```python import heatshrink2 as hs ## convert image into 4bpp img4bpp = img_4bpp_conversion(img_path) ## Heatshrink compression imgHeatShrink = hs.compress(img4bpp, window_sz2 = 8, lookahead_sz2 = 4) ``` -------------------------------- ### Page Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands for managing pages in the ActiveLook system. These include saving, getting, deleting, displaying, clearing, and listing pages. ```APIDOC ## Page Commands (Master to ActiveLook) ### pageSave Saves a page of layouts. - **Parameters**: - `id` (u8) - Page ID. - `layoutId1` (u8) - Layout ID for the first layout. - `x1` (u16) - X-coordinate for the first layout. - `y1` (u8) - Y-coordinate for the first layout. - ... - `layoutIdN` (u8) - Layout ID for the Nth layout. - `xN` (u16) - X-coordinate for the Nth layout. - `yN` (u8) - Y-coordinate for the Nth layout. ### pageGet Retrieves a page. - **Parameters**: - `id` (u8) - Page ID to retrieve. ### pageDelete Deletes a page. - **Parameters**: - `id` (u8) - Page ID to delete. If `id` is 0xFF, all pages are deleted. ### pageDisplay Displays a page with specified strings. - **Parameters**: - `id` (u8) - Page ID to display. - `string1` (str) - First string to display (NUL separated). - ... - `stringN` (str) - Nth string to display (NUL separated). ### pageClear Clears the screen of a corresponding page area. - **Parameters**: - `id` (u8) - Page ID to clear. ### pageList Lists all pages currently in memory. - **Parameters**: - None. ### pageClearAndDisplay Clears a page area and then displays a page with specified strings. - **Parameters**: - `id` (u8) - Page ID to clear and display. - `string1` (str) - First string to display (NUL separated). - ... - `stringN` (str) - Nth string to display (NUL separated). ## Page Commands (ActiveLook to Master) ### pageGet Response Returns page with layouts parameters. - **Data**: - `id` (u8) - Page ID. - `layoutId1` (u8) - Layout ID for the first layout. - `x1` (u16) - X-coordinate for the first layout. - `y1` (u8) - Y-coordinate for the first layout. - ... - `layoutIdN` (u8) - Layout ID for the Nth layout. - `xN` (u16) - X-coordinate for the Nth layout. - `yN` (u8) - Y-coordinate for the Nth layout. ### pageList Response Returns a list of page IDs in memory. - **Data**: - `id` (u8) - ID of a page in memory. - ... - `idN` (u8) - ID of the Nth page in memory. (Listing is not sorted) ``` -------------------------------- ### Heatshrink Image Save Command Examples Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md These hexadecimal commands are used to save an image with Heatshrink compression. They include writing configuration, saving image metadata with format 0x02 (decompress before saving), and the compressed image data. ```hex 0xFFD0001244656D6F00000000000001E240AA ``` ```hex 0xFF41000D0A00000050000F02AA ``` ```hex 0xFF4100280017FE1E065807C0107F001B05100820A308188D40C207A12A01046A22542297C00640AA ``` -------------------------------- ### Clear Layout Area Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md The 'clearlayout' command can be used to clear the screen of a specific layout area. This example shows the command structure for clearing layout area 0x0D. ```Assembly 0xFF 0x63 0x00 0x06 0x0D 0xAA ``` -------------------------------- ### Select Configuration Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Selects a configuration to be active. This must be done before using layouts, images, or other elements associated with that configuration. ```text cfgSelect ``` -------------------------------- ### Write Configuration Command Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This command is used to write a configuration setting, such as a name, before performing other operations like saving animations. It's a prerequisite for certain commands. ```Assembly ## write config "Demo" 0xFFD0001244656D6F000000000000000000AA ``` -------------------------------- ### Write Configuration Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Writes a configuration to the device. This command requires at least 5% battery to succeed and should be preceded by checking free space. ```text cfgWrite ``` -------------------------------- ### cfgList Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Lists all configurations currently stored in the ActiveLook device's memory. ```APIDOC ## cfgList ### Description List configurations in memory. ### Master to ActiveLook #### Command ID `0xD3` #### Parameters None ### ActiveLook to Master #### Command ID `0xD3` #### Data - **name** (str[12]) - Name of the configuration. - **size** (u32) - Size of the configuration in bytes. - **version** (u32) - Provided by user, version of configuration. - **usgCnt** (u8) - Use to sort configuration, most recent used configuration have higher value. - **installCnt** (u8) - Use to sort configuration, most recent installed configuration have higher value. - **isSystem** (bool) - Indicate system configuration. System configuration can't be deleted. (This data structure repeats for each configuration N) ``` -------------------------------- ### cfgSet Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Selects the current configuration to be used for displaying layouts, images, etc. ```APIDOC ## cfgSet ### Description Select the current configuration used to display layouts, images, etc. ### Method Master to ActiveLook ### Command ID `0xD2` ### Parameters - **name** (str[12]) - Required - Name of the configuration (maximum 12 bytes, NUL terminated if shorter). ``` -------------------------------- ### cfgWrite Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Writes a configuration to the ActiveLook device. Configurations are associated with layouts, images, etc. This command is only allowed if the battery is above 5%. ```APIDOC ## cfgWrite ### Description Write configuration, configurations are associated with layouts, images, etc. ### Method Master to ActiveLook ### Command ID `0xD0` ### Parameters - **name** (str[12]) - Required - Name of the configuration (maximum 12 bytes, NUL terminated if shorter). - **version** (u32) - Required - Provided by the user for tracking versions of configuration. - **password** (u32) - Required - If configuration already exists, the same password must be provided as the one used during the creation. ### Warning This command is allowed only if the battery is above 5%. ``` -------------------------------- ### Check Free Space for Configurations Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Checks the available free space in the configuration memory pool. It is recommended to have at least 10% free space before writing or modifying elements. ```text cfgFreeSpace ``` -------------------------------- ### Display Layout Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Displays a previously saved layout. This command can include gauges and text elements. ```text 0xFF62000914383500AA ``` -------------------------------- ### Master to ActiveLook Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands initiated from the Master device to control the ActiveLook device. ```APIDOC ## Master to ActiveLook Commands ### Description Commands sent from the Master to the ActiveLook device to perform actions like shutting down, resetting, or reading device information. ### Commands #### shutdown (0xE0) - **Parameters**: `u8 key[4]` (4 bytes) - Must be `0x6F 0x7F 0xC4 0xEE`. - **Description**: Shuts down the device. Not allowed while USB powered. #### reset (0xE1) - **Parameters**: `u8 key[4]` (4 bytes) - Must be `0x5C 0x1E 0x2D 0xE9`. - **Description**: Resets the device. Allowed only while USB powered. #### rdDevInfo (0xE3) - **Parameters**: `u8 id` (1 byte) - Specifies the device information parameter to read. - **Description**: Reads a device information parameter. Supported `id` values range from 0 to 16, covering hardware platform, manufacturer, firmware version, serial number, and certification details. ``` -------------------------------- ### Python: Compress Image to 4bpp Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This Python code snippet demonstrates how to compress an 8-bit grayscale image into a 4-bit per pixel format for transmission. It iterates through pixels, converts their values, and packs them into bytes. ```python ## compress img into 4bpp frame = [] for i in range(height): byte = 0 shift = 0 for j in range(width): ## convert 8bpp to 4bpp pxl = gray[i,j] // 16 ## compress 4bpp byte += pxl << shift shift += 4 if shift == 8: frame.append(byte) byte = 0 shift = 0 if shift != 0: frame.append(byte) ``` -------------------------------- ### Display Text 'hello 0' Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Displays the text 'hello 0' at coordinates (152, 128) using font 2 and color 15. The text direction is set to 0. ```binary 0xFF3700140098008000020F68656C6C6F203000AA ``` -------------------------------- ### Python: Compress Image to 8bpp Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This Python code snippet demonstrates how to compress an image into an 8bpp format by combining 4-bit color and 4-bit alpha channel information for each pixel. ```python ## compress img into 8bpp frame = [] for i in range(height): for j in range(width): ## convert 8 bits grayscale to 4 bits and shift left byte = (gray[i,j] // 16) << 4 ## convert 8 bits alpha to bits byte += alpha[i,j] // 16 frame.append(byte) ``` -------------------------------- ### Save Gauge Configuration Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Saves the configuration for a gauge. The `cfgWrite` command is required before uploading gauges. ```text 0xFF710011010097007F006E004B030E01AA ``` -------------------------------- ### Display Text 'hello 4' Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Displays the text 'hello 4' at coordinates (152, 128) using font 2 and color 15. The text direction is set to 4. ```binary 0xFF3700140098008004020F68656C6C6F203400AA ``` -------------------------------- ### Python: Save 4bpp Image Data Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This Python code illustrates the sequence of commands and data required to save a 4bpp image using the ActiveLook API. It includes commands for configuration, image header, and the compressed image data itself. ```python ## write config "Demo" 0xFFD0001244656D6F00000000000001E240AA ## save image #10, 80 bytes, 15 pixel width 0xFF41000D0A00000014000F01AA ## image data, 10 lines of 8 bytes 0xFF410055000000FF0F0000000000FF00F00F000000F0000000F00000000F000000000F00F000000000000F0000F0000000000000F0F0000000000000F0F0000F00000000FF000F00F0F00F00000FF0F00F0FF0F00AA ``` -------------------------------- ### Save Animation Command Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This command is used to initiate the saving of an animation. It includes the animation identifier, size, reference frame details, and compression format. The `cfgWrite` command is required beforehand. ```Assembly ## save animation #10 0xFF9500150A000003C2000001F0001F0200000079AA ``` -------------------------------- ### Layout Commands (ActiveLook to Master) Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands sent from the ActiveLook device to the Master, typically for listing or retrieving layout information. ```APIDOC ## layoutList ### Description Provides a list of layouts currently stored in memory. The list is not sorted. ### Method ActiveLook to Master ### Data - **id** (u8) - ... - **idN** (u8) - A sequence of layout IDs. ### Data length (B) n (where n is the number of layouts) ``` ```APIDOC ## layoutGet ### Description Retrieves the parameters for a layout. The ID is not included in the returned data. ### Method ActiveLook to Master ### Data - **layout parameters** (>= 16) - The parameters defining the layout. ### Data length (B) >= 16 ``` -------------------------------- ### Generic Access Service Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Provides access to generic device information and configuration. ```APIDOC ## Generic Access Service ### Description Provides access to generic device information and configuration. ### UUID `0x1800` ### Characteristics #### Device Name * **UUID**: `00002A00-0000-1000-8000-00805F9B34FB` * **Property**: Read * **Value**: `A.LooK` #### Appearance * **UUID**: `00002A01-0000-1000-8000-00805F9B34FB` * **Property**: Read * **Value**: `Generic Eye-glasses` #### Peripheral Preferred Connection Parameters * **UUID**: `00002A04-0000-1000-8000-00805F9B34FB` * **Property**: Read * **Value**: Connection Interval: `15ms - 30ms`, Slave Latency: `0`, Supervision Timeout: `4s` ``` -------------------------------- ### cfgRead Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Reads configuration information from the ActiveLook device. This command retrieves the number of elements stored in a specified configuration. ```APIDOC ## cfgRead ### Description Get the number of elements stored in the configuration. ### Master to ActiveLook #### Command ID `0xD1` #### Parameters - **name** (str[12]) - Required - Name of the configuration (maximum 12 bytes, NUL terminated if shorter). ### ActiveLook to Master #### Command ID `0xD1` #### Data - **version** (u32) - Version of the configuration. - **nbImg** (u8) - Number of images in the configuration. - **nbLayout** (u8) - Number of layouts in the configuration. - **nbFont** (u8) - Number of fonts in the configuration. - **nbPage** (u8) - Number of pages in the configuration. - **nbGauge** (u8) - Number of gauges in the configuration. ``` -------------------------------- ### Layout Commands (Master to ActiveLook) Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands sent from the Master to the ActiveLook device to manage screen layouts. These include saving, deleting, displaying, clearing, listing, and repositioning layouts. ```APIDOC ## layoutSave ### Description Saves a layout with specified parameters. ### Method Master to ActiveLook ### Parameters - **layout parameters** (various) - Description of layout parameters not detailed here. ### Data length (B) >= 17 ``` ```APIDOC ## layoutDelete ### Description Deletes a layout identified by its ID. If the ID is 0xFF, all layouts are deleted. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout to delete. Use 0xFF to delete all layouts. ### Data length (B) 1 ``` ```APIDOC ## layoutDisplay ### Description Displays text using the parameters of a specified layout. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout to use. - **text** (str[255]) - The text to display. ### Data length (B) 2 ``` ```APIDOC ## layoutClear ### Description Clears the screen area corresponding to the specified layout. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout area to clear. ### Data length (B) 1 ``` ```APIDOC ## layoutList ### Description Requests the list of all saved layouts. ### Method Master to ActiveLook ### Parameters None ### Data length (B) 0 ``` ```APIDOC ## layoutPosition ### Description Redefines the position of a layout. This change is saved. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout. - **x** (u16) - The new X coordinate. - **y** (u8) - The new Y coordinate. ### Data length (B) 4 ``` ```APIDOC ## layoutDisplayExtended ### Description Displays text with a specified layout at a given position. The position is not saved. Allows for additional commands. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout. - **x** (u16) - The X coordinate for display. - **y** (u8) - The Y coordinate for display. - **text** (str[255]) - The text to display. - **extraCmd** (u8[n]) - Additional commands. ### Data length (B) 5 ``` ```APIDOC ## layoutGet ### Description Retrieves the parameters for a specified layout. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout to retrieve. ### Data length (B) 1 ``` ```APIDOC ## layoutClearExtended ### Description Clears the screen area of a corresponding layout at a specified position. The position is not saved. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout area. - **x** (u16) - The X coordinate. - **y** (u8) - The Y coordinate. ### Data length (B) 4 ``` ```APIDOC ## layoutClearAndDisplay ### Description Clears the specified layout area and then displays the provided text. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout. - **text** (str[255]) - The text to display. ### Data length (B) 2 ``` ```APIDOC ## layoutClearAndDisplayExtended ### Description Clears the specified layout area and displays text at a given position. The position is not saved. Allows for additional commands. ### Method Master to ActiveLook ### Parameters - **id** (u8) - The ID of the layout. - **x** (u16) - The X coordinate for display. - **y** (u8) - The Y coordinate for display. - **text** (str[255]) - The text to display. - **extraCmd** (u8[n]) - Additional commands. ### Data length (B) 5 ``` -------------------------------- ### cfgGetNb Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Retrieves the number of configurations currently stored in the ActiveLook device's memory. ```APIDOC ## cfgGetNb ### Description Get number of configurations in memory. ### Master to ActiveLook #### Command ID `0xD8` #### Parameters None ### ActiveLook to Master #### Command ID `0xD8` #### Data - **nbConfig** (u8) - Number of configurations stored in memory. ``` -------------------------------- ### Save Layout with Gauge Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Saves a layout that includes a gauge as an additional command. This allows displaying the gauge's value within the layout. ```text 0xFF60001F1409000000012FE60F00020100AF8704010A0109006C00870125AA ``` -------------------------------- ### Image Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands for managing images on the ActiveLook device. These include saving, displaying, streaming, deleting, and listing images. ```APIDOC ## imgSave ### Description Saves an image to the ActiveLook device's memory. The image can be saved in various formats, including raw 4bpp, transformed 1bpp, or 4bpp with Heatshrink compression. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the image to save. - **size** (u32) - Required - The size of the image data in bytes. - **width** (u16) - Required - The width of the image in pixels. - **format** (u8) - Required - The format of the image. Supported values: - 0x00: 4bpp - 0x01: 1bpp, transformed into 4bpp by the firmware before saving - 0x02: 4bpp with Heatshrink compression, decompressed into 4bpp by the firmware before saving - 0x03: 4bpp with Heatshrink compression, stored compressed, decompressed into 4bpp before display - 0x08: 8bpp with 4 bits for grey level and 4 bits for alpha channel ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## imgDisplay ### Description Displays a saved image on the ActiveLook device at the specified coordinates. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the image to display. - **x** (s16) - Required - The x-coordinate for the top-left corner of the image. Can be negative. - **y** (s16) - Required - The y-coordinate for the top-left corner of the image. Can be negative. ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## imgStream ### Description Streams an image directly to the display without saving it in memory. Supports 1bpp and compressed 4bpp formats. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **size** (u32) - Required - The size of the image data in bytes. - **width** (u16) - Required - The width of the image in pixels. - **x** (s16) - Required - The x-coordinate for the top-left corner of the image. Can be negative. - **y** (s16) - Required - The y-coordinate for the top-left corner of the image. Can be negative. - **format** (u8) - Required - The format of the image. Supported values: - 0x01: 1bpp - 0x02: 4bpp with Heatshrink compression ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## imgDelete ### Description Deletes a specified image from the ActiveLook device's memory. If the ID is 0xFF, all images are deleted. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the image to delete. Use 0xFF to delete all images. ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## imgList ### Description Requests a list of all saved images in the ActiveLook device's memory. The response includes the ID, height, and width of each image. ### Method Master to ActiveLook ### Parameters #### Path Parameters - None ### Response #### Success Response (200) - **images** (array) - A list of saved images, where each element contains: - **id** (u8) - The ID of the image. - **height** (u16) - The height of the image in pixels. - **width** (u16) - The width of the image in pixels. #### Response Example ```json { "images": [ { "id": 1, "height": 10, "width": 20 }, { "id": 2, "height": 15, "width": 25 } ] } ``` ``` -------------------------------- ### cfgFreeSpace Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Retrieves the total and free space available for storing layouts, images, etc. ```APIDOC ## cfgFreeSpace ### Description Get free space available to store layouts, images, etc. ### Master to ActiveLook #### Command ID `0xD7` #### Parameters None ### ActiveLook to Master #### Command ID `0xD7` #### Data - **totalSize** (u32) - Total size available in bytes. - **freeSpace** (u32) - Free space available in bytes. ``` -------------------------------- ### cfgRename Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Renames an existing configuration on the ActiveLook device. ```APIDOC ## cfgRename ### Description Rename a configuration. ### Method Master to ActiveLook ### Command ID `0xD4` ### Parameters - **old** (str[12]) - Required - The current name of the configuration (maximum 12 bytes, NUL terminated if shorter). - **new** (str[12]) - Required - The new name for the configuration (maximum 12 bytes, NUL terminated if shorter). - **password** (u32) - Required - The password associated with the configuration. ``` -------------------------------- ### ActiveLook to Master Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands and asynchronous messages sent from the ActiveLook device back to the Master. ```APIDOC ## ActiveLook to Master Commands ### Description Messages sent from the ActiveLook device to the Master, typically indicating errors or providing requested device information. ### Commands #### error (0xE2) - **Data**: `u8 cmdId` (command ID), `u8 error` (error code), `u8 subError` (sub-error code) - Total 3 bytes. - **Description**: Asynchronously sent when an error occurs during command processing. `cmdId` identifies the command that failed. `error` codes include generic errors, missing configuration, memory issues, and protocol decoding errors. `subError` provides further detail. #### rdDevInfo (0xE3) - **Data**: `u8 parameter[n]` (variable length) - The value of the requested device parameter. - **Description**: Sent in response to a `rdDevInfo` command from the Master, providing the requested device parameter value. The size `n` depends on the parameter and its value. ``` -------------------------------- ### Save Image Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Saves an image to the device. This command requires a preceding `cfgWrite` command and involves sending image data in chunks. ```text imgSave ``` -------------------------------- ### ActiveLook Commands Interface Service Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Custom service for sending ActiveLook commands and receiving data. ```APIDOC ## Custom Service (ActiveLook® Commands Interface) ### Description Custom service for sending ActiveLook commands and receiving data. ### UUID `0783B03E-8535-B5A0-7140-A304D2495CB7` ### Characteristics #### TX ActiveLook * **UUID**: `0783B03E-8535-B5A0-7140-A304D2495CB8` * **Property**: Notify * **Descriptors**: UUID `0x2902` configuration, UUID `0x2901` description: `Server Tx Data` #### RX ActiveLook * **UUID**: `0783B03E-8535-B5A0-7140-A304D2495CBA` * **Property**: Write, Write no response * **Descriptors**: UUID `0x2902` configuration, UUID `0x2901` description: `Server Rx Data` #### Control * **UUID**: `0783B03E-8535-B5A0-7140-A304D2495CB9` * **Property**: Notify * **Descriptors**: UUID `0x2902` configuration, UUID `0x2901` description: `Control` #### Gesture Event * **UUID**: `0783B03E-8535-B5A0-7140-A304D2495CBB` * **Property**: Notify * **Descriptors**: UUID `0x2902` configuration, UUID `0x2901` description: `Gesture Event` #### Touch Event * **UUID**: `0783B03E-8535-B5A0-7140-A304D2495CBC` * **Property**: Notify * **Descriptors**: UUID `0x2902` configuration, UUID `0x2901` description: `Touch Event` ``` -------------------------------- ### Animation Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands for managing animations in the ActiveLook system. These include saving, deleting, displaying, clearing, and listing animations. ```APIDOC ## Animation Commands (Master to ActiveLook) ### animSave Saves an animation. - **Parameters**: - `id` (u8) - Animation ID. - `totalSize` (u32) - Total size of the animation in bytes. - `imgSize` (u32) - Reference frame size in bytes. - `width` (u16) - Reference image width in pixels. - `fmt` (u8) - Format of the reference frame (0x00: 4bpp, 0x02: 4bpp with Heatshrink compression). - `imgCompressedSize` (u32) - Reference frame size before decompression. ### animDelete Deletes an animation. - **Parameters**: - `id` (u8) - Animation ID to delete. If `id` is 0xFF, all animations are deleted. ### animDisplay Displays an animation at specified coordinates. - **Parameters**: - `handlerId` (u8) - User-defined handler ID to stop the animation. - `id` (u8) - Animation ID to display. - `delay` (u16) - Inter-frame delay in milliseconds. - `repeat` (u8) - Repeat count (0xFF for infinite). - `x` (s16) - X-coordinate (can be negative). - `y` (s16) - Y-coordinate (can be negative). ### animClear Stops and clears the screen of a corresponding animation. - **Parameters**: - `handlerId` (u8) - Handler ID of the animation to clear. If `handlerId` is 0xFF, all animations are cleared. ### animList Lists all saved animations. - **Parameters**: - None. ## Animation Commands (ActiveLook to Master) ### animList Response Returns a list of animation IDs in memory. - **Data**: - `id` (u8) - ID of an animation in memory. - ... - `idN` (u8) - ID of the Nth animation in memory. (Listing is not sorted) ``` -------------------------------- ### cfgDelete Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Deletes a configuration and all associated elements from the ActiveLook device. ```APIDOC ## cfgDelete ### Description Delete a configuration and all elements associated. ### Method Master to ActiveLook ### Command ID `0xD5` ### Parameters - **name** (str[12]) - Required - Name of the configuration to delete (maximum 12 bytes, NUL terminated if shorter). ``` -------------------------------- ### Delete a Specific Configuration Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Deletes a specific configuration from the device. Use with caution as it reduces available memory. ```text cfgDelete ``` -------------------------------- ### Reposition Layout Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Use the `layoutPosition` command to redefine the position of a layout. The command takes the layout number and the new X and Y coordinates. Remember that layout orientation is considered, and positions are referenced to the display's (0;0). ```Assembly 0xFF6500090A001E19AA Reposition layout #10 : 0xFF6500090A001E19AA At X = 200 and Y = 200 : 0xFF6500090A00C8C8AA ``` -------------------------------- ### Delete Least Used Configuration Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Deletes the configuration that has not been used for the longest time. This is useful for freeing up memory when space is limited. ```text cfgDeleteLessUsed ``` -------------------------------- ### Compress Image to 1-bit per Pixel Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md This Python code iterates through a grayscale image, converting each pixel to 1-bit and compressing it into bytes. Lines are packed into bytes, and bytes are appended to the frame. ```python frame = [] for i in range(height): byte = 0 shift = 0 line = [] for j in range(width): ## convert gray8bit in gray1bit if (gray[i,j] > 0): pxl = 1 else: pxl = 0 ## compress 1bpp byte += pxl << shift shift += 1 if shift == 8: line.append(byte) byte = 0 shift = 0 if shift != 0: line.append(byte) rame.append(line) ``` -------------------------------- ### Font Commands Source: https://github.com/activelook/activelook-api-documentation/blob/main/ActiveLook_API.md Commands for managing fonts on the ActiveLook device. These include listing, saving, selecting, and deleting fonts. ```APIDOC ## fontList ### Description Requests a list of all saved fonts on the ActiveLook device, including their IDs and heights. ### Method Master to ActiveLook ### Parameters #### Path Parameters - None ### Response #### Success Response (200) - **fonts** (array) - A list of saved fonts, where each element contains: - **id** (u8) - The ID of the font. - **height** (u8) - The height of the font in pixels. #### Response Example ```json { "fonts": [ { "id": 1, "height": 8 }, { "id": 2, "height": 10 } ] } ``` ## fontSave ### Description Saves a font to the ActiveLook device's memory. The font data is sent in chunks. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the font to save. - **size** (u16) - Required - The size of the font data in bytes. - **data** (u8[]) - Required - The font data. ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## fontSelect ### Description Selects a font to be used for subsequent text display commands. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the font to select. ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## fontDelete ### Description Deletes a specified font from the ActiveLook device's memory. If the ID is 0xFF, all fonts are deleted. ### Method Master to ActiveLook ### Parameters #### Path Parameters - **id** (u8) - Required - The ID of the font to delete. Use 0xFF to delete all fonts. ### Response #### Success Response (200) - **Status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ```