@hello.nrfcloud.com/proto-map 12.1.4 → 13.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.
package/README.md CHANGED
@@ -35,7 +35,8 @@ in a meaningful way to users without the need for custom implementation.
35
35
  (non-inclusively).
36
36
  - The URN must have the prefix `urn:oma:lwm2m:x:`.
37
37
  - The `ObjectVersion` must be appended if it is not `1.0`, which is the default.
38
- - All objects must define one `Time` property.
38
+ - All objects must define one `Time` property. Time is a signed integer
39
+ representing the number of seconds since Jan 1 st, 1970 in the UTC time zone.
39
40
  - Objects must be `Multiple` instance.
40
41
  - Objects must be `Optional`.
41
42
  - Resources should only be marked as mandatory in case they must be published
@@ -1,8 +1,19 @@
1
1
  import { definitions } from './definitions.js';
2
2
  import { timestampResources } from './timestampResources.js';
3
- export var instanceTs = function(instance) {
3
+ /**
4
+ * Returns the timestamp of the instance
5
+ *
6
+ * The timestamp is s signed integer representing
7
+ * the number of seconds since Jan 1, 1970 in the
8
+ * UTC time zone.
9
+ */ export var instanceTs = function(instance) {
4
10
  var definition = definitions[instance.ObjectID];
5
11
  var tsResourceId = timestampResources.get(definition.ObjectID)// All registered objects must have a timestamp resource
6
12
  ;
7
13
  return instance.Resources[tsResourceId];
8
14
  };
15
+ /**
16
+ * Returns the timestamp of the instance as a Date object
17
+ */ export var instanceTsAsDate = function(instance) {
18
+ return new Date(instanceTs(instance) * 1000);
19
+ };
@@ -1,6 +1,6 @@
1
1
  import { describe, it } from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { instanceTs } from './instanceTs.js';
3
+ import { instanceTs, instanceTsAsDate } from './instanceTs.js';
4
4
  void describe('instanceTs()', function() {
5
5
  void it('should return the timestamp of the instance', function() {
6
6
  return assert.equal(instanceTs({
@@ -9,8 +9,21 @@ void describe('instanceTs()', function() {
9
9
  Resources: {
10
10
  '0': 3.5399999618530273,
11
11
  '1': 4.168000221252441,
12
- '99': 1708683500474
12
+ '99': 1708683500
13
13
  }
14
- }), 1708683500474);
14
+ }), 1708683500);
15
+ });
16
+ });
17
+ void describe('instanceTsAsDate()', function() {
18
+ void it('should return the timestamp of the instance', function() {
19
+ return assert.equal(instanceTsAsDate({
20
+ ObjectID: 14210,
21
+ ObjectVersion: '1.0',
22
+ Resources: {
23
+ '0': 3.5399999618530273,
24
+ '1': 4.168000221252441,
25
+ '99': 1708683500
26
+ }
27
+ }).getTime(), 1708683500 * 1000);
15
28
  });
16
29
  });
@@ -13,7 +13,7 @@ void describe('validate()', function() {
13
13
  '1': 6.151946,
14
14
  '6': 'Fixed',
15
15
  '3': 1,
16
- '99': 1710147413003
16
+ '99': 1710147413
17
17
  }
18
18
  };
19
19
  var maybeValid = v(object);
@@ -35,7 +35,7 @@ void describe('validate()', function() {
35
35
  '5': 24201,
36
36
  '6': '10.234.105.140',
37
37
  11: undefined,
38
- '99': 1716988087000
38
+ '99': 1716988087
39
39
  }
40
40
  };
41
41
  var maybeValid = v(object);
@@ -51,7 +51,7 @@ void describe('validate()', function() {
51
51
  'MODEM',
52
52
  'APP'
53
53
  ],
54
- '99': 1717409966000
54
+ '99': 1717409966
55
55
  }
56
56
  };
57
57
  var maybeValid = v(object);
