diff --git a/data/templates/xap/docs/route_request.md.j2 b/data/templates/xap/docs/route_request.md.j2 index e0148c9d15..fd8b81ee16 100644 --- a/data/templates/xap/docs/route_request.md.j2 +++ b/data/templates/xap/docs/route_request.md.j2 @@ -1,8 +1,8 @@ {%- if subroute.request_type == 'struct' -%} -
__Request:__ +__Request:__ {%- for member in subroute.request_struct_members -%}
{{ " "|safe*4 }}* {{ member.name }}: `{{ member.type }}` {%- endfor -%} {%- elif subroute.request_type -%} -
__Request:__ `{{ subroute.request_type }}` +__Request:__ `{{ subroute.request_type }}` {%- endif -%} \ No newline at end of file diff --git a/data/templates/xap/docs/route_response.md.j2 b/data/templates/xap/docs/route_response.md.j2 index a36099937a..58af87d467 100644 --- a/data/templates/xap/docs/route_response.md.j2 +++ b/data/templates/xap/docs/route_response.md.j2 @@ -1,8 +1,8 @@ {%- if subroute.return_type == 'struct' -%} -
__Response:__ +__Response:__ {%- for member in subroute.return_struct_members -%}
{{ " "|safe*4 }}* {{ member.name }}: `{{ member.type }}` {%- endfor -%} {%- elif subroute.return_type -%} -
__Response:__ `{{ subroute.return_type }}` +__Response:__ `{{ subroute.return_type }}` {%- endif -%} \ No newline at end of file diff --git a/data/templates/xap/docs/routes.md.j2 b/data/templates/xap/docs/routes.md.j2 index 1c1e61bd51..791eaac564 100644 --- a/data/templates/xap/docs/routes.md.j2 +++ b/data/templates/xap/docs/routes.md.j2 @@ -6,7 +6,7 @@ | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | {%- for subid, subroute in route.routes | dictsort %} -| {{ subroute.name }} | `{{ id }} {{ subid }}` | {% if 'secure' == subroute.permissions %}__Secure__{% endif %} | {%- include 'route_request.md.j2' -%}{%- include 'route_response.md.j2' -%} | {{ subroute.description.replace('\n', '
') }}| +| {{ subroute.name }} | `{{ id }} {{ subid }}` | {% if 'secure' == subroute.permissions %}__Secure__{% endif %} | {%- include 'route_request.md.j2' -%}{%- if subroute.return_type and subroute.request_type -%}

{% endif %}{%- include 'route_response.md.j2' -%} | {{ subroute.description.replace('\n', '
') }}| {%- endfor %} {% endif %} {%- endfor %} diff --git a/data/xap/xap_0.1.0.hjson b/data/xap/xap_0.1.0.hjson index 8965f2b513..71023f9ac4 100755 --- a/data/xap/xap_0.1.0.hjson +++ b/data/xap/xap_0.1.0.hjson @@ -142,6 +142,23 @@ ''' return_type: u8 } + 0x02: { + name: Keyboard + define: KB + description: + ''' + Reserved for vendor-specific functionality. No messages are defined by XAP. + ''' + }, + + 0x03: { + name: User + define: USER + description: + ''' + Reserved for user-specific functionality. No messages are defined by XAP. + ''' + } } } @@ -332,7 +349,7 @@ } 0x08: { type: command - name: Unique Identifier + name: Hardware Identifier define: HARDWARE_ID description: Retrieves a unique identifier for the board. return_type: u32[4] @@ -347,7 +364,7 @@ define: KB description: ''' - This subsystem is always present, and reserved for user-specific functionality. No routes are defined by XAP. + This subsystem is always present, and reserved for vendor-specific functionality. No routes are defined by XAP. ''' routes: { } diff --git a/docs/xap_0.0.1.md b/docs/xap_0.0.1.md index fe85fddb48..004d84cbb0 100644 --- a/docs/xap_0.0.1.md +++ b/docs/xap_0.0.1.md @@ -77,6 +77,6 @@ This subsystem is always present, and provides the ability to query information | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Version Query | `0x00 0x00` | |
__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| +| Version Query | `0x00 0x00` | |__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| diff --git a/docs/xap_0.1.0.md b/docs/xap_0.1.0.md index 8c54aff882..5eb294729f 100644 --- a/docs/xap_0.1.0.md +++ b/docs/xap_0.1.0.md @@ -90,10 +90,10 @@ This subsystem is always present, and provides the ability to query information | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Version Query | `0x00 0x00` | |
__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| -| Capabilities Query | `0x00 0x01` | |
__Response:__ `u32`| XAP subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Enabled subsystem query | `0x00 0x02` | |
__Response:__ `u32`| XAP protocol subsystem query. Each bit should be considered as a "usable" subsystem. For example, checking `(value & (1 << XAP_ROUTE_QMK) != 0)` means the QMK subsystem is enabled and available for querying.| -| Secure Status | `0x00 0x03` | |
__Response:__ `u8`| Query secure route status

* 0 means secure routes are disabled
* 1 means unlock sequence initiated but incomplete
* 2 means secure routes are allowed
* any other value should be interpreted as disabled| +| Version Query | `0x00 0x00` | |__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| +| Capabilities Query | `0x00 0x01` | |__Response:__ `u32`| XAP subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Enabled subsystem query | `0x00 0x02` | |__Response:__ `u32`| XAP protocol subsystem query. Each bit should be considered as a "usable" subsystem. For example, checking `(value & (1 << XAP_ROUTE_QMK) != 0)` means the QMK subsystem is enabled and available for querying.| +| Secure Status | `0x00 0x03` | |__Response:__ `u8`| Query secure route status

* 0 means secure routes are disabled
* 1 means unlock sequence initiated but incomplete
* 2 means secure routes are allowed
* any other value should be interpreted as disabled| | Secure Unlock | `0x00 0x04` | || Initiate secure route unlock sequence| | Secure Lock | `0x00 0x05` | || Disable secure routes| @@ -103,18 +103,18 @@ This subsystem is always present, and provides the ability to address QMK-specif | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Version Query | `0x01 0x00` | |
__Response:__ `u32`| QMK protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| -| Capabilities Query | `0x01 0x01` | |
__Response:__ `u32`| QMK subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Board identifiers | `0x01 0x02` | |
__Response:__
    * Vendor ID: `u16`
    * Product ID: `u16`
    * Product Version: `u16`
    * QMK Unique Identifier: `u32`| Retrieves the set of identifying information for the board.| -| Board Manufacturer | `0x01 0x03` | |
__Response:__ `string`| Retrieves the name of the manufacturer| -| Product Name | `0x01 0x04` | |
__Response:__ `string`| Retrieves the product name| -| Config Blob Length | `0x01 0x05` | |
__Response:__ `u32`| Retrieves the length of the configuration data bundled within the firmware| -| Config Blob Chunk | `0x01 0x06` | |
__Request:__ `u16`
__Response:__ `u8[32]`| Retrieves a chunk of the configuration data bundled within the firmware| -| Jump to bootloader | `0x01 0x07` | __Secure__ |
__Response:__ `u8`| Jump to bootloader

May not be present – if QMK capabilities query returns “true”, then jump to bootloader is supported

* 0 means secure routes are disabled, and should be considered as a failure
* 1 means successful, board will jump to bootloader| -| Unique Identifier | `0x01 0x08` | |
__Response:__ `u32[4]`| Retrieves a unique identifier for the board.| +| Version Query | `0x01 0x00` | |__Response:__ `u32`| QMK protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| +| Capabilities Query | `0x01 0x01` | |__Response:__ `u32`| QMK subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Board identifiers | `0x01 0x02` | |__Response:__
    * Vendor ID: `u16`
    * Product ID: `u16`
    * Product Version: `u16`
    * QMK Unique Identifier: `u32`| Retrieves the set of identifying information for the board.| +| Board Manufacturer | `0x01 0x03` | |__Response:__ `string`| Retrieves the name of the manufacturer| +| Product Name | `0x01 0x04` | |__Response:__ `string`| Retrieves the product name| +| Config Blob Length | `0x01 0x05` | |__Response:__ `u32`| Retrieves the length of the configuration data bundled within the firmware| +| Config Blob Chunk | `0x01 0x06` | |__Request:__ `u16`

__Response:__ `u8[32]`| Retrieves a chunk of the configuration data bundled within the firmware| +| Jump to bootloader | `0x01 0x07` | __Secure__ |__Response:__ `u8`| Jump to bootloader

May not be present – if QMK capabilities query returns “true”, then jump to bootloader is supported

* 0 means secure routes are disabled, and should be considered as a failure
* 1 means successful, board will jump to bootloader| +| Hardware Identifier | `0x01 0x08` | |__Response:__ `u32[4]`| Retrieves a unique identifier for the board.| ### Keyboard - `0x02` -This subsystem is always present, and reserved for user-specific functionality. No routes are defined by XAP. +This subsystem is always present, and reserved for vendor-specific functionality. No routes are defined by XAP. ### User - `0x03` @@ -147,4 +147,8 @@ Secure status has changed. Payloads include a `u8` matching a 'Secure Status' re | --- | --- | --- | --- | --- | | **Purpose** | Token | Token | Broadcast Type | Secure Status | | **Value** | `0xFF` | `0xFF` | `0x01` | `0x01` | +### Keyboard - `0x02` +Reserved for vendor-specific functionality. No messages are defined by XAP. +### User - `0x03` +Reserved for user-specific functionality. No messages are defined by XAP. diff --git a/docs/xap_0.2.0.md b/docs/xap_0.2.0.md index 30f51dd863..bddc427f1a 100644 --- a/docs/xap_0.2.0.md +++ b/docs/xap_0.2.0.md @@ -90,10 +90,10 @@ This subsystem is always present, and provides the ability to query information | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Version Query | `0x00 0x00` | |
__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| -| Capabilities Query | `0x00 0x01` | |
__Response:__ `u32`| XAP subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Enabled subsystem query | `0x00 0x02` | |
__Response:__ `u32`| XAP protocol subsystem query. Each bit should be considered as a "usable" subsystem. For example, checking `(value & (1 << XAP_ROUTE_QMK) != 0)` means the QMK subsystem is enabled and available for querying.| -| Secure Status | `0x00 0x03` | |
__Response:__ `u8`| Query secure route status

* 0 means secure routes are disabled
* 1 means unlock sequence initiated but incomplete
* 2 means secure routes are allowed
* any other value should be interpreted as disabled| +| Version Query | `0x00 0x00` | |__Response:__ `u32`| XAP protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| +| Capabilities Query | `0x00 0x01` | |__Response:__ `u32`| XAP subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Enabled subsystem query | `0x00 0x02` | |__Response:__ `u32`| XAP protocol subsystem query. Each bit should be considered as a "usable" subsystem. For example, checking `(value & (1 << XAP_ROUTE_QMK) != 0)` means the QMK subsystem is enabled and available for querying.| +| Secure Status | `0x00 0x03` | |__Response:__ `u8`| Query secure route status

* 0 means secure routes are disabled
* 1 means unlock sequence initiated but incomplete
* 2 means secure routes are allowed
* any other value should be interpreted as disabled| | Secure Unlock | `0x00 0x04` | || Initiate secure route unlock sequence| | Secure Lock | `0x00 0x05` | || Disable secure routes| @@ -103,18 +103,18 @@ This subsystem is always present, and provides the ability to address QMK-specif | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Version Query | `0x01 0x00` | |
__Response:__ `u32`| QMK protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| -| Capabilities Query | `0x01 0x01` | |
__Response:__ `u32`| QMK subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Board identifiers | `0x01 0x02` | |
__Response:__
    * Vendor ID: `u16`
    * Product ID: `u16`
    * Product Version: `u16`
    * QMK Unique Identifier: `u32`| Retrieves the set of identifying information for the board.| -| Board Manufacturer | `0x01 0x03` | |
__Response:__ `string`| Retrieves the name of the manufacturer| -| Product Name | `0x01 0x04` | |
__Response:__ `string`| Retrieves the product name| -| Config Blob Length | `0x01 0x05` | |
__Response:__ `u32`| Retrieves the length of the configuration data bundled within the firmware| -| Config Blob Chunk | `0x01 0x06` | |
__Request:__ `u16`
__Response:__ `u8[32]`| Retrieves a chunk of the configuration data bundled within the firmware| -| Jump to bootloader | `0x01 0x07` | __Secure__ |
__Response:__ `u8`| Jump to bootloader

May not be present – if QMK capabilities query returns “true”, then jump to bootloader is supported

* 0 means secure routes are disabled, and should be considered as a failure
* 1 means successful, board will jump to bootloader| -| Unique Identifier | `0x01 0x08` | |
__Response:__ `u32[4]`| Retrieves a unique identifier for the board.| +| Version Query | `0x01 0x00` | |__Response:__ `u32`| QMK protocol version query.

* Returns the BCD-encoded version in the format of XX.YY.ZZZZ => `0xXXYYZZZZ`
* e.g. 3.2.115 will match `0x03020115`, or bytes {0x15,0x01,0x02,0x03}.| +| Capabilities Query | `0x01 0x01` | |__Response:__ `u32`| QMK subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Board identifiers | `0x01 0x02` | |__Response:__
    * Vendor ID: `u16`
    * Product ID: `u16`
    * Product Version: `u16`
    * QMK Unique Identifier: `u32`| Retrieves the set of identifying information for the board.| +| Board Manufacturer | `0x01 0x03` | |__Response:__ `string`| Retrieves the name of the manufacturer| +| Product Name | `0x01 0x04` | |__Response:__ `string`| Retrieves the product name| +| Config Blob Length | `0x01 0x05` | |__Response:__ `u32`| Retrieves the length of the configuration data bundled within the firmware| +| Config Blob Chunk | `0x01 0x06` | |__Request:__ `u16`

__Response:__ `u8[32]`| Retrieves a chunk of the configuration data bundled within the firmware| +| Jump to bootloader | `0x01 0x07` | __Secure__ |__Response:__ `u8`| Jump to bootloader

May not be present – if QMK capabilities query returns “true”, then jump to bootloader is supported

* 0 means secure routes are disabled, and should be considered as a failure
* 1 means successful, board will jump to bootloader| +| Hardware Identifier | `0x01 0x08` | |__Response:__ `u32[4]`| Retrieves a unique identifier for the board.| ### Keyboard - `0x02` -This subsystem is always present, and reserved for user-specific functionality. No routes are defined by XAP. +This subsystem is always present, and reserved for vendor-specific functionality. No routes are defined by XAP. ### User - `0x03` @@ -127,10 +127,10 @@ This subsystem allows for query of currently configured keycodes. | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Capabilities Query | `0x04 0x01` | |
__Response:__ `u32`| Keymap subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Get Layer Count | `0x04 0x02` | |
__Response:__ `u8`| Query maximum number of layers that can be addressed within the keymap.| -| Get Keycode | `0x04 0x03` | |
__Request:__
    * Layer: `u8`
    * Row: `u8`
    * Column: `u8`
__Response:__ `u16`| Query the Keycode at the requested location.| -| Get Encoder Keycode | `0x04 0x04` | |
__Request:__
    * Layer: `u8`
    * Encoder: `u8`
    * Clockwise: `u8`
__Response:__ `u16`| Query the Keycode at the requested location.| +| Capabilities Query | `0x04 0x01` | |__Response:__ `u32`| Keymap subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Get Layer Count | `0x04 0x02` | |__Response:__ `u8`| Query maximum number of layers that can be addressed within the keymap.| +| Get Keycode | `0x04 0x03` | |__Request:__
    * Layer: `u8`
    * Row: `u8`
    * Column: `u8`

__Response:__ `u16`| Query the Keycode at the requested location.| +| Get Encoder Keycode | `0x04 0x04` | |__Request:__
    * Layer: `u8`
    * Encoder: `u8`
    * Clockwise: `u8`

__Response:__ `u16`| Query the Keycode at the requested location.| ### Remapping - `0x05` This subsystem allows for live reassignment of keycodes without rebuilding the firmware. @@ -138,10 +138,10 @@ This subsystem allows for live reassignment of keycodes without rebuilding the f | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Capabilities Query | `0x05 0x01` | |
__Response:__ `u32`| Remapping subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| -| Get Layer Count | `0x05 0x02` | |
__Response:__ `u8`| Query maximum number of layers that can be addressed within the keymap.| -| Set Keycode | `0x05 0x03` | __Secure__ |
__Request:__
    * Layer: `u8`
    * Row: `u8`
    * Column: `u8`
    * Keycode: `u16`| Modify the Keycode at the requested location.| -| Set Encoder Keycode | `0x05 0x04` | __Secure__ |
__Request:__
    * Layer: `u8`
    * Encoder: `u8`
    * Clockwise: `u8`
    * Keycode: `u16`| Modify the Keycode at the requested location.| +| Capabilities Query | `0x05 0x01` | |__Response:__ `u32`| Remapping subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Get Layer Count | `0x05 0x02` | |__Response:__ `u8`| Query maximum number of layers that can be addressed within the keymap.| +| Set Keycode | `0x05 0x03` | __Secure__ |__Request:__
    * Layer: `u8`
    * Row: `u8`
    * Column: `u8`
    * Keycode: `u16`| Modify the Keycode at the requested location.| +| Set Encoder Keycode | `0x05 0x04` | __Secure__ |__Request:__
    * Layer: `u8`
    * Encoder: `u8`
    * Clockwise: `u8`
    * Keycode: `u16`| Modify the Keycode at the requested location.| ### Lighting - `0x06` This subsystem allows for control over the lighting subsystem. @@ -149,7 +149,7 @@ This subsystem allows for control over the lighting subsystem. | Name | Route | Tags | Payloads | Description | | -- | -- | -- | -- | -- | -| Capabilities Query | `0x06 0x01` | |
__Response:__ `u32`| Lighting subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| +| Capabilities Query | `0x06 0x01` | |__Response:__ `u32`| Lighting subsystem capabilities query. Each bit should be considered as a "usable" route within this subsystem.| ## Broadcast messages @@ -177,4 +177,8 @@ Secure status has changed. Payloads include a `u8` matching a 'Secure Status' re | --- | --- | --- | --- | --- | | **Purpose** | Token | Token | Broadcast Type | Secure Status | | **Value** | `0xFF` | `0xFF` | `0x01` | `0x01` | +### Keyboard - `0x02` +Reserved for vendor-specific functionality. No messages are defined by XAP. +### User - `0x03` +Reserved for user-specific functionality. No messages are defined by XAP.