Xentara WebSocket API Specification v2.0.4
User Manual
|
Xentara WebSocket interface utilizes a designated range of CBOR Tag numbers specifically allocated for representing Enumerated Alternatives Data.
For instance, data reflecting the outcome of an action can manifest in either a failure scenario, accompanied by error details, or a success scenario, yielding a result. The allocation of tag numbers for these alternatives, as well as the expected data format for each scenario, is determined by individual supported commands.
For example, in the case of the Read Command, successful outcomes are encapsulated within the tag number of 121:
Conversely, error values are encoded within the tag number of 122:
The representation of UUIDs within Xentara WebSocket packets adheres to a standardized encoding method. Specifically, this is achieved by utilizing Tag 37 (Binary UUID), which is applied to a Byte string. The tag number 37 signifies that the byte string represents a binary UUID.
For example, the UUID B4E1C552-E3C7-406B-95A2-AA09C553F277 is represented as follows:
In the Xentara WebSocket packets, time stamps are encoded to ensure precise and flexible time representation between the server and the client. This encoding format is structured to handle various levels of time precision and special cases effectively.
Time stamps can be encoded with CBOR Tag 1001, which denotes an Extended Time format. This tag encapsulates a map containing specific keys and values that represent the time stamp.
-9
, and the time stamp value is in nanoseconds.Tag 1001({ 4: Tag 4([-9, timestamp_in_nanoseconds]) })
-6
, and the time stamp value is in microseconds. Tag 1001({ 4: Tag 4([-6, timestamp_in_microseconds]) })
-3
, and the time stamp value is in milliseconds. Tag 1001({ 4: Tag 4([-3, timestamp_in_milliseconds]) })
1001({ 4: 4([-9, 1704107471111587983]) })
1001({ 4: 4([-6, 1704107471111587]) })
1001({ 4: 4([-3, 1704107471111]) })
-Infinity
or +Infinity
to signify the minimum and maximum time points. Additionally, it support epoch-based time stamp representation in seconds as an integer or floating-point value.Tag 1001({ 1 : +Infinity })
Tag 1001({ 1 : -Infinity })
Tag 1001({ 1: timestamp_in_seconds_as_integer })
Tag 1001({ 1: timestamp_in_seconds_as_floating_point })
1001({1: 1704107471 })
1001({1: 1704107471.111859 })
Time stamps can be encoded with CBOR Tag 1, which denotes an Epoch-Based Date/Time format. This tag encapsulates a representation of time in seconds, which can be expressed either as an integer or a floating-point value.
Tag 1(seconds_as_integer)
Tag 1(seconds_as_floating_point)
1( 1704107471 )
1( 1704107471.111859 )
The server transmits time stamps to the client with precision in nanoseconds using Tag 1001 for valid time stamps. For time stamps indicating the minimum and maximum time points, the server utilizes Tag 1001 with representations of +/- Infinity, as mentioned above.
Clients have the flexibility to utilize any of the aforementioned formats to transmit time stamps to the server, accommodating various levels of precision as needed.