Data Type Definitions
glp/0/{SID}/fb/res/type/{type} glp/0/{SID}/fb/res/application/{Edge_Protocol_Id}/{type} |
The information about IAP data types is provided on the following pages:
- For a general discussion of IAP data types, see Data Type General Information.
- For information on how IAP handles invalid values, out-of-range values, rounding, and unknown types, see Data Type Presentation and Formatting.
This page provides information on data type definitions, device types, and their interfaces.
Data Type References
Data type references in IAP are relative to the feedback channel's res
resource type glp/0/SID/fb/res/type/{type}
. Application data is also reported under the res
resource type, with the additional elements: glp/0/SID/fb/res/application/{Edge_Protocol_Id}
The processor that publishes a type reference is responsible for publishing the type definition in the IAP feedback channel.
Tools must choose the longest match for the most specific declaration.
For example, a datapoint might report its type as the following types:
"SNVT_switch" or "cm/light-level" |
The corresponding type information is published at:
glp/0/{SID}/fb/res/type/SNVT_switch or glp/0/{SID}/fb/res/type/cm/light-level |
A LonTalk device with device type 80000123456789AB could be described for an exact match in:
glp/0/{SID}/fb/res/application/lon/80000123456789AB |
or it could be described to match all device types starting with 80000123456789:
glp/0/{SID}/fb/res/application/lon/8000012345678 |
About IAP Data Types
Comprehensive and Unambiguous
IAP Data Types are comprehensive and unambiguous. Every implementation of one IAP Data Type implements the exact same type regardless of the device or application that implements it. Note that some types provide a certain degree of freedom, such as the choice of optional datapoint members with a block, or the size of an array of calibration points. Different implementations of the same IAP profile may differ within those options, however, different implementations of the same IAP type may only differ within the options allowed by the type definition itself, and not depend on factors determined outside the type definition.
JSON Schema
Type definitions are provided in JSON. The IAP data schema, which defines the JSON language used with the IAP data types, can be found at IAP/MQ Data Schema. Data Types must validate against the IAP Data Types JSON Schema using JSON schema draft 06 (https://json-schema.org/documentation.html).
Type Attributes
Data Types support a number of optional and required standard type attributes such as minimum and maximum values. Specific implementations may declare additional non-standard attributes but may not change, re-interpret or omit required standard attributes.
Flat Data Type Definition
Type definitions are flat. A flat type definition does not include other types which it references, but merely contains the reference to the other type. The referenced type must be examined separately to obtain complete knowledge of the initial type. In comparison to deep types, which embed their references within the initial type, flat types consume fewer resources due to minimal redundancy, and support updates or corrections to initial and referenced types separately.
Profiles
Profiles implement zero or more datapoint and property members. Members can override aspects such as minimum, maximum or default values of the types they implement, and can have additional requirements.