@hello.nrfcloud.com/proto-map 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +122 -0
  3. package/dist/generator/addDocBlock.js +5 -0
  4. package/dist/generator/generateLwM2MDefinitions.js +82 -0
  5. package/dist/generator/generateLwM2MDefinitions.spec.js +91 -0
  6. package/dist/generator/generateLwm2mTimestampResources.js +69 -0
  7. package/dist/generator/generateModels.js +142 -0
  8. package/dist/generator/generateType.js +90 -0
  9. package/dist/generator/generateValidator.js +132 -0
  10. package/dist/generator/generateValidators.js +63 -0
  11. package/dist/generator/isDir.js +163 -0
  12. package/dist/generator/isDir.spec.js +212 -0
  13. package/dist/generator/lwm2m.js +106 -0
  14. package/dist/generator/models.js +306 -0
  15. package/dist/generator/printNode.js +8 -0
  16. package/dist/generator/tokenizeName.js +5 -0
  17. package/dist/generator/tokenizeName.spec.js +98 -0
  18. package/dist/generator/types.js +140 -0
  19. package/dist/lwm2m/LWM2MObjectDefinition.js +88 -0
  20. package/dist/lwm2m/LWM2MObjectInfo.js +9 -0
  21. package/dist/lwm2m/LwM2MObject.d.js +1 -0
  22. package/dist/lwm2m/LwM2MObjectID.js +57 -0
  23. package/dist/lwm2m/ParsedLwM2MObjectDefinition.js +1 -0
  24. package/dist/lwm2m/check-lwm2m-rules.js +480 -0
  25. package/dist/lwm2m/definitions.js +596 -0
  26. package/dist/lwm2m/fromXML2JSON.js +194 -0
  27. package/dist/lwm2m/instanceTs.js +9 -0
  28. package/dist/lwm2m/instanceTs.spec.js +16 -0
  29. package/dist/lwm2m/isRegisteredLwM2MObject.js +3 -0
  30. package/dist/lwm2m/isRegisteredLwM2MObject.spec.js +45 -0
  31. package/dist/lwm2m/object/14201.d.js +5 -0
  32. package/dist/lwm2m/object/14202.d.js +5 -0
  33. package/dist/lwm2m/object/14203.d.js +5 -0
  34. package/dist/lwm2m/object/14204.d.js +5 -0
  35. package/dist/lwm2m/object/14205.d.js +5 -0
  36. package/dist/lwm2m/object/14210.d.js +5 -0
  37. package/dist/lwm2m/object/14220.d.js +5 -0
  38. package/dist/lwm2m/object/14230.d.js +5 -0
  39. package/dist/lwm2m/object/validate14201.js +18 -0
  40. package/dist/lwm2m/object/validate14202.js +17 -0
  41. package/dist/lwm2m/object/validate14203.js +19 -0
  42. package/dist/lwm2m/object/validate14204.js +17 -0
  43. package/dist/lwm2m/object/validate14205.js +15 -0
  44. package/dist/lwm2m/object/validate14210.js +13 -0
  45. package/dist/lwm2m/object/validate14220.js +12 -0
  46. package/dist/lwm2m/object/validate14230.js +13 -0
  47. package/dist/lwm2m/objects.js +8 -0
  48. package/dist/lwm2m/parseRangeEnumeration.js +20 -0
  49. package/dist/lwm2m/parseRangeEnumeration.spec.js +27 -0
  50. package/dist/lwm2m/resourceType.js +12 -0
  51. package/dist/lwm2m/timestampResources.js +12 -0
  52. package/dist/lwm2m/unwrapNestedArray.js +114 -0
  53. package/dist/lwm2m/unwrapNestedArray.spec.js +374 -0
  54. package/dist/lwm2m/validate.js +14 -0
  55. package/dist/lwm2m/validation.js +146 -0
  56. package/dist/lwm2m/validators.js +20 -0
  57. package/dist/markdown/getCodeBlock.js +74 -0
  58. package/dist/markdown/getFrontMatter.js +15 -0
  59. package/dist/markdown/parseREADME.js +19 -0
  60. package/dist/models/asset_tracker_v2+AWS/examples/examples.spec.js +489 -0
  61. package/dist/models/check-model-rules.js +137 -0
  62. package/dist/models/models.js +137 -0
  63. package/dist/models/types.js +13 -0
  64. package/dist/senml/SenMLSchema.js +79 -0
  65. package/dist/senml/SenMLSchema.spec.js +23 -0
  66. package/dist/senml/hasValue.js +8 -0
  67. package/dist/senml/hasValue.spec.js +103 -0
  68. package/dist/senml/lwm2mToSenML.js +137 -0
  69. package/dist/senml/lwm2mToSenML.spec.js +104 -0
  70. package/dist/senml/parseResourceId.js +58 -0
  71. package/dist/senml/parseResourceId.spec.js +13 -0
  72. package/dist/senml/senMLtoLwM2M.js +126 -0
  73. package/dist/senml/senMLtoLwM2M.spec.js +226 -0
  74. package/dist/senml/validateSenML.js +6 -0
  75. package/dist/senml/validateSenML.spec.js +31 -0
  76. package/export.js +13 -0
  77. package/index.d.ts +14 -0
  78. package/lwm2m/14201.xml +94 -0
  79. package/lwm2m/14202.xml +84 -0
  80. package/lwm2m/14203.xml +104 -0
  81. package/lwm2m/14204.xml +84 -0
  82. package/lwm2m/14205.xml +64 -0
  83. package/lwm2m/14210.xml +44 -0
  84. package/lwm2m/14220.xml +34 -0
  85. package/lwm2m/14230.xml +44 -0
  86. package/lwm2m/LWM2M-v1_1.xsd +168 -0
  87. package/lwm2m/LWM2MObjectDefinition.ts +84 -0
  88. package/lwm2m/LWM2MObjectInfo.ts +42 -0
  89. package/lwm2m/LwM2MObject.d.ts +19 -0
  90. package/lwm2m/LwM2MObjectID.ts +73 -0
  91. package/lwm2m/ParsedLwM2MObjectDefinition.ts +28 -0
  92. package/lwm2m/check-lwm2m-rules.ts +160 -0
  93. package/lwm2m/definitions.ts +278 -0
  94. package/lwm2m/format.sh +3 -0
  95. package/lwm2m/fromXML2JSON.ts +44 -0
  96. package/lwm2m/instanceTs.spec.ts +19 -0
  97. package/lwm2m/instanceTs.ts +10 -0
  98. package/lwm2m/isRegisteredLwM2MObject.spec.ts +48 -0
  99. package/lwm2m/isRegisteredLwM2MObject.ts +4 -0
  100. package/lwm2m/object/14201.d.ts +73 -0
  101. package/lwm2m/object/14202.d.ts +59 -0
  102. package/lwm2m/object/14203.d.ts +67 -0
  103. package/lwm2m/object/14204.d.ts +55 -0
  104. package/lwm2m/object/14205.d.ts +43 -0
  105. package/lwm2m/object/14210.d.ts +31 -0
  106. package/lwm2m/object/14220.d.ts +25 -0
  107. package/lwm2m/object/14230.d.ts +31 -0
  108. package/lwm2m/object/validate14201.ts +10 -0
  109. package/lwm2m/object/validate14202.ts +10 -0
  110. package/lwm2m/object/validate14203.ts +10 -0
  111. package/lwm2m/object/validate14204.ts +10 -0
  112. package/lwm2m/object/validate14205.ts +10 -0
  113. package/lwm2m/object/validate14210.ts +10 -0
  114. package/lwm2m/object/validate14220.ts +10 -0
  115. package/lwm2m/object/validate14230.ts +10 -0
  116. package/lwm2m/objects.ts +16 -0
  117. package/lwm2m/parseRangeEnumeration.spec.ts +34 -0
  118. package/lwm2m/parseRangeEnumeration.ts +29 -0
  119. package/lwm2m/resourceType.ts +11 -0
  120. package/lwm2m/timestampResources.ts +4 -0
  121. package/lwm2m/unwrapNestedArray.spec.ts +241 -0
  122. package/lwm2m/unwrapNestedArray.ts +27 -0
  123. package/lwm2m/validate.ts +30 -0
  124. package/lwm2m/validation.ts +120 -0
  125. package/lwm2m/validators.ts +21 -0
  126. package/models/PCA20035+solar/README.md +10 -0
  127. package/models/PCA20035+solar/transforms/airQuality.md +48 -0
  128. package/models/PCA20035+solar/transforms/battery.md +46 -0
  129. package/models/PCA20035+solar/transforms/button.md +45 -0
  130. package/models/PCA20035+solar/transforms/deviceInfo.md +72 -0
  131. package/models/PCA20035+solar/transforms/gain.md +45 -0
  132. package/models/PCA20035+solar/transforms/geolocationFromGroundfix.md +67 -0
  133. package/models/PCA20035+solar/transforms/geolocationFromMessage.md +80 -0
  134. package/models/PCA20035+solar/transforms/humidity.md +43 -0
  135. package/models/PCA20035+solar/transforms/networkInfo.md +84 -0
  136. package/models/PCA20035+solar/transforms/pressure.md +43 -0
  137. package/models/PCA20035+solar/transforms/temperature.md +43 -0
  138. package/models/README.md +10 -0
  139. package/models/asset_tracker_v2+AWS/README.md +6 -0
  140. package/models/asset_tracker_v2+AWS/examples/examples.spec.ts +229 -0
  141. package/models/asset_tracker_v2+AWS/examples/shadow/example-1.json +24 -0
  142. package/models/asset_tracker_v2+AWS/examples/shadow/example-2.json +30 -0
  143. package/models/asset_tracker_v2+AWS/examples/shadow/example-3.json +37 -0
  144. package/models/asset_tracker_v2+AWS/examples/shadow/example-4.json +48 -0
  145. package/models/asset_tracker_v2+AWS/examples/shadow/example-5.json +43 -0
  146. package/models/asset_tracker_v2+AWS/transforms/GNSS.md +66 -0
  147. package/models/asset_tracker_v2+AWS/transforms/battery-voltage.md +50 -0
  148. package/models/asset_tracker_v2+AWS/transforms/device-info.md +61 -0
  149. package/models/asset_tracker_v2+AWS/transforms/env.md +69 -0
  150. package/models/asset_tracker_v2+AWS/transforms/fuel-gauge.md +62 -0
  151. package/models/asset_tracker_v2+AWS/transforms/roam.md +100 -0
  152. package/models/asset_tracker_v2+AWS/transforms/solar.md +58 -0
  153. package/models/check-model-rules.ts +125 -0
  154. package/models/kartverket-vasstandsdata/README.md +13 -0
  155. package/models/models.ts +36 -0
  156. package/models/types.ts +17 -0
  157. package/package.json +111 -0
  158. package/senml/SenMLSchema.spec.ts +21 -0
  159. package/senml/SenMLSchema.ts +74 -0
  160. package/senml/hasValue.spec.ts +19 -0
  161. package/senml/hasValue.ts +12 -0
  162. package/senml/lwm2mToSenML.spec.ts +74 -0
  163. package/senml/lwm2mToSenML.ts +62 -0
  164. package/senml/parseResourceId.spec.ts +13 -0
  165. package/senml/parseResourceId.ts +23 -0
  166. package/senml/senMLtoLwM2M.spec.ts +181 -0
  167. package/senml/senMLtoLwM2M.ts +121 -0
  168. package/senml/validateSenML.spec.ts +16 -0
  169. package/senml/validateSenML.ts +8 -0
