jooby-codec 1.6.0 → 1.8.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/dist/Command.d.ts +1 -0
- package/dist/Command.js +3 -2
- package/dist/Command.js.map +1 -1
- package/dist/CommandBinaryBuffer.d.ts +190 -32
- package/dist/CommandBinaryBuffer.js +301 -2
- package/dist/CommandBinaryBuffer.js.map +1 -1
- package/dist/commands/downlink/CorrectTime2000.d.ts +1 -6
- package/dist/commands/downlink/CorrectTime2000.js +2 -8
- package/dist/commands/downlink/CorrectTime2000.js.map +1 -1
- package/dist/commands/downlink/ExAbsArchiveDaysMC.d.ts +5 -10
- package/dist/commands/downlink/ExAbsArchiveDaysMC.js +3 -9
- package/dist/commands/downlink/ExAbsArchiveDaysMC.js.map +1 -1
- package/dist/commands/downlink/ExAbsArchiveHoursMC.d.ts +5 -10
- package/dist/commands/downlink/ExAbsArchiveHoursMC.js +3 -9
- package/dist/commands/downlink/ExAbsArchiveHoursMC.js.map +1 -1
- package/dist/commands/downlink/ExAbsCurrentMC.d.ts +1 -6
- package/dist/commands/downlink/ExAbsCurrentMC.js +3 -8
- package/dist/commands/downlink/ExAbsCurrentMC.js.map +1 -1
- package/dist/commands/downlink/GetArchiveDaysMC.d.ts +5 -5
- package/dist/commands/downlink/GetArchiveDaysMC.js +3 -4
- package/dist/commands/downlink/GetArchiveDaysMC.js.map +1 -1
- package/dist/commands/downlink/GetArchiveEvents.d.ts +39 -0
- package/dist/commands/downlink/GetArchiveEvents.js +58 -0
- package/dist/commands/downlink/GetArchiveEvents.js.map +1 -0
- package/dist/commands/downlink/GetArchiveHoursMC.d.ts +5 -10
- package/dist/commands/downlink/GetArchiveHoursMC.js +3 -9
- package/dist/commands/downlink/GetArchiveHoursMC.js.map +1 -1
- package/dist/commands/downlink/GetCurrentMC.d.ts +1 -1
- package/dist/commands/downlink/GetCurrentMC.js +3 -3
- package/dist/commands/downlink/GetCurrentMC.js.map +1 -1
- package/dist/commands/downlink/GetLmicVersion.d.ts +25 -0
- package/dist/commands/downlink/GetLmicVersion.js +41 -0
- package/dist/commands/downlink/GetLmicVersion.js.map +1 -0
- package/dist/commands/downlink/GetParameter.d.ts +37 -0
- package/dist/commands/downlink/GetParameter.js +64 -0
- package/dist/commands/downlink/GetParameter.js.map +1 -0
- package/dist/commands/downlink/GetStatus.d.ts +26 -0
- package/dist/commands/downlink/GetStatus.js +45 -0
- package/dist/commands/downlink/GetStatus.js.map +1 -0
- package/dist/commands/downlink/SetParameter.d.ts +6 -56
- package/dist/commands/downlink/SetParameter.js +45 -105
- package/dist/commands/downlink/SetParameter.js.map +1 -1
- package/dist/commands/downlink/SetTime2000.d.ts +1 -6
- package/dist/commands/downlink/SetTime2000.js +2 -8
- package/dist/commands/downlink/SetTime2000.js.map +1 -1
- package/dist/commands/downlink/SoftRestart.d.ts +1 -1
- package/dist/commands/downlink/SoftRestart.js +3 -3
- package/dist/commands/downlink/SoftRestart.js.map +1 -1
- package/dist/commands/downlink/index.d.ts +4 -1
- package/dist/commands/downlink/index.js +4 -1
- package/dist/commands/downlink/index.js.map +1 -1
- package/dist/commands/uplink/CorrectTime2000.d.ts +1 -1
- package/dist/commands/uplink/CorrectTime2000.js +3 -3
- package/dist/commands/uplink/CorrectTime2000.js.map +1 -1
- package/dist/commands/uplink/DataDayMC.d.ts +3 -5
- package/dist/commands/uplink/DataDayMC.js +4 -3
- package/dist/commands/uplink/DataDayMC.js.map +1 -1
- package/dist/commands/uplink/DataHourMC.d.ts +3 -2
- package/dist/commands/uplink/DataHourMC.js +4 -3
- package/dist/commands/uplink/DataHourMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsArchiveDaysMC.d.ts +3 -2
- package/dist/commands/uplink/ExAbsArchiveDaysMC.js +4 -3
- package/dist/commands/uplink/ExAbsArchiveDaysMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsArchiveHoursMC.d.ts +3 -2
- package/dist/commands/uplink/ExAbsArchiveHoursMC.js +4 -3
- package/dist/commands/uplink/ExAbsArchiveHoursMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsCurrentMC.d.ts +1 -1
- package/dist/commands/uplink/ExAbsCurrentMC.js +4 -3
- package/dist/commands/uplink/ExAbsCurrentMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsDayMC.d.ts +3 -2
- package/dist/commands/uplink/ExAbsDayMC.js +4 -3
- package/dist/commands/uplink/ExAbsDayMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsHourMC.d.ts +3 -2
- package/dist/commands/uplink/ExAbsHourMC.js +4 -3
- package/dist/commands/uplink/ExAbsHourMC.js.map +1 -1
- package/dist/commands/uplink/GetArchiveDaysMC.d.ts +3 -2
- package/dist/commands/uplink/GetArchiveDaysMC.js +4 -3
- package/dist/commands/uplink/GetArchiveDaysMC.js.map +1 -1
- package/dist/commands/uplink/GetArchiveEvents.d.ts +48 -0
- package/dist/commands/uplink/GetArchiveEvents.js +105 -0
- package/dist/commands/uplink/GetArchiveEvents.js.map +1 -0
- package/dist/commands/uplink/GetArchiveHoursMC.d.ts +3 -2
- package/dist/commands/uplink/GetArchiveHoursMC.js +4 -3
- package/dist/commands/uplink/GetArchiveHoursMC.js.map +1 -1
- package/dist/commands/uplink/GetCurrentMC.d.ts +1 -1
- package/dist/commands/uplink/GetCurrentMC.js +4 -3
- package/dist/commands/uplink/GetCurrentMC.js.map +1 -1
- package/dist/commands/uplink/GetLmicVersion.d.ts +46 -0
- package/dist/commands/uplink/GetLmicVersion.js +90 -0
- package/dist/commands/uplink/GetLmicVersion.js.map +1 -0
- package/dist/commands/uplink/GetParameter.d.ts +30 -0
- package/dist/commands/uplink/GetParameter.js +91 -0
- package/dist/commands/uplink/GetParameter.js.map +1 -0
- package/dist/commands/uplink/GetStatus.d.ts +57 -0
- package/dist/commands/uplink/{NewStatus.js → GetStatus.js} +56 -37
- package/dist/commands/uplink/GetStatus.js.map +1 -0
- package/dist/commands/uplink/LastEvent.d.ts +5 -76
- package/dist/commands/uplink/LastEvent.js +67 -115
- package/dist/commands/uplink/LastEvent.js.map +1 -1
- package/dist/commands/uplink/NewEvent.d.ts +35 -7
- package/dist/commands/uplink/NewEvent.js +96 -20
- package/dist/commands/uplink/NewEvent.js.map +1 -1
- package/dist/commands/uplink/SetTime2000.d.ts +1 -1
- package/dist/commands/uplink/SetTime2000.js +3 -3
- package/dist/commands/uplink/SetTime2000.js.map +1 -1
- package/dist/commands/uplink/SoftRestart.d.ts +1 -1
- package/dist/commands/uplink/SoftRestart.js +3 -3
- package/dist/commands/uplink/SoftRestart.js.map +1 -1
- package/dist/commands/uplink/Time2000.d.ts +5 -5
- package/dist/commands/uplink/Time2000.js +6 -7
- package/dist/commands/uplink/Time2000.js.map +1 -1
- package/dist/commands/uplink/index.d.ts +5 -2
- package/dist/commands/uplink/index.js +5 -2
- package/dist/commands/uplink/index.js.map +1 -1
- package/dist/constants/deviceParameters.d.ts +12 -12
- package/dist/constants/deviceParameters.js +12 -12
- package/dist/constants/deviceParameters.js.map +1 -1
- package/dist/constants/{directionTypes.js → directions.js} +1 -1
- package/dist/constants/directions.js.map +1 -0
- package/dist/constants/events.d.ts +30 -4
- package/dist/constants/events.js +30 -4
- package/dist/constants/events.js.map +1 -1
- package/dist/constants/hardwareTypes.d.ts +2 -2
- package/dist/constants/hardwareTypes.js +2 -2
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/utils/message.js +2 -2
- package/dist/utils/message.js.map +1 -1
- package/dist/utils/time.d.ts +20 -3
- package/dist/utils/time.js +2 -2
- package/dist/utils/time.js.map +1 -1
- package/package.json +2 -1
- package/readme.md +33 -16
- package/dist/commands/downlink/NewStatus.d.ts +0 -25
- package/dist/commands/downlink/NewStatus.js +0 -37
- package/dist/commands/downlink/NewStatus.js.map +0 -1
- package/dist/commands/uplink/NewStatus.d.ts +0 -56
- package/dist/commands/uplink/NewStatus.js.map +0 -1
- package/dist/constants/directionTypes.js.map +0 -1
- package/dist/constants/general.d.ts +0 -1
- package/dist/constants/general.js +0 -2
- package/dist/constants/general.js.map +0 -1
- package/dist/utils/getBitArrayFromNumber.d.ts +0 -14
- package/dist/utils/getBitArrayFromNumber.js +0 -15
- package/dist/utils/getBitArrayFromNumber.js.map +0 -1
- package/dist/utils/getIntFromBitString.d.ts +0 -6
- package/dist/utils/getIntFromBitString.js +0 -6
- package/dist/utils/getIntFromBitString.js.map +0 -1
- /package/dist/constants/{directionTypes.d.ts → directions.d.ts} +0 -0
|
@@ -3,12 +3,86 @@ import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
|
3
3
|
import getHexFromBytes from '../../utils/getHexFromBytes.js';
|
|
4
4
|
import getBytesFromHex from '../../utils/getBytesFromHex.js';
|
|
5
5
|
import * as events from '../../constants/events.js';
|
|
6
|
-
import { UPLINK } from '../../constants/
|
|
6
|
+
import { UPLINK } from '../../constants/directions.js';
|
|
7
|
+
import * as hardwareTypes from '../../constants/hardwareTypes.js';
|
|
7
8
|
const COMMAND_ID = 0x15;
|
|
8
|
-
const COMMAND_TITLE = 'NEW_EVENT';
|
|
9
9
|
// ACTIVATE_MTX are biggest,1 byte event id, 1 byte sequence number, 4 bytes time, 8 bytes mtx address
|
|
10
10
|
const COMMAND_BODY_MAX_SIZE = 14;
|
|
11
11
|
const MTX_ADDRESS_SIZE = 8;
|
|
12
|
+
const examples = [
|
|
13
|
+
{
|
|
14
|
+
name: 'event for MAGNET_ON',
|
|
15
|
+
parameters: {
|
|
16
|
+
id: events.MAGNET_ON,
|
|
17
|
+
sequenceNumber: 2,
|
|
18
|
+
data: { time: 734015840 }
|
|
19
|
+
},
|
|
20
|
+
hex: { header: '15 06', body: '01 02 2b c0 31 60' }
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'event for BATTERY_ALARM',
|
|
24
|
+
parameters: {
|
|
25
|
+
id: events.BATTERY_ALARM,
|
|
26
|
+
sequenceNumber: 2,
|
|
27
|
+
data: { voltage: 3308 }
|
|
28
|
+
},
|
|
29
|
+
hex: { header: '15 04', body: '05 02 0c ec' }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'event for ACTIVATE_MTX',
|
|
33
|
+
parameters: {
|
|
34
|
+
id: events.ACTIVATE_MTX,
|
|
35
|
+
sequenceNumber: 2,
|
|
36
|
+
data: { time: 734015840, deviceId: '00 1a 79 88 17 01 23 56' }
|
|
37
|
+
},
|
|
38
|
+
hex: { header: '15 0e', body: '0b 02 2b c0 31 60 00 1a 79 88 17 01 23 56' }
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'event for CONNECT',
|
|
42
|
+
parameters: {
|
|
43
|
+
id: events.CONNECT,
|
|
44
|
+
sequenceNumber: 2,
|
|
45
|
+
data: { channel: 0, value: 131 }
|
|
46
|
+
},
|
|
47
|
+
hex: { header: '15 05', body: '0c 02 00 83 01' }
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'event for DISCONNECT',
|
|
51
|
+
parameters: {
|
|
52
|
+
id: events.DISCONNECT,
|
|
53
|
+
sequenceNumber: 2,
|
|
54
|
+
data: { channel: 0, value: 131 }
|
|
55
|
+
},
|
|
56
|
+
hex: { header: '15 05', body: '0d 02 00 83 01' }
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'event for EV_MTX',
|
|
60
|
+
parameters: {
|
|
61
|
+
id: events.MTX,
|
|
62
|
+
sequenceNumber: 2,
|
|
63
|
+
data: {
|
|
64
|
+
status: {
|
|
65
|
+
// first byte: 10000011 = 83 (131)
|
|
66
|
+
isMeterCaseOpen: true,
|
|
67
|
+
isMagneticInfluence: true,
|
|
68
|
+
isParametersSetRemotely: false,
|
|
69
|
+
isParametersSetLocally: false,
|
|
70
|
+
isMeterProgramRestarted: false,
|
|
71
|
+
isLockedOut: false,
|
|
72
|
+
isTimeSet: false,
|
|
73
|
+
isTimeCorrected: true,
|
|
74
|
+
// second byte: 00001010 = 0a (10)
|
|
75
|
+
isMeterFailure: false,
|
|
76
|
+
isMeterTerminalBoxOpen: true,
|
|
77
|
+
isModuleCompartmentOpen: false,
|
|
78
|
+
isTariffPlanChanged: true,
|
|
79
|
+
isNewTariffPlanReceived: false
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
hex: { header: '15 04', body: '11 02 83 0a' }
|
|
84
|
+
}
|
|
85
|
+
];
|
|
12
86
|
const getVoltage = (buffer) => buffer.getUint16(false);
|
|
13
87
|
const setVoltage = (buffer, value) => buffer.setUint16(value, false);
|
|
14
88
|
const getDeviceId = (buffer) => {
|
|
@@ -30,8 +104,8 @@ const setDeviceId = (buffer, value) => {
|
|
|
30
104
|
* import {constants} from 'jooby-codec'
|
|
31
105
|
* import NewEvent from 'jooby-codec/commands/uplink/NewEvent';
|
|
32
106
|
*
|
|
33
|
-
* // `
|
|
34
|
-
* const parameters = {id: constants.events.MAGNET_ON, sequenceNumber: 3, data: {
|
|
107
|
+
* // `MAGNET_ON` event at 2023-04-05 13:17:20 GMT
|
|
108
|
+
* const parameters = {id: constants.events.MAGNET_ON, sequenceNumber: 3, data: {time: 734015840}};
|
|
35
109
|
* const command = new NewEvent(parameters);
|
|
36
110
|
*
|
|
37
111
|
* // output command binary in hex representation
|
|
@@ -46,6 +120,7 @@ class NewEvent extends Command {
|
|
|
46
120
|
super();
|
|
47
121
|
this.parameters = parameters;
|
|
48
122
|
}
|
|
123
|
+
// data - only body (without header)
|
|
49
124
|
static fromBytes(data) {
|
|
50
125
|
const buffer = new CommandBinaryBuffer(data);
|
|
51
126
|
const id = buffer.getUint8();
|
|
@@ -60,29 +135,30 @@ class NewEvent extends Command {
|
|
|
60
135
|
case events.INSERT:
|
|
61
136
|
case events.REMOVE:
|
|
62
137
|
case events.COUNTER_OVER:
|
|
63
|
-
case events.
|
|
64
|
-
case events.
|
|
65
|
-
case events.
|
|
66
|
-
eventData = {
|
|
138
|
+
case events.OPTOLOW:
|
|
139
|
+
case events.OPTOFLASH:
|
|
140
|
+
case events.JOIN_ACCEPT:
|
|
141
|
+
eventData = { time: buffer.getTime() };
|
|
67
142
|
break;
|
|
68
143
|
case events.BATTERY_ALARM:
|
|
69
144
|
eventData = { voltage: getVoltage(buffer) };
|
|
70
145
|
break;
|
|
71
146
|
case events.ACTIVATE_MTX:
|
|
72
|
-
eventData = {
|
|
147
|
+
eventData = { time: buffer.getTime(), deviceId: getDeviceId(buffer) };
|
|
73
148
|
break;
|
|
74
149
|
case events.CONNECT:
|
|
75
150
|
case events.DISCONNECT:
|
|
76
151
|
eventData = { channel: buffer.getUint8(), value: buffer.getExtendedValue() };
|
|
77
152
|
break;
|
|
78
|
-
case events.
|
|
79
|
-
eventData = {
|
|
153
|
+
case events.MTX:
|
|
154
|
+
eventData = { status: buffer.getEventStatus(hardwareTypes.MTXLORA) };
|
|
80
155
|
break;
|
|
81
156
|
default:
|
|
82
157
|
throw new Error(`${this.getId()}: event ${id} is not supported`);
|
|
83
158
|
}
|
|
84
159
|
return new NewEvent({ id, sequenceNumber, data: eventData });
|
|
85
160
|
}
|
|
161
|
+
// returns full message - header with body
|
|
86
162
|
toBytes() {
|
|
87
163
|
const { id, sequenceNumber, data } = this.parameters;
|
|
88
164
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
@@ -98,11 +174,11 @@ class NewEvent extends Command {
|
|
|
98
174
|
case events.INSERT:
|
|
99
175
|
case events.REMOVE:
|
|
100
176
|
case events.COUNTER_OVER:
|
|
101
|
-
case events.
|
|
102
|
-
case events.
|
|
103
|
-
case events.
|
|
177
|
+
case events.OPTOLOW:
|
|
178
|
+
case events.OPTOFLASH:
|
|
179
|
+
case events.JOIN_ACCEPT:
|
|
104
180
|
eventData = data;
|
|
105
|
-
buffer.setTime(eventData.
|
|
181
|
+
buffer.setTime(eventData.time);
|
|
106
182
|
break;
|
|
107
183
|
case events.BATTERY_ALARM:
|
|
108
184
|
eventData = data;
|
|
@@ -110,7 +186,7 @@ class NewEvent extends Command {
|
|
|
110
186
|
break;
|
|
111
187
|
case events.ACTIVATE_MTX:
|
|
112
188
|
eventData = data;
|
|
113
|
-
buffer.setTime(eventData.
|
|
189
|
+
buffer.setTime(eventData.time);
|
|
114
190
|
setDeviceId(buffer, eventData.deviceId);
|
|
115
191
|
break;
|
|
116
192
|
case events.CONNECT:
|
|
@@ -119,10 +195,9 @@ class NewEvent extends Command {
|
|
|
119
195
|
buffer.setUint8(eventData.channel);
|
|
120
196
|
buffer.setExtendedValue(eventData.value);
|
|
121
197
|
break;
|
|
122
|
-
case events.
|
|
198
|
+
case events.MTX:
|
|
123
199
|
eventData = data;
|
|
124
|
-
buffer.
|
|
125
|
-
buffer.setUint8(eventData.status2);
|
|
200
|
+
buffer.setEventStatus(hardwareTypes.MTXLORA, eventData.status);
|
|
126
201
|
break;
|
|
127
202
|
default:
|
|
128
203
|
throw new Error(`${NewEvent.getId()}: event ${id} is not supported`);
|
|
@@ -132,6 +207,7 @@ class NewEvent extends Command {
|
|
|
132
207
|
}
|
|
133
208
|
NewEvent.id = COMMAND_ID;
|
|
134
209
|
NewEvent.directionType = UPLINK;
|
|
135
|
-
NewEvent.
|
|
210
|
+
NewEvent.examples = examples;
|
|
211
|
+
NewEvent.hasParameters = true;
|
|
136
212
|
export default NewEvent;
|
|
137
213
|
//# sourceMappingURL=NewEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewEvent.js","sourceRoot":"","sources":["../../../src/commands/uplink/NewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NewEvent.js","sourceRoot":"","sources":["../../../src/commands/uplink/NewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAsC,MAAM,8BAA8B,CAAC;AAClF,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAC7D,OAAO,eAAe,MAAM,gCAAgC,CAAC;A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K,MAAM,CAAC,GAAG;gBACX,SAAS,GAAG,IAAiB,CAAC;gBAC9B,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/D,MAAM;YAEV;gBACI,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;SAC5E;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA5Ge,WAAE,GAAG,UAAU,CAAC;AAEhB,sBAAa,GAAG,MAAM,CAAC;AAEvB,iBAAQ,GAAG,QAAQ,CAAC;AAEpB,sBAAa,GAAG,IAAI,CAAC;AA0GzC,eAAe,QAAQ,CAAC"}
|
|
@@ -30,7 +30,7 @@ declare class SetTime2000 extends Command {
|
|
|
30
30
|
constructor(parameters: IUplinkSetTime2000Parameters);
|
|
31
31
|
static readonly id = 2;
|
|
32
32
|
static readonly directionType = 2;
|
|
33
|
-
static readonly
|
|
33
|
+
static readonly hasParameters = true;
|
|
34
34
|
static fromBytes(data: Uint8Array): SetTime2000;
|
|
35
35
|
toBytes(): Uint8Array;
|
|
36
36
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
2
|
import BinaryBuffer from '../../BinaryBuffer.js';
|
|
3
|
-
import { UPLINK } from '../../constants/
|
|
3
|
+
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x02;
|
|
5
|
-
const COMMAND_TITLE = 'SET_TIME_2000';
|
|
6
5
|
const COMMAND_BODY_SIZE = 1;
|
|
7
6
|
/**
|
|
8
7
|
* Uplink command.
|
|
@@ -40,6 +39,7 @@ class SetTime2000 extends Command {
|
|
|
40
39
|
}
|
|
41
40
|
return new SetTime2000(parameters);
|
|
42
41
|
}
|
|
42
|
+
// returns full message - header with body
|
|
43
43
|
toBytes() {
|
|
44
44
|
const { status } = this.parameters;
|
|
45
45
|
const buffer = new BinaryBuffer(COMMAND_BODY_SIZE, false);
|
|
@@ -49,6 +49,6 @@ class SetTime2000 extends Command {
|
|
|
49
49
|
}
|
|
50
50
|
SetTime2000.id = COMMAND_ID;
|
|
51
51
|
SetTime2000.directionType = UPLINK;
|
|
52
|
-
SetTime2000.
|
|
52
|
+
SetTime2000.hasParameters = true;
|
|
53
53
|
export default SetTime2000;
|
|
54
54
|
//# sourceMappingURL=SetTime2000.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetTime2000.js","sourceRoot":"","sources":["../../../src/commands/uplink/SetTime2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"SetTime2000.js","sourceRoot":"","sources":["../../../src/commands/uplink/SetTime2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAcrD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAG5B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAY,SAAQ,OAAO;IAC7B,YAAqB,UAAwC;QACzD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA8B;IAE7D,CAAC;IAUD,oCAAoC;IACpC,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,IAAK,IAAI,CAAC,UAAU,KAAK,iBAAiB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,wBAAwB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SAChF;QAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE7C,MAAM,UAAU,GAAG;YACf,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC5B,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;SACpE;QAED,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAExB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAlCe,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,MAAM,CAAC;AAEvB,yBAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,WAAW,CAAC"}
|
|
@@ -17,7 +17,7 @@ import Command from '../../Command.js';
|
|
|
17
17
|
declare class SoftRestart extends Command {
|
|
18
18
|
static readonly id = 25;
|
|
19
19
|
static readonly directionType = 2;
|
|
20
|
-
static readonly
|
|
20
|
+
static readonly hasParameters = false;
|
|
21
21
|
static fromBytes(): SoftRestart;
|
|
22
22
|
toBytes(): Uint8Array;
|
|
23
23
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import { UPLINK } from '../../constants/
|
|
2
|
+
import { UPLINK } from '../../constants/directions.js';
|
|
3
3
|
const COMMAND_ID = 0x19;
|
|
4
|
-
const COMMAND_TITLE = 'SOFT_RESTART';
|
|
5
4
|
/**
|
|
6
5
|
* Uplink command.
|
|
7
6
|
*
|
|
@@ -22,6 +21,7 @@ class SoftRestart extends Command {
|
|
|
22
21
|
static fromBytes() {
|
|
23
22
|
return new SoftRestart();
|
|
24
23
|
}
|
|
24
|
+
// returns full message - header with body
|
|
25
25
|
// eslint-disable-next-line class-methods-use-this
|
|
26
26
|
toBytes() {
|
|
27
27
|
return Command.toBytes(COMMAND_ID);
|
|
@@ -29,6 +29,6 @@ class SoftRestart extends Command {
|
|
|
29
29
|
}
|
|
30
30
|
SoftRestart.id = COMMAND_ID;
|
|
31
31
|
SoftRestart.directionType = UPLINK;
|
|
32
|
-
SoftRestart.
|
|
32
|
+
SoftRestart.hasParameters = false;
|
|
33
33
|
export default SoftRestart;
|
|
34
34
|
//# sourceMappingURL=SoftRestart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SoftRestart.js","sourceRoot":"","sources":["../../../src/commands/uplink/SoftRestart.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"SoftRestart.js","sourceRoot":"","sources":["../../../src/commands/uplink/SoftRestart.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAGrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAGxB;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAY,SAAQ,OAAO;IAQ7B,oCAAoC;IACpC,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,WAAW,EAAE,CAAC;IAC7B,CAAC;IAED,0CAA0C;IAC1C,kDAAkD;IAClD,OAAO;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;AAhBe,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,MAAM,CAAC;AAEvB,yBAAa,GAAG,KAAK,CAAC;AAgB1C,eAAe,WAAW,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
+
import { TTime2000 } from '../../utils/time.js';
|
|
2
3
|
/**
|
|
3
4
|
* Time2000 command parameters
|
|
4
5
|
*
|
|
5
6
|
* @example
|
|
6
7
|
* // time: 2023-04-03T14:01:17.000Z
|
|
7
|
-
* {sequenceNumber: 77,
|
|
8
|
+
* {sequenceNumber: 77, time: 733845677}
|
|
8
9
|
*/
|
|
9
10
|
interface ITime2000Parameters {
|
|
10
11
|
/** unique time manipulation operation number */
|
|
11
12
|
sequenceNumber: number;
|
|
12
|
-
|
|
13
|
-
seconds: number;
|
|
13
|
+
time: TTime2000;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Uplink command.
|
|
@@ -20,7 +20,7 @@ interface ITime2000Parameters {
|
|
|
20
20
|
* import Time2000 from 'jooby-codec/commands/uplink/Time2000';
|
|
21
21
|
*
|
|
22
22
|
* // time: 2023-04-03T14:01:17.000Z
|
|
23
|
-
* const parameters = {sequenceNumber: 77,
|
|
23
|
+
* const parameters = {sequenceNumber: 77, time: 733845677};
|
|
24
24
|
* const command = new Time2000(parameters);
|
|
25
25
|
*
|
|
26
26
|
* // output command binary in hex representation
|
|
@@ -34,7 +34,7 @@ declare class Time2000 extends Command {
|
|
|
34
34
|
constructor(parameters: ITime2000Parameters);
|
|
35
35
|
static readonly id = 9;
|
|
36
36
|
static readonly directionType = 2;
|
|
37
|
-
static readonly
|
|
37
|
+
static readonly hasParameters = true;
|
|
38
38
|
static fromBytes(data: Uint8Array): Time2000;
|
|
39
39
|
toBytes(): Uint8Array;
|
|
40
40
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
2
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
3
|
-
import { UPLINK } from '../../constants/
|
|
3
|
+
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x09;
|
|
5
|
-
const COMMAND_TITLE = 'TIME_2000';
|
|
6
5
|
const COMMAND_BODY_SIZE = 5;
|
|
7
6
|
/**
|
|
8
7
|
* Uplink command.
|
|
@@ -12,7 +11,7 @@ const COMMAND_BODY_SIZE = 5;
|
|
|
12
11
|
* import Time2000 from 'jooby-codec/commands/uplink/Time2000';
|
|
13
12
|
*
|
|
14
13
|
* // time: 2023-04-03T14:01:17.000Z
|
|
15
|
-
* const parameters = {sequenceNumber: 77,
|
|
14
|
+
* const parameters = {sequenceNumber: 77, time: 733845677};
|
|
16
15
|
* const command = new Time2000(parameters);
|
|
17
16
|
*
|
|
18
17
|
* // output command binary in hex representation
|
|
@@ -34,7 +33,7 @@ class Time2000 extends Command {
|
|
|
34
33
|
const buffer = new CommandBinaryBuffer(data);
|
|
35
34
|
const parameters = {
|
|
36
35
|
sequenceNumber: buffer.getUint8(),
|
|
37
|
-
|
|
36
|
+
time: buffer.getTime()
|
|
38
37
|
};
|
|
39
38
|
if (!buffer.isEmpty) {
|
|
40
39
|
throw new Error(`${this.getName()}. BinaryBuffer is not empty.`);
|
|
@@ -43,15 +42,15 @@ class Time2000 extends Command {
|
|
|
43
42
|
}
|
|
44
43
|
// returns full message - header with body
|
|
45
44
|
toBytes() {
|
|
46
|
-
const { sequenceNumber,
|
|
45
|
+
const { sequenceNumber, time } = this.parameters;
|
|
47
46
|
const buffer = new CommandBinaryBuffer(COMMAND_BODY_SIZE);
|
|
48
47
|
buffer.setUint8(sequenceNumber);
|
|
49
|
-
buffer.setTime(
|
|
48
|
+
buffer.setTime(time);
|
|
50
49
|
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
Time2000.id = COMMAND_ID;
|
|
54
53
|
Time2000.directionType = UPLINK;
|
|
55
|
-
Time2000.
|
|
54
|
+
Time2000.hasParameters = true;
|
|
56
55
|
export default Time2000;
|
|
57
56
|
//# sourceMappingURL=Time2000.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time2000.js","sourceRoot":"","sources":["../../../src/commands/uplink/Time2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Time2000.js","sourceRoot":"","sources":["../../../src/commands/uplink/Time2000.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAkBrD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAG5B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,QAAS,SAAQ,OAAO;IAC1B,YAAqB,UAA+B;QAChD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAqB;IAEpD,CAAC;IAUD,oCAAoC;IACpC,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,IAAK,IAAI,CAAC,UAAU,KAAK,iBAAiB,EAAG;YACzC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,wBAAwB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;SAChF;QAED,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG;YACf,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE;YACjC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;SACzB,CAAC;QAEF,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;SACpE;QAED,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,EAAC,cAAc,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAErB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAnCe,WAAE,GAAG,UAAU,CAAC;AAEhB,sBAAa,GAAG,MAAM,CAAC;AAEvB,sBAAa,GAAG,IAAI,CAAC;AAmCzC,eAAe,QAAQ,CAAC"}
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
export { default as CorrectTime2000 } from './CorrectTime2000.js';
|
|
7
7
|
export { default as DataDayMC } from './DataDayMC.js';
|
|
8
8
|
export { default as DataHourMC } from './DataHourMC.js';
|
|
9
|
-
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
10
9
|
export { default as ExAbsArchiveDaysMC } from './ExAbsArchiveDaysMC.js';
|
|
11
10
|
export { default as ExAbsArchiveHoursMC } from './ExAbsArchiveHoursMC.js';
|
|
11
|
+
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
12
12
|
export { default as ExAbsDayMC } from './ExAbsDayMC.js';
|
|
13
13
|
export { default as ExAbsHourMC } from './ExAbsHourMC.js';
|
|
14
14
|
export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
|
|
15
|
+
export { default as GetArchiveEvents } from './GetArchiveEvents.js';
|
|
15
16
|
export { default as GetArchiveHoursMC } from './GetArchiveHoursMC.js';
|
|
16
17
|
export { default as GetCurrentMC } from './GetCurrentMC.js';
|
|
18
|
+
export { default as GetLmicVersion } from './GetLmicVersion.js';
|
|
19
|
+
export { default as GetParameter } from './GetParameter.js';
|
|
20
|
+
export { default as GetStatus } from './GetStatus.js';
|
|
17
21
|
export { default as LastEvent } from './LastEvent.js';
|
|
18
22
|
export { default as NewEvent } from './NewEvent.js';
|
|
19
|
-
export { default as NewStatus } from './NewStatus.js';
|
|
20
23
|
export { default as SetTime2000 } from './SetTime2000.js';
|
|
21
24
|
export { default as SoftRestart } from './SoftRestart.js';
|
|
22
25
|
export { default as Time2000 } from './Time2000.js';
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
export { default as CorrectTime2000 } from './CorrectTime2000.js';
|
|
7
7
|
export { default as DataDayMC } from './DataDayMC.js';
|
|
8
8
|
export { default as DataHourMC } from './DataHourMC.js';
|
|
9
|
-
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
10
9
|
export { default as ExAbsArchiveDaysMC } from './ExAbsArchiveDaysMC.js';
|
|
11
10
|
export { default as ExAbsArchiveHoursMC } from './ExAbsArchiveHoursMC.js';
|
|
11
|
+
export { default as ExAbsCurrentMC } from './ExAbsCurrentMC.js';
|
|
12
12
|
export { default as ExAbsDayMC } from './ExAbsDayMC.js';
|
|
13
13
|
export { default as ExAbsHourMC } from './ExAbsHourMC.js';
|
|
14
14
|
export { default as GetArchiveDaysMC } from './GetArchiveDaysMC.js';
|
|
15
|
+
export { default as GetArchiveEvents } from './GetArchiveEvents.js';
|
|
15
16
|
export { default as GetArchiveHoursMC } from './GetArchiveHoursMC.js';
|
|
16
17
|
export { default as GetCurrentMC } from './GetCurrentMC.js';
|
|
18
|
+
export { default as GetLmicVersion } from './GetLmicVersion.js';
|
|
19
|
+
export { default as GetParameter } from './GetParameter.js';
|
|
20
|
+
export { default as GetStatus } from './GetStatus.js';
|
|
17
21
|
export { default as LastEvent } from './LastEvent.js';
|
|
18
22
|
export { default as NewEvent } from './NewEvent.js';
|
|
19
|
-
export { default as NewStatus } from './NewStatus.js';
|
|
20
23
|
export { default as SetTime2000 } from './SetTime2000.js';
|
|
21
24
|
export { default as SoftRestart } from './SoftRestart.js';
|
|
22
25
|
export { default as Time2000 } from './Time2000.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/uplink/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/uplink/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,eAAe,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Device parameters. Used in SetParameter/GetParameter.
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
*/
|
|
4
|
+
/** interval of data sending from device */
|
|
5
|
+
export declare const DATA_SENDING_INTERVAL = 1;
|
|
6
|
+
/** the parameter defines the hour of the day by which the daily consumption is calculated */
|
|
7
|
+
export declare const DAY_CHECKOUT_HOUR = 4;
|
|
8
|
+
/** type of device data sending */
|
|
9
|
+
export declare const OUTPUT_DATA_TYPE = 5;
|
|
10
|
+
/** device activation method */
|
|
11
|
+
export declare const ACTIVATION_METHOD = 9;
|
|
12
|
+
/** setup initial data for device, pulse counter, pulse coefficient, meter value */
|
|
7
13
|
export declare const INITIAL_DATA = 23;
|
|
8
|
-
/**
|
|
9
|
-
* Status of device data sending, absolute value or pulse counter
|
|
10
|
-
*/
|
|
14
|
+
/** status of device data sending, absolute value or pulse counter */
|
|
11
15
|
export declare const ABSOLUTE_DATA_STATUS = 24;
|
|
12
|
-
/**
|
|
13
|
-
* same as INITIAL_DATA for a specific channel
|
|
14
|
-
*/
|
|
16
|
+
/** same as INITIAL_DATA for a specific channel */
|
|
15
17
|
export declare const INITIAL_DATA_MULTI_CHANNEL = 29;
|
|
16
|
-
/**
|
|
17
|
-
* Status of device data sending, absolute value or pulse counter for a specific channel
|
|
18
|
-
*/
|
|
18
|
+
/** status of device data sending, absolute value or pulse counter for a specific channel */
|
|
19
19
|
export declare const ABSOLUTE_DATA_STATUS_MULTI_CHANNEL = 30;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Device parameters. Used in SetParameter/GetParameter.
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
*/
|
|
4
|
+
/** interval of data sending from device */
|
|
5
|
+
export const DATA_SENDING_INTERVAL = 1;
|
|
6
|
+
/** the parameter defines the hour of the day by which the daily consumption is calculated */
|
|
7
|
+
export const DAY_CHECKOUT_HOUR = 4;
|
|
8
|
+
/** type of device data sending */
|
|
9
|
+
export const OUTPUT_DATA_TYPE = 5;
|
|
10
|
+
/** device activation method */
|
|
11
|
+
export const ACTIVATION_METHOD = 9;
|
|
12
|
+
/** setup initial data for device, pulse counter, pulse coefficient, meter value */
|
|
7
13
|
export const INITIAL_DATA = 23;
|
|
8
|
-
/**
|
|
9
|
-
* Status of device data sending, absolute value or pulse counter
|
|
10
|
-
*/
|
|
14
|
+
/** status of device data sending, absolute value or pulse counter */
|
|
11
15
|
export const ABSOLUTE_DATA_STATUS = 24;
|
|
12
|
-
/**
|
|
13
|
-
* same as INITIAL_DATA for a specific channel
|
|
14
|
-
*/
|
|
16
|
+
/** same as INITIAL_DATA for a specific channel */
|
|
15
17
|
export const INITIAL_DATA_MULTI_CHANNEL = 29;
|
|
16
|
-
/**
|
|
17
|
-
* Status of device data sending, absolute value or pulse counter for a specific channel
|
|
18
|
-
*/
|
|
18
|
+
/** status of device data sending, absolute value or pulse counter for a specific channel */
|
|
19
19
|
export const ABSOLUTE_DATA_STATUS_MULTI_CHANNEL = 30;
|
|
20
20
|
//# sourceMappingURL=deviceParameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceParameters.js","sourceRoot":"","sources":["../../src/constants/deviceParameters.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"deviceParameters.js","sourceRoot":"","sources":["../../src/constants/deviceParameters.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,2CAA2C;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,kCAAkC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directions.js","sourceRoot":"","sources":["../../src/constants/directions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;AACtB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC"}
|
|
@@ -1,16 +1,42 @@
|
|
|
1
|
+
/** Magnet is used for more than 20 seconds. */
|
|
1
2
|
export declare const MAGNET_ON = 1;
|
|
3
|
+
/** Magnetic interference is removed. */
|
|
2
4
|
export declare const MAGNET_OFF = 2;
|
|
5
|
+
/** The device has been activated. */
|
|
3
6
|
export declare const ACTIVATE = 3;
|
|
7
|
+
/** Device deactivation. Termination of frame transmission over the air. */
|
|
4
8
|
export declare const DEACTIVATE = 4;
|
|
9
|
+
/** The sensor has reset due to low battery voltage. Outdated. */
|
|
5
10
|
export declare const BATTERY_ALARM = 5;
|
|
11
|
+
/** The container has tipped over. Outdated. */
|
|
6
12
|
export declare const CAN_OFF = 6;
|
|
13
|
+
/** Device installation in the gas meter. */
|
|
7
14
|
export declare const INSERT = 7;
|
|
15
|
+
/** Device removal from gas meter. */
|
|
8
16
|
export declare const REMOVE = 8;
|
|
17
|
+
/** The pulse counter has overflowed. The number of pulses has exceeded `4294967295`. */
|
|
9
18
|
export declare const COUNTER_OVER = 9;
|
|
19
|
+
/** Setting the device time. */
|
|
20
|
+
export declare const SET_TIME = 10;
|
|
21
|
+
/** Activation of the module in the electric energy meter (restart or power supply). */
|
|
10
22
|
export declare const ACTIVATE_MTX = 11;
|
|
23
|
+
/** Connecting a plug to a 2-port module. */
|
|
11
24
|
export declare const CONNECT = 12;
|
|
25
|
+
/** Disconnecting a connector from a 2-port module. */
|
|
12
26
|
export declare const DISCONNECT = 13;
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
27
|
+
/** Device battery depassivation. */
|
|
28
|
+
export declare const DEPASS_DONE = 14;
|
|
29
|
+
/** Low signal level from photodiode (`NOVATOR`). */
|
|
30
|
+
export declare const OPTOLOW = 15;
|
|
31
|
+
/** Photodiode overexposure (`NOVATOR`). */
|
|
32
|
+
export declare const OPTOFLASH = 16;
|
|
33
|
+
/** MTX electric energy meter event. */
|
|
34
|
+
export declare const MTX = 17;
|
|
35
|
+
/** Receiving `JOINACCEPT` from NS in OTAA mode (not implemented). */
|
|
36
|
+
export declare const JOIN_ACCEPT = 18;
|
|
37
|
+
/** Ultrasonic water meter event. */
|
|
38
|
+
export declare const WATER_EVENT = 19;
|
|
39
|
+
/** No response from ultrasonic water meter. */
|
|
40
|
+
export declare const WATER_NO_RESPONSE = 20;
|
|
41
|
+
/** Optical sensor error. */
|
|
42
|
+
export declare const OPTOSENSOR_ERROR = 21;
|
package/dist/constants/events.js
CHANGED
|
@@ -1,17 +1,43 @@
|
|
|
1
|
+
/** Magnet is used for more than 20 seconds. */
|
|
1
2
|
export const MAGNET_ON = 1;
|
|
3
|
+
/** Magnetic interference is removed. */
|
|
2
4
|
export const MAGNET_OFF = 2;
|
|
5
|
+
/** The device has been activated. */
|
|
3
6
|
export const ACTIVATE = 3;
|
|
7
|
+
/** Device deactivation. Termination of frame transmission over the air. */
|
|
4
8
|
export const DEACTIVATE = 4;
|
|
9
|
+
/** The sensor has reset due to low battery voltage. Outdated. */
|
|
5
10
|
export const BATTERY_ALARM = 5;
|
|
11
|
+
/** The container has tipped over. Outdated. */
|
|
6
12
|
export const CAN_OFF = 6;
|
|
13
|
+
/** Device installation in the gas meter. */
|
|
7
14
|
export const INSERT = 7;
|
|
15
|
+
/** Device removal from gas meter. */
|
|
8
16
|
export const REMOVE = 8;
|
|
17
|
+
/** The pulse counter has overflowed. The number of pulses has exceeded `4294967295`. */
|
|
9
18
|
export const COUNTER_OVER = 9;
|
|
19
|
+
/** Setting the device time. */
|
|
20
|
+
export const SET_TIME = 10;
|
|
21
|
+
/** Activation of the module in the electric energy meter (restart or power supply). */
|
|
10
22
|
export const ACTIVATE_MTX = 11;
|
|
23
|
+
/** Connecting a plug to a 2-port module. */
|
|
11
24
|
export const CONNECT = 12;
|
|
25
|
+
/** Disconnecting a connector from a 2-port module. */
|
|
12
26
|
export const DISCONNECT = 13;
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
|
|
16
|
-
export const
|
|
27
|
+
/** Device battery depassivation. */
|
|
28
|
+
export const DEPASS_DONE = 14;
|
|
29
|
+
/** Low signal level from photodiode (`NOVATOR`). */
|
|
30
|
+
export const OPTOLOW = 15;
|
|
31
|
+
/** Photodiode overexposure (`NOVATOR`). */
|
|
32
|
+
export const OPTOFLASH = 16;
|
|
33
|
+
/** MTX electric energy meter event. */
|
|
34
|
+
export const MTX = 17;
|
|
35
|
+
/** Receiving `JOINACCEPT` from NS in OTAA mode (not implemented). */
|
|
36
|
+
export const JOIN_ACCEPT = 18;
|
|
37
|
+
/** Ultrasonic water meter event. */
|
|
38
|
+
export const WATER_EVENT = 19;
|
|
39
|
+
/** No response from ultrasonic water meter. */
|
|
40
|
+
export const WATER_NO_RESPONSE = 20;
|
|
41
|
+
/** Optical sensor error. */
|
|
42
|
+
export const OPTOSENSOR_ERROR = 21;
|
|
17
43
|
//# sourceMappingURL=events.js.map
|