Skip to content

Commit

Permalink
Finally fix all the issues with the DS endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram-ladurner committed Dec 16, 2024
1 parent 9cea27f commit 752c544
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 37 deletions.
37 changes: 16 additions & 21 deletions JSON_for_IO-Link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ paths:
- $ref: "./schemas.yaml#/schemas/errorObject_102"
"/masters/{masterNumber}/ports/{portNumber}/datastorage":
get:
operationId: GetMastersMasterNumberPortsPortNumberDatastorages
operationId: GetMastersMasterNumberPortsPortNumberDatastorage
tags:
- ports
parameters:
Expand All @@ -2192,26 +2192,26 @@ paths:
content:
application/json:
schema:
$ref: "./schemas.yaml#/schemas/dataStorageGetPost"
$ref: "./schemas.yaml#/schemas/dataStorageGet"
examples:
Data Storage with valid content:
value:
header:
vendorId: 15
deviceId: 65253
iolinkRevision: "1.1"
parameterChecksum: 123456
parameterChecksum: 1192298517
vendorId: 646
deviceId: 1234
functionId: 0
content: >-
TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGl
RxEIFQKGAAAE0gAAABgAAyoqKgAZAAMqKioAGgADKioq
Empty Data Storage:
value:
header:
vendorId: 26
deviceId: 65253
iolinkRevision: "1.1"
parameterChecksum: 123456
parameterChecksum: 0
vendorId: 0
deviceId: 0
functionId: 0
content: >-
''
AAAAAAAAAAAAAAAA
"401":
$ref: "#/components/responses/HTTP_401"
"403":
Expand All @@ -2233,7 +2233,7 @@ paths:
- $ref: "./schemas.yaml#/schemas/errorObject_101"
- $ref: "./schemas.yaml#/schemas/errorObject_102"
post:
operationId: PostMastersMasterNumberPortsPortNumberDatastorages
operationId: PostMastersMasterNumberPortsPortNumberDatastorage
tags:
- ports
parameters:
Expand All @@ -2246,20 +2246,15 @@ paths:
content:
application/json:
schema:
$ref: "./schemas.yaml#/schemas/dataStorageGetPost"
$ref: "./schemas.yaml#/schemas/dataStoragePost"
examples:
Data Storage with valid content:
value:
header:
vendorId: 15
deviceId: 65253
iolinkRevision: "1.1"
content: >-
TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGl
RxEIFQKGAAAE0gAAABgAAyoqKgAZAAMqKioAGgADKioq
Empty Data Storage:
value:
header: {}
content: ""
content: "AAAAAAAAAAAAAAAA"
responses:
"204":
description: Successful operation
Expand Down
67 changes: 51 additions & 16 deletions schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ schemas:
wirelessBlockList:
type: boolean
default: false
dataStorageObject:
description: DataStorageObject (including the header) as described in E.6 DS_Data of the IO-Link Interface and System Specification v1.1.4 as Base64 coded string.
type: string
minLength: 16 # 12 octets encoded in Base64 (empty DS)
maxLength: 2748 # 2048 + 12 octets encoded in Base64
identificationMasters:
type: array
items:
Expand Down Expand Up @@ -1759,10 +1764,10 @@ schemas:
minLength: 26
maxLength: 26

dataStorageGetPost:
dataStorageGet:
description: >-
In case the Data Storage is empty, the header object is empty and the
content is an empty string.
In case of an empty Data Storage, the header object contains a value of 0 for every property,
and the content contains 12 bytes of 0x00, encoded as a Base64 string.
type: object
required:
- header
Expand All @@ -1772,29 +1777,59 @@ schemas:
oneOf:
- type: object
required:
- parameterChecksum
- vendorId
- deviceId
- iolinkRevision
- functionId
properties:
parameterChecksum:
type: integer
minimum: 0
maximum: 4294967295 # UINT32_MAX
vendorId:
$ref: "#/schemas/vendorId"
deviceId:
$ref: "#/schemas/deviceId"
iolinkRevision:
$ref: "#/schemas/iolinkRevision"
functionId:
type: integer
enum:
- 0
- type: object # header for empty DS
required:
- parameterChecksum
- vendorId
- deviceId
- functionId
properties:
parameterChecksum:
type: integer
- type: object # empty object
additionalProperties: false
minProperties: 0
maxProperties: 0
enum:
- 0
vendorId:
type: integer
enum:
- 0
deviceId:
type: integer
enum:
- 0
functionId:
type: integer
enum:
- 0
content:
description: >-
Base64 encoded DataStorageObject.
The contents of the DataStorageObject are described in E.6 of the "IO-Link Interface and System Specification 1.1.3",
it consists of the "Associated header information for stored DS data objects" as described in Table G.2,
followed by the "stored DS data object" as described in Table G.1.
type: string
$ref: "#/schemas/dataStorageObject"

dataStoragePost:
description: >-
In case of an empty Data Storage, the content contains 12 bytes of 0x00, encoded as a Base64 string.
type: object
required:
- content
properties:
content:
$ref: "#/schemas/dataStorageObject"

processDataValue:
type: object
properties:
Expand Down

0 comments on commit 752c544

Please sign in to comment.