From c29a7cd6d4b8223bebf9b32c2955de21affcfdbe Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Tue, 22 Jul 2025 16:40:27 +0200 Subject: [PATCH 1/7] Added GetDeviceList and GetDeviceData methods and corresponding structures --- api/csolution-openapi.yml | 157 +++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 2 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 4d71dd7..50d14d6 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -98,6 +98,28 @@ paths: '200': description: OK content: {application/json: {schema: {$ref: '#/components/schemas/GetPacksInfoResponse'}}} + /rpc/GetDeviceList: + post: + summary: Get device list + description: Get list of filtered devices + tags: [/rpc] + requestBody: + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceListRequest'}}} + responses: + '200': + description: OK + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceListResponse'}}} + /rpc/GetDeviceData: + post: + summary: Get device data for specified device + description: Get device data for specified device + tags: [/rpc] + requestBody: + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceDataRequest'}}} + responses: + '200': + description: OK + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceDataResponse'}}} /rpc/GetComponentsTree: post: summary: Get components tree @@ -218,6 +240,90 @@ components: $ref: '#/components/schemas/Pack' required: - packs + Processor: + type: object + properties: + name: + type: string + description: Processor name withing device, optional + core: + type: string + description: Processor core type + trustzone: + type: boolean + description: Processor trustzone + required: + - core + Memory: + type: object + properties: + name: + type: string + description: Memory name/ID + size: + type: string + description: Memory size + access: + type: string + description: Memory access permissions + required: + - core + DeviceId: + type: object + properties: + name: + type: string + description: Device name + vendor: + type: string + description: Device vendor, official name should be used, optional + required: + - name + Device: + allOf: + - $ref: '#/components/schemas/DeviceId' + - properties: + family: + type: string + description: Device family + subFamily: + type: string + description: Device subfamily, optional + pack: + type: string + description: Originating pack ID + description: + type: string + description: Short device description + processors: + type: array + items: + $ref: '#/components/schemas/Processor' + memories: + type: array + items: + $ref: '#/components/schemas/Memory' + required: + - name + DevicesInfo: + allOf: + - $ref: '#/components/schemas/SuccessResult' + - properties: + devices: + type: array + description: List of devices + items: + $ref: '#/components/schemas/Device' + required: + - devices + DeviceData: + allOf: + - $ref: '#/components/schemas/SuccessResult' + - properties: + device: + $ref: '#/components/schemas/Device' + required: + - device Component: allOf: - $ref: '#/components/schemas/Common' @@ -452,7 +558,6 @@ components: required: - components - packs - LogMessages: allOf: - $ref: '#/components/schemas/SuccessResult' @@ -477,7 +582,6 @@ components: method: type: string const: GetVersion - GetVersionResult: allOf: - $ref: '#/components/schemas/SuccessResult' @@ -617,6 +721,55 @@ components: - properties: result: $ref: '#/components/schemas/UsedItems' + GetDeviceListRequest: + allOf: + - $ref: '#/x-jsonrpc-envelope-request-with-params' + - properties: + method: + type: string + const: GetDeviceList + params: + type: object + properties: + context: + type: string + description: Optional context to limit the list to packs used in the context + namePattern: + type: string + description: Optional device name pattern containing wildcards + vendor: + type: string + description: Optional vendor name to limit device list to the requested vendor + GetDeviceListResponse: + allOf: + - $ref: '#/x-jsonrpc-envelope-response' + - properties: + result: + $ref: '#/components/schemas/DevicesInfo' + GetDeviceDataRequest: + allOf: + - $ref: '#/x-jsonrpc-envelope-request-with-params' + - properties: + method: + type: string + const: GetDeviceData + params: + type: object + properties: + name: + type: string + description: Device name to query data + vendor: + type: string + description: Device vendor, optional + required: + - name + GetDeviceDataResponse: + allOf: + - $ref: '#/x-jsonrpc-envelope-response' + - properties: + result: + $ref: '#/components/schemas/DeviceData' GetComponentsTreeRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' From da095afabcb08c13edc7b4dc4815170068bb6fab Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Wed, 23 Jul 2025 17:29:27 +0200 Subject: [PATCH 2/7] [codegen] Support generic `object` property (#22) --- codegen/src/codegen.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codegen/src/codegen.ts b/codegen/src/codegen.ts index 39a1fd6..2f0f1ac 100644 --- a/codegen/src/codegen.ts +++ b/codegen/src/codegen.ts @@ -77,6 +77,7 @@ export class Codegen { `#ifndef RPCINTERFACE_H #define RPCINTERFACE_H\n #include +#include #include #include #include \n @@ -215,6 +216,10 @@ using namespace jsonrpccxx;\n`; if (item.properties) { tsType = this.getTypeName(name, suffix); cppType = `${prefix ?? ''}${tsType}`; + } else if (item.additionalProperties) { + const {cpp, ts} = this.getType(name, item.additionalProperties, suffix); + tsType = `Record`; + cppType = `map`; } else { console.error('unknown type:', item.type); } From 35832b5b3f65d0d8743fc145132c5280d06a47a4 Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Thu, 24 Jul 2025 16:26:45 +0200 Subject: [PATCH 3/7] Rename DevicesInfo into DeviceList --- api/csolution-openapi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 50d14d6..2d42098 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -305,7 +305,7 @@ components: $ref: '#/components/schemas/Memory' required: - name - DevicesInfo: + DeviceList: allOf: - $ref: '#/components/schemas/SuccessResult' - properties: @@ -745,7 +745,7 @@ components: - $ref: '#/x-jsonrpc-envelope-response' - properties: result: - $ref: '#/components/schemas/DevicesInfo' + $ref: '#/components/schemas/DeviceList' GetDeviceDataRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' From d063618461a628a18f36449c3908245a69b9b5fc Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Fri, 25 Jul 2025 14:52:46 +0200 Subject: [PATCH 4/7] Use id string --- api/csolution-openapi.yml | 91 +++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 51 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 2d42098..5f2be8a 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -109,17 +109,17 @@ paths: '200': description: OK content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceListResponse'}}} - /rpc/GetDeviceData: + /rpc/GetDeviceInfo: post: summary: Get device data for specified device description: Get device data for specified device tags: [/rpc] requestBody: - content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceDataRequest'}}} + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceInfoRequest'}}} responses: '200': description: OK - content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceDataResponse'}}} + content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceInfoResponse'}}} /rpc/GetComponentsTree: post: summary: Get components tree @@ -249,9 +249,10 @@ components: core: type: string description: Processor core type - trustzone: - type: boolean - description: Processor trustzone + attributes: + type: object + additionalProperties: + type: string required: - core Memory: @@ -268,43 +269,34 @@ components: description: Memory access permissions required: - core - DeviceId: + Device: type: object properties: - name: - type: string - description: Device name - vendor: - type: string - description: Device vendor, official name should be used, optional + id: + type: string + description: Device id in the format Vendor::Name, official vendor name should be used + family: + type: string + description: Device family + subFamily: + type: string + description: Device subfamily, optional + pack: + type: string + description: Originating pack ID + description: + type: string + description: Short device description + processors: + type: array + items: + $ref: '#/components/schemas/Processor' + memories: + type: array + items: + $ref: '#/components/schemas/Memory' required: - - name - Device: - allOf: - - $ref: '#/components/schemas/DeviceId' - - properties: - family: - type: string - description: Device family - subFamily: - type: string - description: Device subfamily, optional - pack: - type: string - description: Originating pack ID - description: - type: string - description: Short device description - processors: - type: array - items: - $ref: '#/components/schemas/Processor' - memories: - type: array - items: - $ref: '#/components/schemas/Memory' - required: - - name + - id DeviceList: allOf: - $ref: '#/components/schemas/SuccessResult' @@ -316,7 +308,7 @@ components: $ref: '#/components/schemas/Device' required: - devices - DeviceData: + DeviceInfo: allOf: - $ref: '#/components/schemas/SuccessResult' - properties: @@ -746,30 +738,27 @@ components: - properties: result: $ref: '#/components/schemas/DeviceList' - GetDeviceDataRequest: + GetDeviceInfoRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' - properties: method: type: string - const: GetDeviceData + const: GetDeviceInfo params: type: object properties: - name: - type: string - description: Device name to query data - vendor: + id: type: string - description: Device vendor, optional + description: Device ID in the format Vendor::Name, vendor prefix is optional required: - - name - GetDeviceDataResponse: + - id + GetDeviceInfoResponse: allOf: - $ref: '#/x-jsonrpc-envelope-response' - properties: result: - $ref: '#/components/schemas/DeviceData' + $ref: '#/components/schemas/DeviceInfo' GetComponentsTreeRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' From 57a01aa7dcd465f54f0c34a9f1dbceb6859f7591 Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Fri, 25 Jul 2025 16:22:02 +0200 Subject: [PATCH 5/7] Board data --- api/csolution-openapi.yml | 171 ++++++++++++++++++++++++++++++++------ 1 file changed, 144 insertions(+), 27 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 5f2be8a..bfdbbbe 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -120,6 +120,28 @@ paths: '200': description: OK content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceInfoResponse'}}} + /rpc/GetBoardList: + post: + summary: Get device list + description: Get list of filtered devices + tags: [/rpc] + requestBody: + content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardListRequest'}}} + responses: + '200': + description: OK + content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardListResponse'}}} + /rpc/GetBoardInfo: + post: + summary: Get device data for specified device + description: Get device data for specified device + tags: [/rpc] + requestBody: + content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardInfoRequest'}}} + responses: + '200': + description: OK + content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardInfoResponse'}}} /rpc/GetComponentsTree: post: summary: Get components tree @@ -214,6 +236,13 @@ components: description: Documentation required: - id + PackElement: + allOf: + - $ref: '#/components/schemas/Common' + - properties: + pack: + type: string + description: Originating pack ID Pack: allOf: - $ref: '#/components/schemas/Common' @@ -240,6 +269,17 @@ components: $ref: '#/components/schemas/Pack' required: - packs + DebugInterface: + type: object + properties: + adapter: + type: string + description: Debug adapter type + connector: + type: string + description: Connector type + required: + - adapter Processor: type: object properties: @@ -270,33 +310,23 @@ components: required: - core Device: - type: object - properties: - id: - type: string - description: Device id in the format Vendor::Name, official vendor name should be used - family: - type: string - description: Device family - subFamily: - type: string - description: Device subfamily, optional - pack: - type: string - description: Originating pack ID - description: - type: string - description: Short device description - processors: - type: array - items: - $ref: '#/components/schemas/Processor' - memories: - type: array - items: - $ref: '#/components/schemas/Memory' - required: - - id + allOf: + - $ref: '#/components/schemas/PackElement' + - properties: + family: + type: string + description: Device family + subFamily: + type: string + description: Device subfamily, optional + processors: + type: array + items: + $ref: '#/components/schemas/Processor' + memories: + type: array + items: + $ref: '#/components/schemas/Memory' DeviceList: allOf: - $ref: '#/components/schemas/SuccessResult' @@ -316,6 +346,47 @@ components: $ref: '#/components/schemas/Device' required: - device + Board: + allOf: + - $ref: '#/components/schemas/PackElement' + - properties: + image: + type: string + description: Link to file or URL with board image + devices: + type: array + description: List of mounded and compatible devices + items: + $ref: '#/components/schemas/Device' + memories: + type: array + items: + $ref: '#/components/schemas/Memory' + debugInterfaces: + type: array + description: List of supported debug interfaces + items: + $ref: '#/components/schemas/DebugInterface' + + BoardList: + allOf: + - $ref: '#/components/schemas/SuccessResult' + - properties: + boards: + type: array + description: List of boards + items: + $ref: '#/components/schemas/Board' + required: + - boards + BoardInfo: + allOf: + - $ref: '#/components/schemas/SuccessResult' + - properties: + board: + $ref: '#/components/schemas/Board' + required: + - board Component: allOf: - $ref: '#/components/schemas/Common' @@ -759,6 +830,52 @@ components: - properties: result: $ref: '#/components/schemas/DeviceInfo' + GetBoardListRequest: + allOf: + - $ref: '#/x-jsonrpc-envelope-request-with-params' + - properties: + method: + type: string + const: GetBoardList + params: + type: object + properties: + context: + type: string + description: Optional context to limit the list to packs used in the context + namePattern: + type: string + description: Optional device name pattern containing wildcards + vendor: + type: string + description: Optional vendor name to limit device list to the requested vendor + GetBoardListResponse: + allOf: + - $ref: '#/x-jsonrpc-envelope-response' + - properties: + result: + $ref: '#/components/schemas/BoardList' + GetBoardInfoRequest: + allOf: + - $ref: '#/x-jsonrpc-envelope-request-with-params' + - properties: + method: + type: string + const: GetBoardInfo + params: + type: object + properties: + id: + type: string + description: Board ID in the format Vendor::Name@Revision, vendor prefix and revision suffix are optional + required: + - id + GetBoardInfoResponse: + allOf: + - $ref: '#/x-jsonrpc-envelope-response' + - properties: + result: + $ref: '#/components/schemas/BoardInfo' GetComponentsTreeRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' From 297107c15340c8229d7233a43a5c26cbda2086de Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Tue, 29 Jul 2025 13:30:53 +0200 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Daniel Brondani --- api/csolution-openapi.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index bfdbbbe..be46b51 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -122,8 +122,8 @@ paths: content: {application/json: {schema: {$ref: '#/components/schemas/GetDeviceInfoResponse'}}} /rpc/GetBoardList: post: - summary: Get device list - description: Get list of filtered devices + summary: Get board list + description: Get list of filtered boards tags: [/rpc] requestBody: content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardListRequest'}}} @@ -133,8 +133,8 @@ paths: content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardListResponse'}}} /rpc/GetBoardInfo: post: - summary: Get device data for specified device - description: Get device data for specified device + summary: Get data for specified board + description: Get data for specified board tags: [/rpc] requestBody: content: {application/json: {schema: {$ref: '#/components/schemas/GetBoardInfoRequest'}}} @@ -285,7 +285,7 @@ components: properties: name: type: string - description: Processor name withing device, optional + description: Processor name within device, optional core: type: string description: Processor core type @@ -355,7 +355,7 @@ components: description: Link to file or URL with board image devices: type: array - description: List of mounded and compatible devices + description: List of mounted and compatible devices items: $ref: '#/components/schemas/Device' memories: From 6fb481c0aa2cb1e27c75e21051986474795642e0 Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Tue, 29 Jul 2025 14:25:41 +0200 Subject: [PATCH 7/7] Correct Board ID description --- api/csolution-openapi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index be46b51..48788b8 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -867,7 +867,7 @@ components: properties: id: type: string - description: Board ID in the format Vendor::Name@Revision, vendor prefix and revision suffix are optional + description: Board ID in the format Vendor::Name:Revision, vendor prefix is optional. required: - id GetBoardInfoResponse: