From d75330f9c198e8295ac8a18640484865775afb45 Mon Sep 17 00:00:00 2001 From: zvecr Date: Sun, 22 May 2022 20:55:17 +0100 Subject: [PATCH] flesh out secure docs --- data/templates/xap/docs/routes.md.j2 | 2 +- data/xap/xap_0.1.0.hjson | 11 +++++++++-- docs/xap_0.1.0.md | 11 +++++++++-- docs/xap_0.2.0.md | 11 +++++++++-- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/data/templates/xap/docs/routes.md.j2 b/data/templates/xap/docs/routes.md.j2 index 339d58e6168..6b27f967755 100644 --- a/data/templates/xap/docs/routes.md.j2 +++ b/data/templates/xap/docs/routes.md.j2 @@ -6,7 +6,7 @@ | Name | Route | Definition | | -- | -- | -- | {%- for subid, subroute in route.routes | dictsort %} -| {{ subroute.name }} | `{{ id }} {{ subid }}` | {{ subroute.description.split('\n')[0] }} | +| {{ subroute.name }} | `{{ id }} {{ subid }}` | {% if 'secure' == subroute.permissions %}__Secure unlock required__ {% endif %}{{ subroute.description.split('\n')[0] }} | {%- endfor %} {% endif %} {%- endfor %} diff --git a/data/xap/xap_0.1.0.hjson b/data/xap/xap_0.1.0.hjson index fb5731d4bf3..aea65843465 100755 --- a/data/xap/xap_0.1.0.hjson +++ b/data/xap/xap_0.1.0.hjson @@ -119,7 +119,7 @@ Log message payloads include a `u8` signifying the length of the text, followed by the `u8[Length]` containing the text itself. **Example Log Broadcast** -- log message "Hello QMK!" - + | Byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | **Purpose** | Token | Token | Broadcast Type | Length | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | @@ -131,7 +131,14 @@ define: SECURE_STATUS description: ''' - Secure status has changed. + Secure status has changed. Payloads include a `u8` matching a 'Secure Status' request. + + **Example Secure Status Broadcast** -- secure "Unlocking" + + | Byte | 0 | 1 | 2 | 3 | + | --- | --- | --- | --- | --- | + | **Purpose** | Token | Token | Broadcast Type | Secure Status | + | **Value** | `0xFF` | `0xFF` | `0x01` | `0x01` | ''' return_type: u8 } diff --git a/docs/xap_0.1.0.md b/docs/xap_0.1.0.md index 6e79158e3dc..4ce1deb43ba 100644 --- a/docs/xap_0.1.0.md +++ b/docs/xap_0.1.0.md @@ -110,7 +110,7 @@ This subsystem is always present, and provides the ability to address QMK-specif | Product Name | `0x01 0x04` | Retrieves the product name | | info.json length | `0x01 0x05` | Retrieves the length of info.json | | info.json | `0x01 0x06` | Retrieves a chunk of info.json | -| Jump to bootloader | `0x01 0x07` | Jump to bootloader | +| Jump to bootloader | `0x01 0x07` | __Secure unlock required__ Jump to bootloader | | info.json | `0x01 0x08` | Retrieves a unique identifier for the board. | ### Keyboard - `0x02` @@ -139,5 +139,12 @@ Log message payloads include a `u8` signifying the length of the text, followed | **Purpose** | Token | Token | Broadcast Type | Length | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | | **Value** | `0xFF` | `0xFF` | `0x00` | `0x0A`(10) | `0x48`(H) | `0x65`(e) | `0x6C`(l) | `0x6C`(l) | `0x6F`(o) | `0x20`( ) | `0x51`(Q) | `0x4D`(M) | `0x4B`(K) | `0x21`(!) | ### Secure Status - `0x01` -Secure status has changed. +Secure status has changed. Payloads include a `u8` matching a 'Secure Status' request. + +**Example Secure Status Broadcast** -- secure "Unlocking" + +| Byte | 0 | 1 | 2 | 3 | +| --- | --- | --- | --- | --- | +| **Purpose** | Token | Token | Broadcast Type | Secure Status | +| **Value** | `0xFF` | `0xFF` | `0x01` | `0x01` | diff --git a/docs/xap_0.2.0.md b/docs/xap_0.2.0.md index 47115c5e365..e48d1a32315 100644 --- a/docs/xap_0.2.0.md +++ b/docs/xap_0.2.0.md @@ -110,7 +110,7 @@ This subsystem is always present, and provides the ability to address QMK-specif | Product Name | `0x01 0x04` | Retrieves the product name | | info.json length | `0x01 0x05` | Retrieves the length of info.json | | info.json | `0x01 0x06` | Retrieves a chunk of info.json | -| Jump to bootloader | `0x01 0x07` | Jump to bootloader | +| Jump to bootloader | `0x01 0x07` | __Secure unlock required__ Jump to bootloader | | info.json | `0x01 0x08` | Retrieves a unique identifier for the board. | ### Keyboard - `0x02` @@ -168,5 +168,12 @@ Log message payloads include a `u8` signifying the length of the text, followed | **Purpose** | Token | Token | Broadcast Type | Length | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | Payload | | **Value** | `0xFF` | `0xFF` | `0x00` | `0x0A`(10) | `0x48`(H) | `0x65`(e) | `0x6C`(l) | `0x6C`(l) | `0x6F`(o) | `0x20`( ) | `0x51`(Q) | `0x4D`(M) | `0x4B`(K) | `0x21`(!) | ### Secure Status - `0x01` -Secure status has changed. +Secure status has changed. Payloads include a `u8` matching a 'Secure Status' request. + +**Example Secure Status Broadcast** -- secure "Unlocking" + +| Byte | 0 | 1 | 2 | 3 | +| --- | --- | --- | --- | --- | +| **Purpose** | Token | Token | Broadcast Type | Secure Status | +| **Value** | `0xFF` | `0xFF` | `0x01` | `0x01` |