| Version | Date | Publisher | Description | |
|---|---|---|---|---|
| V0.1 | 2025-11-07 | ouki.wang | [email protected] | First version |
| V0.2 | 2025-11-26 | ouki.wang | [email protected] | 1. Add API for retrieving read/write algorithm parameters 2. Remove RETURN_OK and uniformly use RETURN_ARGS 3. Modify command numbers and algorithm numbers 4. Change rectangle setting from x1 y1 x2 y2 to x y width height |
| Head55 | HeadAA | CMD | Data Length | Data | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 1 byte | 1 byte | 0-n bytes | 1 byte |
| ID | Algorithm | Description |
|---|---|---|
| 0 | Universal ID(None) | For handshakes, algorithm switching, and other general-purpose commands |
| 1 | FACE_RECOGNITION | Contain facial feature data |
| 2 | OBJECT_RECOGNITION | |
| 3 | OBJECT_TRACKING | |
| 4 | COLOR_RECOGNITION | |
| 5 | OBJECT_CLASSIFICATION | |
| 6 | SELF_LEARNING_CLASSIFICATION | |
| 7 | SEGMENT | |
| 8 | HAND_RECOGNITION | Contain finger key point data |
| 9 | POSE_RECOGNITION | Contain human body key point data |
| 10 | LICENSE_RECOGNITION | |
| 11 | OCR_RECOGNITION | |
| 12 | LINE_TRACKING | |
| 13 | EMOTION_RECOGNITION | |
| 14 | GAZE_RECOGNITION | |
| 15 | FACE_ORIENTATION | |
| 16 | TAG_RECOGNITION | |
| 17 | BARCODE_RECOGNITION | |
| 18 | QRCODE_RECOGNITION | |
| 19 | FALLDOWN_RECOGNITION | |
| 20 | RFU | |
| 21 | RFU | |
| ... | ... | |
| 100-127 | RESERVE | |
| 128-255 | User installed model |
| ID | Meaning | Description |
|---|---|---|
| 0 | Unlearned ID | In the line-following application, the default ID is 0. If multiple colored tracks are learned, the ID represents the color ID being learned. |
| 1-n | Learned ID |
| COLOR Macro | Name | RGB |
|---|---|---|
| COLOR_WHITE | White | (255, 255, 255) |
| COLOR_RED | Red | (255, 0, 0) |
| COLOR_ORANGE | Orange | (255, 165, 0) |
| COLOR_YELLOW | Yellow | (255, 255, 0) |
| COLOR_GREEN | Green | (0, 255, 0) |
| COLOR_CYAN | Cyan | (0, 255, 255) |
| COLOR_BLUE | Blue | (0, 0, 255) |
| COLOR_PURPLE | Purple | (128, 0, 128) |
| COLOR_PINK | Pink | (255, 192, 203) |
| COLOR_GRAY | Gray | (128, 128, 128) |
| COLOR_BLACK | Black | (0, 0, 0) |
| COLOR_BROWN | Brown | (165, 42, 42) |
| COLOR_OLIVE | Olive | (128, 128, 0) |
| COLOR_TEAL | Teal | (0, 128, 128) |
| COLOR_INDIGO | Indigo | (75, 0, 130) |
| COLOR_MAGENTA | Magenta | (255, 0, 255) |
Shake hands with HUSKYLENS V2 and tell it whether you're a large-memory MCU or a small-memory MCU.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x00 | 1 byte | 10 | 10 bytes | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | boardType (0 small ram) (1 large ram) |
| 1-9 | 9 | RFU |
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x01 | 1 byte | 0 | 1 byte |
Return: RETURN_INFO RETURN_BLOCK... RETURN_ARROW...
Get algorithm parameters Assume the key length is n
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x02 | 1 byte | 10+n+1 | 10+n+1 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 | 0 |
| 2 | 2 | 0 |
| 4 | 2 | 0 |
| 6 | 2 | 0 |
| 8 | 2 | 0 |
| 10 | 1 | key length |
| 11 | n | key |
Switch Algorithm
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0A | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | algoID(Target algorithm ID) |
| 1 | 1 | 0 |
| 2 | 2 | 0 |
| 4 | 2 | 0 |
| 6 | 2 | 0 |
| 8 | 2 | 0 |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Set the name based on the learned ID (ID > 0). (Assuming the set name length is n, where 0 < n ≤ 32) Supports Chinese characters. For Chinese characters, please use UTF-8 encoding.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0B | 1 byte | 10+1+n | 1+n | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | ID(Learnt ID) |
| 1 | 1 | RFU0 |
| 2 | 2 | RFU1 |
| 4 | 2 | RFU2 |
| 6 | 2 | RFU3 |
| 8 | 2 | RFU4 |
| 10 | 1 | name length |
| 11 | n | name |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Create a combination algorithm. Only one combination algorithm may be created. Each combination algorithm supports up to three sub-algorithms.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0C | 0 | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | multiAlgoNum (Number of multi-algorithms) |
| 1 | 1 | RFU0 |
| 2 | 2 | AlgoID0 |
| 4 | 2 | AlgoID1 |
| 6 | 2 | AlgoID2 |
| 8 | 2 | RFU1 |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Set the ratio of algorithm operations in the combination. The number of ratios must match the number of algorithms.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0D | 0 | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | multiAlgoNum (Number of multi-algorithms) |
| 1 | 1 | RFU0 |
| 2 | 2 | AlgoID0 |
| 4 | 2 | AlgoID1 |
| 6 | 2 | AlgoID2 |
| 8 | 2 | RFU1 |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Set algorithm parameters
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0E | 1 byte | 10+n+m+2 | 10 by+n+m+2 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | |
| 1 | 1 | |
| 2 | 2 | arg0(number) |
| 4 | 2 | |
| 6 | 2 | |
| 8 | 2 | |
| 10 | 1 | key(string) length |
| 11 | n | |
| 11+n | 1 | arg0(string)length |
| 11+n+1 | m | arg0(string) |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Set algorithm parameters
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x0F | 1 byte | 0 | 1 byte |
Return command: RETURN_ARGS retValue=0 indicates successful execution, other values indicate execution failure
Return parameters: up to 4 numeric parameters and 2 string parameters
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x1A | 1 byte | 10 or 10 + n + m | 10 byte | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | totalIntArgs (Number of int parameters returned) |
| 1 | 1 | Execution result: 0 indicates success, 1 indicates failure. |
| 2 | 2 | arg0_int |
| 4 | 2 | |
| 6 | 2 | |
| 8 | 2 | |
| 10 | 1 | key(string) length |
| 11 | n | |
| 11+n | 1 | arg0(string)length |
| 11+n+1 | m | arg0(string) |
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x1B | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | maxID(Maximum number learned) |
| 1 | 1 | RFU0 |
| 2 | 2 | total_results(Total number of identifications) |
| 4 | 2 | total_results_learned(Total number studied) |
| 6 | 2 | total_blocks (Total number of blocks) |
| 8 | 2 | total_blocks_learned (Total number of blocks studied) |
Assume the block's name has length n and its content has length m.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x1C | 1 byte | 10+2+n+m+private_data_length | 10 bytes+private_data_length bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | ID |
| 1 | 1 | Algo ID |
| 2 | 2 | xCenter |
| 4 | 2 | yCenter |
| 6 | 2 | width |
| 8 | 2 | height |
| 10 | 1 | name length |
| 11 | n | name |
| 11+n | 1 | content length |
| 11+n+1 | m | content |
| Algorithm Private Data |
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x1D | 1 byte | 10 | 10 bytes | 1 byte |
Data The returned data is a vector. The starting point of the Level 1 vector is the midpoint of the screen's bottom edge (320, 480). The vertical line corresponds to an angle of 0 degrees. Rotating clockwise increases the angle up to 90 degrees, while rotating counterclockwise decreases it down to -90 degrees. The starting point of the Level 2 vector is the endpoint of the Level 1 vector. This design supports operations that add vectors of different levels.
| offset | length | name |
|---|---|---|
| 0 | 1 | ID |
| 1 | 1 | RFU |
| 2 | 2 | xTarget |
| 4 | 2 | yTarget |
| 6 | 2 | angle(-90,90) |
| 7 | 2 | length |
Take a photo
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x20 | 0 | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure. arg0_str is the photo filename.
Screenshot
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x21 | 0 | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure. arg0_str is the screenshot filename.
Learning successful, return ID non-zero; learning failed, return ID 0.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x22 | 0 | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure. arg0_int is the learned ID. 0 indicates not learned, while >=1 indicates the learned ID.
Forget everything
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x23 | 0 | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Save current configuration to the knowledge base
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x24 | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | knowLedges_id range[0, 4] |
| 1-9 | 9 | RFU |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Load Knowledge Base
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x25 | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | knowLedges_id range[0, 4] |
| 1 | 9 | RFU |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Draw a rectangle
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x26 | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | colorID |
| 1 | 1 | lineWidth |
| 2 | 2 | x |
| 4 | 2 | y |
| 6 | 2 | width |
| 8 | 2 | height |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Clear all rectangles drawn via the communication protocol
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x27 | 1 byte | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Draw text, if background color bgColorID is set, use bgColorIDFixed=bgColorID+256, if no background color, bgColorIDFixed
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x28 | 1 byte | 0 | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | colorID |
| 1 | 1 | lineWidth |
| 2 | 2 | x |
| 4 | 2 | y |
| 6 | 2 | RFU0 |
| 8 | 2 | RFU1 |
| 10 | 1 | Text length |
| 11 | n | text |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Clear all text drawn via the communication protocol
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x29 | 1 byte | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Play music
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2A | 0 | 10+1+n | 10+1+n bytes | 1byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | RFU0 |
| 1 | 1 | RFU1 |
| 2 | 2 | colume |
| 4 | 2 | RFU2 |
| 6 | 2 | RFU3 |
| 8 | 2 | RFU4 |
| 10 | 1 | name length |
| 11 | n | name |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Exit the current application. If you are currently on the main menu, you will not exit.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2B | 1 byte | 0 | 1 byte |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Set the position and size of the learning box [Currently only available for object tracking]
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2C | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | RFU0 |
| 1 | 1 | RFU1 |
| 2 | 2 | x |
| 4 | 2 | y |
| 6 | 2 | width |
| 8 | 2 | height |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure. arg0_int is the learned ID. 0 indicates not learned, while >=1 indicates the learned ID.
Drawing a single rectangle will clear any previously drawn rectangles on the screen.
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2D | 1 byte | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | colorID |
| 1 | 1 | lineWidth |
| 2 | 2 | x |
| 4 | 2 | y |
| 6 | 2 | width |
| 8 | 2 | height |
Return: RETURN_ARGS retValue=0 indicates successful execution. Other values indicate execution failure.
Start recording audio or video, file name can be omitted
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2E | 0 | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | 0: default 1: 640x480 2: 1280x720 3: 1920x1080 |
| 1 | 1 | 1: audio 2: video 3: ( audio+video ) |
| 2 | 2 | duration |
| 4 | 2 | |
| 6 | 2 | |
| 8 | 2 | |
| 10 | 1 | filename length |
| 11 | n | filename |
Return command: RETURN_ARGS retValue=0 indicates successful execution, other values indicate execution failure, with attached file name or error information
Start recording audio or video
| Head55 | HeadAA | CMD | Algo ID | Data Length | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x2F | 0 | 10 | 10 bytes | 1 byte |
Data
| offset | length | name |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 | 1: audio 2: video 3: ( audio+video ) |
| 2 | 8 | 0 |
Return command: RETURN_ARGS retValue=0 indicates successful execution, other values indicate execution failure, with attached file name or error information
| offset | length | name |
|---|---|---|
| 0 | 2 | leye_x |
| 2 | 2 | leye_y |
| 4 | 2 | reye_x |
| 6 | 2 | reye_y |
| 8 | 2 | nose_x |
| 10 | 2 | nose_y |
| 12 | 2 | lmouth_x |
| 14 | 2 | lmouth_y |
| 16 | 2 | rmouth_x |
| 18 | 2 | rmouth_y |
| offset | length | name |
|---|---|---|
| 0 | 2 | wrist_x |
| 2 | 2 | wrist_y |
| 4 | 2 | thumb_cmc_x |
| 6 | 2 | thumb_cmc_y |
| 8 | 2 | thumb_mcp_x |
| 10 | 2 | thumb_mcp_y |
| 12 | 2 | thumb_ip_x |
| 14 | 2 | thumb_ip_y |
| 16 | 2 | thumb_tip_x |
| 18 | 2 | thumb_tip_y |
| 20 | 2 | index_finger_mcp_x |
| 22 | 2 | index_finger_mcp_y |
| 24 | 2 | index_finger_pip_x |
| 26 | 2 | index_finger_pip_y |
| 28 | 2 | index_finger_dip_x |
| 30 | 2 | index_finger_dip_y |
| 32 | 2 | index_finger_tip_x |
| 34 | 2 | index_finger_tip_y |
| 36 | 2 | middle_finger_mcp_x |
| 38 | 2 | middle_finger_mcp_y |
| 40 | 2 | middle_finger_pip_x |
| 42 | 2 | middle_finger_pip_y |
| 44 | 2 | middle_finger_dip_x |
| 46 | 2 | middle_finger_dip_y |
| 48 | 2 | middle_finger_tip_x |
| 50 | 2 | middle_finger_tip_y |
| 52 | 2 | ring_finger_mcp_x |
| 54 | 2 | ring_finger_mcp_y |
| 56 | 2 | ring_finger_pip_x |
| 58 | 2 | ring_finger_pip_y |
| 60 | 2 | ring_finger_dip_x |
| 62 | 2 | ring_finger_dip_y |
| 64 | 2 | ring_finger_tip_x |
| 66 | 2 | ring_finger_tip_y |
| 68 | 2 | pinky_finger_mcp_x |
| 70 | 2 | pinky_finger_mcp_y |
| 72 | 2 | pinky_finger_pip_x |
| 74 | 2 | pinky_finger_pip_y |
| 76 | 2 | pinky_finger_dip_x |
| 78 | 2 | pinky_finger_dip_y |
| 80 | 2 | pinky_finger_tip_x |
| 82 | 2 | pinky_finger_tip_y |
| offset | length | name |
|---|---|---|
| 0 | 2 | nose_x |
| 2 | 2 | nose_y |
| 4 | 2 | leye_x |
| 6 | 2 | leye_y |
| 8 | 2 | reye_x |
| 10 | 2 | reye_y |
| 12 | 2 | lear_x |
| 14 | 2 | lear_y |
| 16 | 2 | rear_x |
| 18 | 2 | rear_y |
| 20 | 2 | lshoulder_x |
| 22 | 2 | lshoulder_y |
| 24 | 2 | rshoulder_x |
| 26 | 2 | rshoulder_y |
| 28 | 2 | lelbow_x |
| 30 | 2 | lelbow_y |
| 32 | 2 | relbow_x |
| 34 | 2 | relbow_y |
| 36 | 2 | lwrist_x |
| 38 | 2 | lwrist_y |
| 40 | 2 | rwrist_x |
| 42 | 2 | rwrist_y |
| 44 | 2 | lhip_x |
| 46 | 2 | lhip_y |
| 48 | 2 | rhip_x |
| 50 | 2 | rhip_y |
| 52 | 2 | lknee_x |
| 54 | 2 | lknee_y |
| 56 | 2 | rknee_x |
| 58 | 2 | rknee_y |
| 60 | 2 | lankle_x |
| 62 | 2 | lankle_y |
| 64 | 2 | rankle_x |
| 66 | 2 | rankle_y |