@@ -159,7 +159,7 @@ export var NumberResource = function(r) {
159
159
  return typeof r === 'number';
160
160
  };
161
161
  export var TimeResource = function(r) {
162
- return NumberResource(r) && r > 1700000000000 && r < 9999999999999;
162
+ return NumberResource(r) && r > 1700000000 && r < 9999999999;
163
163
  };
164
164
  export var StringResource = function(r) {
165
165
  return typeof r === 'string';
@@ -9,7 +9,7 @@ void describe('SenMLType', function() {
9
9
  bn: '14201/0/',
10
10
  n: '0',
11
11
  v: 33.98755678796222,
12
- bt: 1698155694999
12
+ bt: 1698155694
13
13
  },
14
14
  {
15
15
  n: '1',
@@ -21,9 +21,10 @@ void describe('fromCBOR()', function() {
21
21
  '0': '10',
22
22
  '2': 57
23
23
  },
24
+ // Converts from BigInt as well
24
25
  {
25
26
  '0': '99',
26
- '2': 1716475294528n
27
+ '2': 1716475294n
27
28
  }
28
29
  ]), [
29
30
  {
@@ -43,10 +44,9 @@ void describe('fromCBOR()', function() {
43
44
  n: '10',
44
45
  v: 57
45
46
  },
46
- // Convert bigints
47
47
  {
48
48
  n: '99',
49
- v: 1716475294528
49
+ v: 1716475294
50
50
  }
51
51
  ]);
52
52
  });
@@ -60,7 +60,7 @@ void describe('hasValue() should determine whether an object has a value', funct
60
60
  bn: 14202,
61
61
  n: 0,
62
62
  v: 99,
63
- bt: 1699049685992
63
+ bt: 1699049685
64
64
  },
65
65
  true
66
66
  ],
@@ -12,7 +12,7 @@ void describe('lwm2mToSenML()', function() {
12
12
  '1': 6.151946,
13
13
  '6': 'Fixed',
14
14
  '3': 1,
15
- '99': 1710147413003
15
+ '99': 1710147413
16
16
  }
17
17
  };