@@ -0,0 +1,104 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Connection information</Name>
5
+ <Description1><![CDATA[Details about the device's connection.]]></Description1>
6
+ <ObjectID>14203</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14203</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>Network mode</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Optional</Mandatory>
16
+ <Type>String</Type>
17
+ <RangeEnumeration/>
18
+ <Units/>
19
+ <Description><![CDATA[Examples: LTE-M, NB-IoT.]]></Description>
20
+ </Item>
21
+ <Item ID="1">
22
+ <Name>Band</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Optional</Mandatory>
26
+ <Type>Integer</Type>
27
+ <RangeEnumeration/>
28
+ <Units/>
29
+ <Description><![CDATA[E-UTRA Absolute Radio Frequency Channel Number (EARFCN) of the current cell where the EARFCN is as defined in 3GPP TS 36.101. LTE carrier channel number for unique identification of LTE band and carrier frequency. Examples: 262143]]></Description>
30
+ </Item>
31
+ <Item ID="2">
32
+ <Name>RSRP</Name>
33
+ <Operations>R</Operations>
34
+ <MultipleInstances>Single</MultipleInstances>
35
+ <Mandatory>Optional</Mandatory>
36
+ <Type>Integer</Type>
37
+ <RangeEnumeration/>
38
+ <Units>dBm</Units>
39
+ <Description><![CDATA[Reference Signal Received Power (RSRP). The average power level in dBm received from a single reference signal in an LTE (Long-term Evolution) network. Typically this value ranges from -140 to -40 dBm. Examples: -97, -104.]]></Description>
40
+ </Item>
41
+ <Item ID="3">
42
+ <Name>Area</Name>
43
+ <Operations>R</Operations>
44
+ <MultipleInstances>Single</MultipleInstances>
45
+ <Mandatory>Optional</Mandatory>
46
+ <Type>Integer</Type>
47
+ <RangeEnumeration/>
48
+ <Units/>
49
+ <Description><![CDATA[Area code. Examples: 12]]></Description>
50
+ </Item>
51
+ <Item ID="4">
52
+ <Name>Cell</Name>
53
+ <Operations>R</Operations>
54
+ <MultipleInstances>Single</MultipleInstances>
55
+ <Mandatory>Optional</Mandatory>
56
+ <Type>Integer</Type>
57
+ <RangeEnumeration/>
58
+ <Units/>
59
+ <Description><![CDATA[The cell ID the User Equipment (UE) is camped on. 4-byte Evolved Terrestrial Radio Access Network (E-UTRAN) cell ID. Examples: 33703719]]></Description>
60
+ </Item>
61
+ <Item ID="5">
62
+ <Name>Mobile country code and mobile network code</Name>
63
+ <Operations>R</Operations>
64
+ <MultipleInstances>Single</MultipleInstances>
65
+ <Mandatory>Optional</Mandatory>
66
+ <Type>Integer</Type>
67
+ <RangeEnumeration/>
68
+ <Units/>
69
+ <Description><![CDATA[Examples: 24202, 310410]]></Description>
70
+ </Item>
71
+ <Item ID="6">
72
+ <Name>IP address</Name>
73
+ <Operations>R</Operations>
74
+ <MultipleInstances>Single</MultipleInstances>
75
+ <Mandatory>Optional</Mandatory>
76
+ <Type>String</Type>
77
+ <RangeEnumeration/>
78
+ <Units/>
79
+ <Description><![CDATA[Examples: 10.81.183.99, 2001:0db8:85a3:0000:0000:8a2e:0370:7334, 2001:db8:85a3::8a2e:370:7334]]></Description>
80
+ </Item>
81
+ <Item ID="11">
82
+ <Name>Energy Estimate</Name>
83
+ <Operations>R</Operations>
84
+ <MultipleInstances>Single</MultipleInstances>
85
+ <Mandatory>Optional</Mandatory>
86
+ <Type>Integer</Type>
87
+ <RangeEnumeration/>
88
+ <Units/>
89
+ <Description><![CDATA[The %CONEVAL AT command returns amongst other data the energy estimate: Relative estimated energy consumption of data transmission compared to nominal consumption. A higher value means smaller energy consumption. 5: Difficulties in setting up connections. Maximum number of repetitions might be needed for data. 6: Poor conditions. Setting up a connection might require retries and a higher number of repetitions for data. 7: Normal conditions for cIoT device. No repetitions for data or only a few repetitions in the worst case. 8: Good conditions. Possibly very good conditions for small amounts of data. 9: Very good conditions. Efficient data transfer estimated also for larger amounts of data. Examples: 5, 7]]></Description>
90
+ </Item>
91
+ <Item ID="99">
92
+ <Name>Timestamp</Name>
93
+ <Operations>R</Operations>
94
+ <MultipleInstances>Single</MultipleInstances>
95
+ <Mandatory>Mandatory</Mandatory>
96
+ <Type>Time</Type>
97
+ <RangeEnumeration/>
98
+ <Units/>
99
+ <Description><![CDATA[The timestamp of when the measurement was performed.]]></Description>
100
+ </Item>
101
+ </Resources>
102
+ <Description2/>
103
+ </Object>
104
+ </LWM2M>
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Device information</Name>
5
+ <Description1><![CDATA[Details about the device's connection.]]></Description1>
6
+ <ObjectID>14204</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14204</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>IMEI</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Mandatory</Mandatory>
16
+ <Type>String</Type>
17
+ <RangeEnumeration/>
18
+ <Units/>
19
+ <Description><![CDATA[Board IMEI. Examples: 352656106111232.]]></Description>
20
+ </Item>
21
+ <Item ID="1">
22
+ <Name>SIM ICCID</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Optional</Mandatory>
26
+ <Type>String</Type>
27
+ <RangeEnumeration/>
28
+ <Units/>
29
+ <Description><![CDATA[Examples: 89450421180216216095.]]></Description>
30
+ </Item>
31
+ <Item ID="2">
32
+ <Name>Modem firmware version</Name>
33
+ <Operations>R</Operations>
34
+ <MultipleInstances>Single</MultipleInstances>
35
+ <Mandatory>Mandatory</Mandatory>
36
+ <Type>String</Type>
37
+ <RangeEnumeration/>
38
+ <Units/>
39
+ <Description><![CDATA[Examples: mfw_nrf9160_1.0.0.]]></Description>
40
+ </Item>
41
+ <Item ID="3">
42
+ <Name>Application firmware version</Name>
43
+ <Operations>R</Operations>
44
+ <MultipleInstances>Single</MultipleInstances>
45
+ <Mandatory>Mandatory</Mandatory>
46
+ <Type>String</Type>
47
+ <RangeEnumeration/>
48
+ <Units/>
49
+ <Description><![CDATA[Examples: v1.0.0-rc1-327-g6fc8c16b239f.]]></Description>
50
+ </Item>
51
+ <Item ID="4">
52
+ <Name>Board version</Name>
53
+ <Operations>R</Operations>
54
+ <MultipleInstances>Single</MultipleInstances>
55
+ <Mandatory>Mandatory</Mandatory>
56
+ <Type>String</Type>
57
+ <RangeEnumeration/>
58
+ <Units/>
59
+ <Description><![CDATA[Examples: thingy91_nrf9160.]]></Description>
60
+ </Item>
61
+ <Item ID="5">
62
+ <Name>Battery model</Name>
63
+ <Operations>R</Operations>
64
+ <MultipleInstances>Single</MultipleInstances>
65
+ <Mandatory>Optional</Mandatory>
66
+ <Type>String</Type>
67
+ <RangeEnumeration/>
68
+ <Units/>
69
+ <Description><![CDATA[Examples: LP302535, LP502540, LP803035.]]></Description>
70
+ </Item>
71
+ <Item ID="99">
72
+ <Name>Timestamp</Name>
73
+ <Operations>R</Operations>
74
+ <MultipleInstances>Single</MultipleInstances>
75
+ <Mandatory>Mandatory</Mandatory>
76
+ <Type>Time</Type>
77
+ <RangeEnumeration/>
78
+ <Units/>
79
+ <Description><![CDATA[The timestamp of when the measurement was performed.]]></Description>
80
+ </Item>
81
+ </Resources>
82
+ <Description2/>
83
+ </Object>
84
+ </LWM2M>
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Environment</Name>
5
+ <Description1><![CDATA[Environment information.]]></Description1>
6
+ <ObjectID>14205</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14205</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>Temperature</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Optional</Mandatory>
16
+ <Type>Float</Type>
17
+ <RangeEnumeration/>
18
+ <Units>°C</Units>
19
+ <Description><![CDATA[Environmental temperature in Celsius. Examples: 23.5, -10.2.]]></Description>
20
+ </Item>
21
+ <Item ID="1">
22
+ <Name>Humidity</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Optional</Mandatory>
26
+ <Type>Float</Type>
27
+ <RangeEnumeration/>
28
+ <Units>%</Units>
29
+ <Description><![CDATA[Environmental humidity in percent. Examples: 44.2, 72.]]></Description>
30
+ </Item>
31
+ <Item ID="2">
32
+ <Name>Atmospheric pressure</Name>
33
+ <Operations>R</Operations>
34
+ <MultipleInstances>Single</MultipleInstances>
35
+ <Mandatory>Optional</Mandatory>
36
+ <Type>Float</Type>
37
+ <RangeEnumeration/>
38
+ <Units>Pa</Units>
39
+ <Description><![CDATA[Atmospheric pressure in pascal. Examples: 1003.6, 977.]]></Description>
40
+ </Item>
41
+ <Item ID="10">
42
+ <Name>Air Quality Index</Name>
43
+ <Operations>R</Operations>
44
+ <MultipleInstances>Single</MultipleInstances>
45
+ <Mandatory>Optional</Mandatory>
46
+ <Type>Integer</Type>
47
+ <RangeEnumeration/>
48
+ <Units/>
49
+ <Description><![CDATA[The Bosch BME680 sensor calculates an Air Quality Index. See https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme680-ds001.pdf]]></Description>
50
+ </Item>
51
+ <Item ID="99">
52
+ <Name>Timestamp</Name>
53
+ <Operations>R</Operations>
54
+ <MultipleInstances>Single</MultipleInstances>
55
+ <Mandatory>Mandatory</Mandatory>
56
+ <Type>Time</Type>
57
+ <RangeEnumeration/>
58
+ <Units/>
59
+ <Description><![CDATA[The timestamp of when the measurement was performed.]]></Description>
60
+ </Item>
61
+ </Resources>
62
+ <Description2/>
63
+ </Object>
64
+ </LWM2M>
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Solar charge</Name>
5
+ <Description1><![CDATA[Measurements from the solar shield.]]></Description1>
6
+ <ObjectID>14210</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14210</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>Gain</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Mandatory</Mandatory>
16
+ <Type>Float</Type>
17
+ <RangeEnumeration/>
18
+ <Units>mA</Units>
19
+ <Description><![CDATA[The current gain from the solar shield, measured in mA. Example: 3.123, -0.0032.]]></Description>
20
+ </Item>
21
+ <Item ID="1">
22
+ <Name>Voltage</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Optional</Mandatory>
26
+ <Type>Float</Type>
27
+ <RangeEnumeration/>
28
+ <Units>V</Units>
29
+ <Description><![CDATA[Battery voltage in Volt. Examples: 2.754, 3.3.]]></Description>
30
+ </Item>
31
+ <Item ID="99">
32
+ <Name>Timestamp</Name>
33
+ <Operations>R</Operations>
34
+ <MultipleInstances>Single</MultipleInstances>
35
+ <Mandatory>Mandatory</Mandatory>
36
+ <Type>Time</Type>
37
+ <RangeEnumeration/>
38
+ <Units/>
39
+ <Description><![CDATA[The timestamp of when the measurement was performed.]]></Description>
40
+ </Item>
41
+ </Resources>
42
+ <Description2/>
43
+ </Object>
44
+ </LWM2M>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Button press</Name>
5
+ <Description1><![CDATA[Describes a button press event.]]></Description1>
6
+ <ObjectID>14220</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14220</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>Button ID</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Mandatory</Mandatory>
16
+ <Type>Integer</Type>
17
+ <RangeEnumeration/>
18
+ <Units/>
19
+ <Description><![CDATA[The ID of the button that was pressed. Examples: 1, 2.]]></Description>
20
+ </Item>
21
+ <Item ID="99">
22
+ <Name>Timestamp</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Mandatory</Mandatory>
26
+ <Type>Time</Type>
27
+ <RangeEnumeration/>
28
+ <Units/>
29
+ <Description><![CDATA[The timestamp of when the button was pressed.]]></Description>
30
+ </Item>
31
+ </Resources>
32
+ <Description2/>
33
+ </Object>
34
+ </LWM2M>
@@ -0,0 +1,44 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://openmobilealliance.org/tech/profiles/LWM2M-v1_1.xsd">
3
+ <Object ObjectType="MODefinition">
4
+ <Name>Sea Water Level</Name>
5
+ <Description1><![CDATA[Describes observed sea water level.]]></Description1>
6
+ <ObjectID>14230</ObjectID>
7
+ <ObjectURN>urn:oma:lwm2m:x:14230</ObjectURN>
8
+ <MultipleInstances>Multiple</MultipleInstances>
9
+ <Mandatory>Optional</Mandatory>
10
+ <Resources>
11
+ <Item ID="0">
12
+ <Name>Sea Water Level</Name>
13
+ <Operations>R</Operations>
14
+ <MultipleInstances>Single</MultipleInstances>
15
+ <Mandatory>Mandatory</Mandatory>
16
+ <Type>Float</Type>
17
+ <RangeEnumeration/>
18
+ <Units>cm</Units>
19
+ <Description><![CDATA[The observed sea water level relative the the sea level elevation of the sea map. Examples: 134.2, 104.5.]]></Description>
20
+ </Item>
21
+ <Item ID="1">
22
+ <Name>Station code</Name>
23
+ <Operations>R</Operations>
24
+ <MultipleInstances>Single</MultipleInstances>
25
+ <Mandatory>Mandatory</Mandatory>
26
+ <Type>String</Type>
27
+ <RangeEnumeration/>
28
+ <Units/>
29
+ <Description><![CDATA[The code of the observation station. Examples: TRD, SVG.]]></Description>
30
+ </Item>
31
+ <Item ID="99">
32
+ <Name>Timestamp</Name>
33
+ <Operations>R</Operations>
34
+ <MultipleInstances>Single</MultipleInstances>
35
+ <Mandatory>Mandatory</Mandatory>
36
+ <Type>Time</Type>
37
+ <RangeEnumeration/>
38
+ <Units/>
39
+ <Description><![CDATA[The timestamp of when the observation was made.]]></Description>
40
+ </Item>
41
+ </Resources>
42
+ <Description2/>
43
+ </Object>
44
+ </LWM2M>
@@ -0,0 +1,168 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <!--
4
+
5
+ LWM2M XML Schema - LWM2M Editor Schema
6
+ version - 1.1
7
+ date - 2018-07-10
8
+
9
+ FILE INFORMATION
10
+
11
+ Public Reachable Information
12
+ Path: http://www.openmobilealliance.org/tech/profiles
13
+ Name: LWM2M-v1_1.xsd
14
+
15
+ NORMATIVE INFORMATION
16
+
17
+ Information about this file can be found in the LWM2M online editor
18
+
19
+ This is available at http://www.openmobilealliance.org/
20
+
21
+ Send comments to https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues
22
+
23
+ CHANGE HISTORY
24
+
25
+ 21112013 First version
26
+ 06082015 Bug Fix to correct mismatch
27
+ 18022016 Legal Disclaimer updated from template OMA-TEMPLATE-SUP_XSD_example-20160218-I
28
+ 24032016 Changed "xs:unsignedshort" to "xs:unsignedShort"
29
+ 25052016 Incorporated OMA-DM-LightweightM2M-2016-0066R01-INP_CR_Update_LWM2M_xsd
30
+ 14012017 Introduction of two new elements: LWM2MObject and ObjectVersion
31
+ 09022018 Introduction of two new types: "CoreLnk" and "Unsigned Integer"
32
+ 12062018 Prepare for publication
33
+ 10072018 Prepare for Final Approval
34
+
35
+ LEGAL DISCLAIMER
36
+
37
+ Copyright 2018 Open Mobile Alliance Ltd. All rights reserved.
38
+
39
+ Redistribution and use in source and binary forms, with or without
40
+ modification, are permitted provided that the following conditions
41
+ are met:
42
+
43
+ 1. Redistributions of source code must retain the above copyright
44
+ notice, this list of conditions and the following disclaimer.
45
+ 2. Redistributions in binary form must reproduce the above copyright
46
+ notice, this list of conditions and the following disclaimer in the
47
+ documentation and/or other materials provided with the distribution.
48
+ 3. Neither the name of the copyright holder nor the names of its
49
+ contributors may be used to endorse or promote products derived
50
+ from this software without specific prior written permission.
51
+
52
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
55
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
56
+ COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
57
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
58
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
59
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
60
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
62
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
63
+ POSSIBILITY OF SUCH DAMAGE.
64
+
65
+ The above license is used as a license under copyright only. Please
66
+ reference the OMA IPR Policy for patent licensing terms:
67
+ http://www.openmobilealliance.org/ipr.html
68
+
69
+ -->
70
+
71
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
72
+ <xs:element name="LWM2M">
73
+ <xs:complexType>
74
+ <xs:sequence>
75
+ <xs:element minOccurs="1" maxOccurs="unbounded" name="Object">
76
+ <xs:complexType>
77
+ <xs:sequence>
78
+ <xs:element name="Name" type="xs:string" />
79
+ <xs:element name="Description1" type="xs:string" />
80
+ <xs:element name="ObjectID" type="xs:unsignedShort" />
81
+ <xs:element name="ObjectURN" type="xs:string" />
82
+ <xs:element name="LWM2MVersion" type="xs:string" minOccurs="0"/>
83
+ <xs:element name="ObjectVersion" type="xs:string" minOccurs="0"/>
84
+ <xs:element name="MultipleInstances" >
85
+ <xs:simpleType>
86
+ <xs:restriction base="xs:string">
87
+ <xs:enumeration value="Multiple"/>
88
+ <xs:enumeration value="Single"/>
89
+ </xs:restriction>
90
+ </xs:simpleType>
91
+ </xs:element>
92
+ <xs:element name="Mandatory" >
93
+ <xs:simpleType>
94
+ <xs:restriction base="xs:string">
95
+ <xs:enumeration value="Mandatory"/>
96
+ <xs:enumeration value="Optional"/>
97
+ </xs:restriction>
98
+ </xs:simpleType>
99
+ </xs:element>
100
+ <xs:element name="Resources">
101
+ <xs:complexType>
102
+ <xs:sequence>
103
+ <xs:element maxOccurs="unbounded" name="Item">
104
+ <xs:complexType>
105
+ <xs:sequence>
106
+ <xs:element name="Name" type="xs:string" />
107
+ <xs:element name="Operations" >
108
+ <xs:simpleType>
109
+ <xs:restriction base="xs:string">
110
+ <xs:enumeration value="R"/>
111
+ <xs:enumeration value="W"/>
112
+ <xs:enumeration value="RW"/>
113
+ <xs:enumeration value="E"/>
114
+ <xs:enumeration value=""/>
115
+ </xs:restriction>
116
+ </xs:simpleType>
117
+ </xs:element>
118
+ <xs:element name="MultipleInstances" >
119
+ <xs:simpleType>
120
+ <xs:restriction base="xs:string">
121
+ <xs:enumeration value="Multiple"/>
122
+ <xs:enumeration value="Single"/>
123
+ </xs:restriction>
124
+ </xs:simpleType>
125
+ </xs:element>
126
+ <xs:element name="Mandatory" >
127
+ <xs:simpleType>
128
+ <xs:restriction base="xs:string">
129
+ <xs:enumeration value="Mandatory"/>
130
+ <xs:enumeration value="Optional"/>
131
+ </xs:restriction>
132
+ </xs:simpleType>
133
+ </xs:element>
134
+ <xs:element name="Type" >
135
+ <xs:simpleType>
136
+ <xs:restriction base="xs:string">
137
+ <xs:enumeration value="String"/>
138
+ <xs:enumeration value="Integer"/>
139
+ <xs:enumeration value="Float"/>
140
+ <xs:enumeration value="Boolean"/>
141
+ <xs:enumeration value="Opaque"/>
142
+ <xs:enumeration value="Time"/>
143
+ <xs:enumeration value="Objlnk"/>
144
+ <xs:enumeration value="Unsigned Integer"/>
145
+ <xs:enumeration value="Corelnk"/>
146
+ <xs:enumeration value=""/>
147
+ </xs:restriction>
148
+ </xs:simpleType>
149
+ </xs:element>
150
+ <xs:element name="RangeEnumeration" type="xs:string" />
151
+ <xs:element name="Units" type="xs:string" />
152
+ <xs:element name="Description" type="xs:string" />
153
+ </xs:sequence>
154
+ <xs:attribute name="ID" type="xs:unsignedShort" use="required" />
155
+ </xs:complexType>
156
+ </xs:element>
157
+ </xs:sequence>
158
+ </xs:complexType>
159
+ </xs:element>
160
+ <xs:element name="Description2" type="xs:string" />
161
+ </xs:sequence>
162
+ <xs:attribute name="ObjectType" type="xs:string" use="required" />
163
+ </xs:complexType>
164
+ </xs:element>
165
+ </xs:sequence>
166
+ </xs:complexType>
167
+ </xs:element>
168
+ </xs:schema>
@@ -0,0 +1,84 @@
1
+ import { Type, type Static } from '@sinclair/typebox'
2
+
3
+ const ResourceType = Type.Union([
4
+ Type.Literal('String'),
5
+ Type.Literal('Integer'),
6
+ Type.Literal('Float'),
7
+ Type.Literal('Boolean'),
8
+ Type.Literal('Opaque'),
9
+ Type.Literal('Time'),
10
+ ])
11
+
12
+ export const RangeEnumerationRegExp =
13
+ /^(?<min>-?[0-9]+(?:\.[0-9]+)?)\.\.(?<max>-?[0-9]+(?:\.[0-9]+)?)$/
14
+ const RangeEnumeration = Type.RegExp(RangeEnumerationRegExp, {
15
+ title: 'RangeEnumeration',
16
+ })
17
+
18
+ export const LWM2MObjectDefinition = Type.Object(
19
+ {
20
+ Name: Type.String({ minLength: 1, examples: ['Location'] }),
21
+ Description1: Type.String({
22
+ minLength: 1,
23
+ examples: [
24
+ 'This LwM2M Object provides a range of location telemetry related information which can be queried by the LwM2M Server.',
25
+ ],
26
+ }),
27
+ ObjectID: Type.RegExp(/^14[0-9]{3}$/),
28
+ ObjectURN: Type.RegExp(/^urn:oma:lwm2m:x:14[0-9]{3}$/),
29
+ LWM2MVersion: Type.Literal('1.1', {
30
+ title: 'LwM2M version',
31
+ description: 'Defaults to 1.1',
32
+ }),
33
+ ObjectVersion: Type.Optional(
34
+ Type.String({
35
+ minLength: 1,
36
+ examples: ['1.1'],
37
+ title: 'ObjectVersion',
38
+ description: 'Defaults to 1.0',
39
+ }),
40
+ ),
41
+ MultipleInstances: Type.Literal('Multiple'),
42
+ Mandatory: Type.Literal('Optional'),
43
+ Resources: Type.Record(
44
+ Type.Integer({ minimum: 0, maximum: 65534 }),
45
+ Type.Object({
46
+ Name: Type.String({ minLength: 1, examples: ['Latitude'] }),
47
+ Operations: Type.Literal('R', {
48
+ description: 'Only read-properties are supported',
49
+ }),
50
+ MultipleInstances: Type.Literal('Single'),
51
+ Mandatory: Type.Union([
52
+ Type.Literal('Optional'),
53
+ Type.Literal('Mandatory'),
54
+ ]),
55
+ Type: ResourceType,
56
+ RangeEnumeration: Type.Union([
57
+ Type.String({ maxLength: 0, title: 'an empty string' }),
58
+ RangeEnumeration,
59
+ ]),
60
+ Units: Type.String({
61
+ examples: ['lat'],
62
+ title: 'Units',
63
+ }),
64
+ Description: Type.String({
65
+ minLength: 1,
66
+ examples: [
67
+ 'The decimal notation of latitude, e.g. -43.5723 [World Geodetic System 1984].',
68
+ ],
69
+ }),
70
+ }),
71
+ {
72
+ minProperties: 1,
73
+ description: 'Defines the object resources as a map',
74
+ },
75
+ ),
76
+ Description2: Type.String(),
77
+ },
78
+ {
79
+ description:
80
+ 'LwM2M Object definitions with additional limitations applied to suit the hello.nrfcloud.com/map use-case',
81
+ },
82
+ )
83
+
84
+ export type LWM2MObjectDefinitionType = Static<typeof LWM2MObjectDefinition>