From 2c8c9c9928b4880bc91884451cbbc4b9afc6d705 Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 31 Mar 2022 23:16:56 +0100 Subject: [PATCH] And sort out docs gen too --- data/templates/xap/docs/term_definitions.md.j2 | 3 +++ data/xap/xap_0.0.1.hjson | 10 +++++----- docs/xap_0.0.1.md | 6 ++++-- docs/xap_0.1.0.md | 8 +++++--- docs/xap_0.2.0.md | 8 +++++--- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/data/templates/xap/docs/term_definitions.md.j2 b/data/templates/xap/docs/term_definitions.md.j2 index 8afdb9c3e2..39587edb49 100644 --- a/data/templates/xap/docs/term_definitions.md.j2 +++ b/data/templates/xap/docs/term_definitions.md.j2 @@ -2,4 +2,7 @@ | -- | -- | {%- for type, definition in xap.term_definitions | dictsort %} | _{{ type }}_ | {{ definition }} | +{%- endfor %} +{%- for type, definition in xap.types | dictsort %} +| _{{ definition.name }}_ | {{ definition.description }}{% if 'struct' == definition.type %} Takes the format:{% for item in definition.struct_members %}
`{{ item.type }}` - {{ item.name }}{%- endfor %}{% endif %} | {%- endfor %} \ No newline at end of file diff --git a/data/xap/xap_0.0.1.hjson b/data/xap/xap_0.0.1.hjson index 31aa5fdafc..a2abcb5fd6 100755 --- a/data/xap/xap_0.0.1.hjson +++ b/data/xap/xap_0.0.1.hjson @@ -122,25 +122,25 @@ types: { identifier: { name: ID - description: Subsystem/Route ID + description: A single octet / 8-bit byte, representing Subsystem or Route index. type: u8 } response_flags: { name: Response Flags - description: Contains the status of the request + description: An `u8` containing the status of the request. type: u8 } token: { name: Token - description: ID associated with a specific request as well as its corresponding response + description: A `u16` associated with a specific request as well as its corresponding response. type: u16 } request_header: { name: Request Header - description: asdf + description: Packet format for inbound data. type: struct struct_members: [ { @@ -156,7 +156,7 @@ response_header: { name: Response Header - description: asdf + description: Packet format for inbound data. type: struct struct_members: [ { diff --git a/docs/xap_0.0.1.md b/docs/xap_0.0.1.md index 336176c33c..afa23c85c3 100644 --- a/docs/xap_0.0.1.md +++ b/docs/xap_0.0.1.md @@ -20,12 +20,14 @@ This list defines the terms used across the entire set of XAP protocol documenta | Name | Definition | | -- | -- | | _Handler_ | A piece of code that is executed when a specific _route_ is received. | -| _ID_ | A single octet / 8-bit byte. | | _Payload_ | Any received data appended to the _route_, which gets delivered to the _handler_ when received. | | _Response_ | The data sent back to the host during execution of a _handler_. | -| _Response Flags_ | An `u8` containing the status of the request. | | _Route_ | A sequence of _IDs_ describing the route to invoke a _handler_. | | _Subsystem_ | A high-level area of functionality within XAP. | +| _ID_ | A single octet / 8-bit byte, representing Subsystem or Route index. | +| _Request Header_ | Packet format for inbound data. Takes the format:
`token` - token
`u8` - length | +| _Response Flags_ | An `u8` containing the status of the request. | +| _Response Header_ | Packet format for inbound data. Takes the format:
`token` - token
`response_flags` - flags
`u8` - length | | _Token_ | A `u16` associated with a specific request as well as its corresponding response. | ## Requests and Responses diff --git a/docs/xap_0.1.0.md b/docs/xap_0.1.0.md index f3911d7220..c61ee1df60 100644 --- a/docs/xap_0.1.0.md +++ b/docs/xap_0.1.0.md @@ -23,15 +23,17 @@ This list defines the terms used across the entire set of XAP protocol documenta | -- | -- | | _Capability_ | A way to determine if certain functionality is enabled in the firmware. Any _subsystem_ that provides build-time restriction of functionality must provide a _route_ for a _capabilities query_. | | _Handler_ | A piece of code that is executed when a specific _route_ is received. | -| _ID_ | A single octet / 8-bit byte. | | _Payload_ | Any received data appended to the _route_, which gets delivered to the _handler_ when received. | | _Response_ | The data sent back to the host during execution of a _handler_. | -| _Response Flags_ | An `u8` containing the status of the request. | | _Route_ | A sequence of _IDs_ describing the route to invoke a _handler_. | | _Secure Route_ | A _route_ which has potentially destructive consequences, necessitating prior approval by the user before executing. | | _Subsystem_ | A high-level area of functionality within XAP. | -| _Token_ | A `u16` associated with a specific request as well as its corresponding response. | | _Unlock sequence_ | A physical sequence initiated by the user to enable execution of _secure routes_. | +| _ID_ | A single octet / 8-bit byte, representing Subsystem or Route index. | +| _Request Header_ | Packet format for inbound data. Takes the format:
`token` - token
`u8` - length | +| _Response Flags_ | An `u8` containing the status of the request. | +| _Response Header_ | Packet format for inbound data. Takes the format:
`token` - token
`response_flags` - flags
`u8` - length | +| _Token_ | A `u16` associated with a specific request as well as its corresponding response. | ## Requests and Responses diff --git a/docs/xap_0.2.0.md b/docs/xap_0.2.0.md index f3911d7220..c61ee1df60 100644 --- a/docs/xap_0.2.0.md +++ b/docs/xap_0.2.0.md @@ -23,15 +23,17 @@ This list defines the terms used across the entire set of XAP protocol documenta | -- | -- | | _Capability_ | A way to determine if certain functionality is enabled in the firmware. Any _subsystem_ that provides build-time restriction of functionality must provide a _route_ for a _capabilities query_. | | _Handler_ | A piece of code that is executed when a specific _route_ is received. | -| _ID_ | A single octet / 8-bit byte. | | _Payload_ | Any received data appended to the _route_, which gets delivered to the _handler_ when received. | | _Response_ | The data sent back to the host during execution of a _handler_. | -| _Response Flags_ | An `u8` containing the status of the request. | | _Route_ | A sequence of _IDs_ describing the route to invoke a _handler_. | | _Secure Route_ | A _route_ which has potentially destructive consequences, necessitating prior approval by the user before executing. | | _Subsystem_ | A high-level area of functionality within XAP. | -| _Token_ | A `u16` associated with a specific request as well as its corresponding response. | | _Unlock sequence_ | A physical sequence initiated by the user to enable execution of _secure routes_. | +| _ID_ | A single octet / 8-bit byte, representing Subsystem or Route index. | +| _Request Header_ | Packet format for inbound data. Takes the format:
`token` - token
`u8` - length | +| _Response Flags_ | An `u8` containing the status of the request. | +| _Response Header_ | Packet format for inbound data. Takes the format:
`token` - token
`response_flags` - flags
`u8` - length | +| _Token_ | A `u16` associated with a specific request as well as its corresponding response. | ## Requests and Responses