18
18
  var level1 = {
@@ -21,7 +21,7 @@ void describe('lwm2mToSenML()', function() {
21
21
  Resources: {
22
22
  '0': 84.3,
23
23
  '1': 'AES',
24
- '99': 1710140400000
24
+ '99': 1710140400
25
25
  }
26
26
  };
27
27
  var level2 = {
@@ -30,7 +30,7 @@ void describe('lwm2mToSenML()', function() {
30
30
  Resources: {
31
31
  '0': 140.4,
32
32
  '1': 'AES',
33
- '99': 1710144000000
33
+ '99': 1710144000
34
34
  }
35
35
  };
36
36
  var level3 = {
@@ -40,7 +40,7 @@ void describe('lwm2mToSenML()', function() {
40
40
  Resources: {
41
41
  '0': 140.7,
42
42
  '1': 'AES',
43
- '99': 1710144001000
43
+ '99': 1710144001
44
44
  }
45
45
  };
46
46
  var lwm2m = [
@@ -54,7 +54,7 @@ void describe('lwm2mToSenML()', function() {
54
54
  bn: '14201/0/',
55
55
  n: '0',
56
56
  v: 62.469414,
57
- bt: 1710147413003
57
+ bt: 1710147413
58
58
  },
59
59
  {
60
60
  n: '1',
@@ -72,7 +72,7 @@ void describe('lwm2mToSenML()', function() {
72
72
  bn: '14230/0/',
73
73
  n: '0',
74
74
  v: 84.3,
75
- bt: 1710140400000
75
+ bt: 1710140400
76
76
  },
77
77
  {
78
78
  n: '1',
@@ -82,7 +82,7 @@ void describe('lwm2mToSenML()', function() {
82
82
  bn: '14230/0/',
83
83
  n: '0',
84
84
  v: 140.4,
85
- bt: 1710144000000
85
+ bt: 1710144000
86
86
  },
87
87
  {
88
88
  n: '1',
@@ -92,7 +92,7 @@ void describe('lwm2mToSenML()', function() {
92
92
  bn: '14230/1/',
93
93
  n: '0',
94
94
  v: 140.7,
95
- bt: 1710144001000
95
+ bt: 1710144001
96
96
  },
97
97
  {
98
98
  n: '1',
@@ -7,7 +7,7 @@ void describe('senMLtoLwM2M()', function() {
7
7
  {
8
8
  bn: '14201/1/',
9
9
  blv: '1.1',
10
- bt: 1698155694999,
10
+ bt: 1698155694,
11
11
  n: '0',
12
12
  v: 33.98755678796222
13
13
  },
@@ -44,7 +44,7 @@ void describe('senMLtoLwM2M()', function() {
44
44
  3: 17.74077033996582,
45
45
  4: 26.376304626464844,
46
46
  5: 359.1545715332,
47
- 99: 1698155694999
47
+ 99: 1698155694
48
48
  }
49
49
  }
50
50
  ];
@@ -57,7 +57,7 @@ void describe('senMLtoLwM2M()', function() {
57
57
  bn: '14203/0/',
58
58
  n: '0',
59
59
  vs: 'LTE-M',
60
- bt: 1676369307222
60
+ bt: 1676369307
61
61
  },
62
62
  {
63
63
  n: '1',
@@ -98,7 +98,7 @@ void describe('senMLtoLwM2M()', function() {
98
98
  4: 56879116,
99
99
  5: 24001,
100
100
  6: '10.160.243.113',
101
- 99: 1676369307222
101
+ 99: 1676369307
102
102
  }
103
103
  }
104
104
  ];
@@ -111,7 +111,7 @@ void describe('senMLtoLwM2M()', function() {
111
111
  bn: '14203/0/',
112
112
  n: '0',
113
113
  vs: 'LTE-M',
114
- bt: 1699049665511
114
+ bt: 1699049665
115
115
  },
116
116
  {
117
117
  n: '1',
@@ -121,7 +121,7 @@ void describe('senMLtoLwM2M()', function() {
121
121
  bn: '14203/0/',
122
122
  n: '2',
123
123
  v: -89,
124
- bt: 1699049665511
124
+ bt: 1699049665
125
125
  },
126
126
  {
127
127
  n: '3',
@@ -143,7 +143,7 @@ void describe('senMLtoLwM2M()', function() {
143
143
  bn: '14203/0/',
144
144
  n: '11',
145
145
  v: 7,
146
- bt: 1699049665511
146
+ bt: 1699049665
147
147
  }
148
148
  ];
149
149
  var expected = [
@@ -158,7 +158,7 @@ void describe('senMLtoLwM2M()', function() {
158
158
  5: 24202,
159
159
  6: '100.81.95.75',
160
160
  11: 7,
161
- 99: 1699049665511
161
+ 99: 1699049665
162
162
  }
163
163
  }
164
164
  ];
@@ -171,25 +171,25 @@ void describe('senMLtoLwM2M()', function() {
171
171
  bn: '14205/0/',
172
172
  n: '0',
173
173
  v: 21,
174
- bt: 1699049600000
174
+ bt: 1699049600
175
175
  },
176
176
  {
177
177
  bn: '14205/1/',
178
178
  n: '0',
179
179
  v: 31,
180
- bt: 1699049600000
180
+ bt: 1699049600
181
181
  },
182
182
  {
183
183
  bn: '14205/0/',
184
184
  n: '0',
185
185
  v: 22,
186
- bt: 1699049700000
186
+ bt: 1699049700
187
187
  },
188
188
  {
189
189
  bn: '14205/1/',
190
190
  n: '0',
191
191
  v: 32,
192
- bt: 1699049700000
192
+ bt: 1699049700
193
193
  }
194
194
  ];
195
195
  var expected = [
@@ -197,7 +197,7 @@ void describe('senMLtoLwM2M()', function() {
197
197
  ObjectID: 14205,
198
198
  Resources: {
199
199
  0: 21,
200
- 99: 1699049600000
200
+ 99: 1699049600
201
201
  }
202
202
  },
203
203
  {
@@ -205,14 +205,14 @@ void describe('senMLtoLwM2M()', function() {
205
205
  ObjectInstanceID: 1,
206
206
  Resources: {
207
207
  0: 31,
208
- 99: 1699049600000
208
+ 99: 1699049600
209
209
  }
210
210
  },
211
211
  {
212
212
  ObjectID: 14205,
213
213
  Resources: {
214
214
  0: 22,
215
- 99: 1699049700000
215
+ 99: 1699049700
216
216
  }
217
217
  },
218
218
  {
@@ -220,7 +220,7 @@ void describe('senMLtoLwM2M()', function() {
220
220
  ObjectInstanceID: 1,
221
221
  Resources: {
222
222
  0: 32,
223
- 99: 1699049700000
223
+ 99: 1699049700
224
224
  }
225
225
  }
226
226
  ];
@@ -9,7 +9,7 @@ void describe('validateSenML()', function() {
9
9
  blv: '1.1',
10
10
  n: '0',
11
11
  v: 99,
12
- bt: 1699049685992
12
+ bt: 1699049685
13
13
  },
14
14
  {
15
15
  n: '1',
@@ -1,6 +1,6 @@
1
1
  import { describe, it } from 'node:test'
2
2
  import assert from 'node:assert/strict'
3
- import { instanceTs } from './instanceTs.js'
3
+ import { instanceTs, instanceTsAsDate } from './instanceTs.js'
4
4
 
5
5
  void describe('instanceTs()', () => {
6
6
  void it('should return the timestamp of the instance', () =>
@@ -11,9 +11,25 @@ void describe('instanceTs()', () => {
11
11
  Resources: {
12
12
  '0': 3.5399999618530273,
13
13
  '1': 4.168000221252441,
14
- '99': 1708683500474,
14
+ '99': 1708683500,
15
15
  },
16
16
  }),
17
- 1708683500474,
17
+ 1708683500,
18
+ ))
19
+ })
20
+
21
+ void describe('instanceTsAsDate()', () => {
22
+ void it('should return the timestamp of the instance', () =>
23
+ assert.equal(
24
+ instanceTsAsDate({
25
+ ObjectID: 14210,
26
+ ObjectVersion: '1.0',
27
+ Resources: {
28
+ '0': 3.5399999618530273,
29
+ '1': 4.168000221252441,
30
+ '99': 1708683500,
31
+ },
32
+ }).getTime(),
33
+ 1708683500 * 1000,
18
34
  ))
19
35
  })
@@ -2,8 +2,21 @@ import type { LwM2MObjectInstance } from './LwM2MObjectInstance.js'
2
2
  import { definitions } from './definitions.js'
3
3
  import { timestampResources } from './timestampResources.js'
4
4
 
5
+ /**
6
+ * Returns the timestamp of the instance
7
+ *
8
+ * The timestamp is s signed integer representing
9
+ * the number of seconds since Jan 1, 1970 in the
10
+ * UTC time zone.
11
+ */
5
12
  export const instanceTs = (instance: LwM2MObjectInstance): number => {
6
13
  const definition = definitions[instance.ObjectID]
7
14
  const tsResourceId = timestampResources.get(definition.ObjectID) as number // All registered objects must have a timestamp resource
8
15
  return instance.Resources[tsResourceId] as number
9
16
  }
17
+
18
+ /**
19
+ * Returns the timestamp of the instance as a Date object
20
+ */
21
+ export const instanceTsAsDate = (instance: LwM2MObjectInstance): Date =>
22
+ new Date(instanceTs(instance) * 1000)
@@ -14,7 +14,7 @@ void describe('validate()', () => {
14
14
  '1': 6.151946,
15
15
  '6': 'Fixed',
16
16
  '3': 1,
17
- '99': 1710147413003,
17
+ '99': 1710147413,
18
18
  },
19
19
  }
20
20
  const maybeValid = v(object)
@@ -38,7 +38,7 @@ void describe('validate()', () => {
38
38
  '5': 24201,
39
39
  '6': '10.234.105.140',
40
40
  11: undefined,
41
- '99': 1716988087000,
41
+ '99': 1716988087,
42
42
  },
43
43
  }
44
44
  const maybeValid = v(object)
@@ -51,7 +51,7 @@ void describe('validate()', () => {
51
51
  ObjectVersion: '1.0',
52
52
  Resources: {
53
53
  '0': ['BOOT', 'MODEM', 'APP'],
54
- '99': 1717409966000,
54
+ '99': 1717409966,
55
55
  },
56
56
  }
57
57
  const maybeValid = v(object)
@@ -101,7 +101,7 @@ export const validateInstance =
101
101
 
102
102
  export const NumberResource = (r: unknown): r is number => typeof r === 'number'
103
103
  export const TimeResource = (r: unknown): r is number =>
104
- NumberResource(r) && r > 1700000000000 && r < 9999999999999
104
+ NumberResource(r) && r > 1700000000 && r < 9999999999
105
105
  export const StringResource = (r: unknown): r is string => typeof r === 'string'
106
106
  export const BooleanResource = (r: unknown): r is boolean =>
107
107
  typeof r === 'boolean'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hello.nrfcloud.com/proto-map",
3
- "version": "12.1.4",
3
+ "version": "13.0.0",
4
4
  "description": "Documents the communication protocol between devices, the hello.nrfcloud.com/map backend and web application",
5
5
  "type": "module",
6
6
  "exports": {
@@ -10,7 +10,7 @@ void describe('SenMLType', () => {
10
10
  bn: '14201/0/',
11
11
  n: '0',
12
12
  v: 33.98755678796222,
13
- bt: 1698155694999,
13
+ bt: 1698155694,
14
14
  },
15
15
  { n: '1', v: -84.506132079174634 },
16
16
  ]
@@ -10,15 +10,15 @@ void describe('fromCBOR()', () => {
10
10
  { '0': '1', '2': 17.66905 },
11
11
  { '0': '2', '2': 100562.21875 },
12
12
  { '0': '10', '2': 57 },
13
- { '0': '99', '2': 1716475294528n },
13
+ // Converts from BigInt as well
14
+ { '0': '99', '2': 1716475294n },
14
15
  ]),
15
16
  [
16
17
  { n: '0', v: 28.904369, bn: '14205/0/' },
17
18
  { n: '1', v: 17.66905 },
18
19
  { n: '2', v: 100562.21875 },
19
20
  { n: '10', v: 57 },
20
- // Convert bigints
21
- { n: '99', v: 1716475294528 },
21
+ { n: '99', v: 1716475294 },
22
22
  ],
23
23
  ))
24
24
  })
@@ -4,7 +4,7 @@ import { hasValue } from './hasValue.js'
4
4
 
5
5
  void describe('hasValue() should determine whether an object has a value', () => {
6
6
  for (const [record, expected] of [
7
- [{ bn: 14202, n: 0, v: 99, bt: 1699049685992 }, true],
7
+ [{ bn: 14202, n: 0, v: 99, bt: 1699049685 }, true],
8
8
  [{ n: 1, v: 4.179 }, true],
9
9
  [{ n: 2, v: 0 }, true],
10
10
  [{ n: 3, v: 25.7 }, true],
@@ -19,7 +19,7 @@ void describe('lwm2mToSenML()', () => {
19
19
  '1': 6.151946,
20
20
  '6': 'Fixed',
21
21
  '3': 1,
22
- '99': 1710147413003,
22
+ '99': 1710147413,
23
23
  },
24
24
  }
25
25
  const level1: LwM2MObjectInstance<SeaWaterLevel_14230> = {
@@ -28,7 +28,7 @@ void describe('lwm2mToSenML()', () => {
28
28
  Resources: {
29
29
  '0': 84.3,
30
30
  '1': 'AES',
31
- '99': 1710140400000,
31
+ '99': 1710140400,
32
32
  },
33
33
  }
34
34
  const level2: LwM2MObjectInstance<SeaWaterLevel_14230> = {
@@ -37,7 +37,7 @@ void describe('lwm2mToSenML()', () => {
37
37
  Resources: {
38
38
  '0': 140.4,
39
39
  '1': 'AES',
40
- '99': 1710144000000,
40
+ '99': 1710144000,
41
41
  },
42
42
  }
43
43
  const level3: LwM2MObjectInstance<SeaWaterLevel_14230> = {
@@ -47,7 +47,7 @@ void describe('lwm2mToSenML()', () => {
47
47
  Resources: {
48
48
  '0': 140.7,
49
49
  '1': 'AES',
50
- '99': 1710144001000,
50
+ '99': 1710144001,
51
51
  },
52
52
  }
53
53
  const lwm2m: Array<LwM2MObjectInstance<any>> = [
@@ -57,15 +57,15 @@ void describe('lwm2mToSenML()', () => {
57
57
  level3,
58
58
  ]
59
59
  const expected: SenMLType = [
60
- { bn: '14201/0/', n: '0', v: 62.469414, bt: 1710147413003 },
60
+ { bn: '14201/0/', n: '0', v: 62.469414, bt: 1710147413 },
61
61
  { n: '1', v: 6.151946 },
62
62
  { n: '3', v: 1 },
63
63
  { n: '6', vs: 'Fixed' },
64
- { bn: '14230/0/', n: '0', v: 84.3, bt: 1710140400000 },
64
+ { bn: '14230/0/', n: '0', v: 84.3, bt: 1710140400 },
65
65
  { n: '1', vs: 'AES' },
66
- { bn: '14230/0/', n: '0', v: 140.4, bt: 1710144000000 },
66
+ { bn: '14230/0/', n: '0', v: 140.4, bt: 1710144000 },
67
67
  { n: '1', vs: 'AES' },
68
- { bn: '14230/1/', n: '0', v: 140.7, bt: 1710144001000 },
68
+ { bn: '14230/1/', n: '0', v: 140.7, bt: 1710144001 },
69
69
  { n: '1', vs: 'AES' },
70
70
  ]
71
71
 
@@ -10,7 +10,7 @@ void describe('senMLtoLwM2M()', () => {
10
10
  {
11
11
  bn: '14201/1/',
12
12
  blv: '1.1',
13
- bt: 1698155694999,
13
+ bt: 1698155694,
14
14
  n: '0',
15
15
  v: 33.98755678796222,
16
16
  },
@@ -47,7 +47,7 @@ void describe('senMLtoLwM2M()', () => {
47
47
  3: 17.74077033996582,
48
48
  4: 26.376304626464844,
49
49
  5: 359.1545715332,
50
- 99: 1698155694999,
50
+ 99: 1698155694,
51
51
  },
52
52
  },
53
53
  ]
@@ -61,7 +61,7 @@ void describe('senMLtoLwM2M()', () => {
61
61
  bn: '14203/0/',
62
62
  n: '0',
63
63
  vs: 'LTE-M',
64
- bt: 1676369307222,
64
+ bt: 1676369307,
65
65
  },
66
66
  {
67
67
  n: '1',
@@ -102,7 +102,7 @@ void describe('senMLtoLwM2M()', () => {
102
102
  4: 56879116,
103
103
  5: 24001,
104
104
  6: '10.160.243.113',
105
- 99: 1676369307222,
105
+ 99: 1676369307,
106
106
  },
107
107
  },
108
108
  ]
@@ -112,14 +112,14 @@ void describe('senMLtoLwM2M()', () => {
112
112
 
113
113
  void it('should ignore repeated base properties', () => {
114
114
  const input: SenMLType = [
115
- { bn: '14203/0/', n: '0', vs: 'LTE-M', bt: 1699049665511 },
115
+ { bn: '14203/0/', n: '0', vs: 'LTE-M', bt: 1699049665 },
116
116
  { n: '1', v: 20 },
117
- { bn: '14203/0/', n: '2', v: -89, bt: 1699049665511 },
117
+ { bn: '14203/0/', n: '2', v: -89, bt: 1699049665 },
118
118
  { n: '3', v: 2305 },
119
119
  { n: '4', v: 34784790 },
120
120
  { n: '5', v: 24202 },
121
121
  { n: '6', vs: '100.81.95.75' },
122
- { bn: '14203/0/', n: '11', v: 7, bt: 1699049665511 },
122
+ { bn: '14203/0/', n: '11', v: 7, bt: 1699049665 },
123
123
  ]
124
124
  const expected: LwM2MObjectInstance[] = [
125
125
  {
@@ -133,7 +133,7 @@ void describe('senMLtoLwM2M()', () => {
133
133
  5: 24202,
134
134
  6: '100.81.95.75',
135
135
  11: 7,
136
- 99: 1699049665511,
136
+ 99: 1699049665,
137
137
  },
138
138
  },
139
139
  ]
@@ -143,17 +143,17 @@ void describe('senMLtoLwM2M()', () => {
143
143
 
144
144
  void it('should handle multiple measurements for the same resource', () => {
145
145
  const input: SenMLType = [
146
- { bn: '14205/0/', n: '0', v: 21, bt: 1699049600000 },
147
- { bn: '14205/1/', n: '0', v: 31, bt: 1699049600000 },
148
- { bn: '14205/0/', n: '0', v: 22, bt: 1699049700000 },
149
- { bn: '14205/1/', n: '0', v: 32, bt: 1699049700000 },
146
+ { bn: '14205/0/', n: '0', v: 21, bt: 1699049600 },
147
+ { bn: '14205/1/', n: '0', v: 31, bt: 1699049600 },
148
+ { bn: '14205/0/', n: '0', v: 22, bt: 1699049700 },
149
+ { bn: '14205/1/', n: '0', v: 32, bt: 1699049700 },
150
150
  ]
151
151
  const expected: LwM2MObjectInstance[] = [
152
152
  {
153
153
  ObjectID: 14205,
154
154
  Resources: {
155
155
  0: 21,
156
- 99: 1699049600000,
156
+ 99: 1699049600,
157
157
  },
158
158
  },
159
159
  {
@@ -161,14 +161,14 @@ void describe('senMLtoLwM2M()', () => {
161
161
  ObjectInstanceID: 1,
162
162
  Resources: {
163
163
  0: 31,
164
- 99: 1699049600000,
164
+ 99: 1699049600,
165
165
  },
166
166
  },
167
167
  {
168
168
  ObjectID: 14205,
169
169
  Resources: {
170
170
  0: 22,
171
- 99: 1699049700000,
171
+ 99: 1699049700,
172
172
  },
173
173
  },
174
174
  {
@@ -176,7 +176,7 @@ void describe('senMLtoLwM2M()', () => {
176
176
  ObjectInstanceID: 1,
177
177
  Resources: {
178
178
  0: 32,
179
- 99: 1699049700000,
179
+ 99: 1699049700,
180
180
  },
181
181
  },
182
182
  ]
@@ -6,7 +6,7 @@ import type { SenMLType } from './SenMLSchema.js'
6
6
  void describe('validateSenML()', () => {
7
7
  void it('should validate', () => {
8
8
  const senMl: SenMLType = [
9
- { bn: '14202/1/', blv: '1.1', n: '0', v: 99, bt: 1699049685992 },
9
+ { bn: '14202/1/', blv: '1.1', n: '0', v: 99, bt: 1699049685 },
10
10
  { n: '1', v: 4.179 },
11
11
  { n: '2', v: 0 },
12
12
  { n: '3', v: 25.7 },