jooby-codec 1.7.0 → 1.9.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/BinaryBuffer.d.ts +2 -0
- package/dist/BinaryBuffer.js +9 -0
- package/dist/BinaryBuffer.js.map +1 -1
- package/dist/CommandBinaryBuffer.d.ts +182 -49
- package/dist/CommandBinaryBuffer.js +274 -28
- package/dist/CommandBinaryBuffer.js.map +1 -1
- package/dist/commands/downlink/CorrectTime2000.d.ts +4 -3
- package/dist/commands/downlink/CorrectTime2000.js +1 -0
- package/dist/commands/downlink/CorrectTime2000.js.map +1 -1
- package/dist/commands/downlink/GetArchiveDaysMC.d.ts +5 -4
- package/dist/commands/downlink/GetArchiveDaysMC.js +2 -1
- package/dist/commands/downlink/GetArchiveDaysMC.js.map +1 -1
- package/dist/commands/downlink/GetArchiveEvents.d.ts +4 -3
- package/dist/commands/downlink/GetArchiveEvents.js +3 -5
- package/dist/commands/downlink/GetArchiveEvents.js.map +1 -1
- package/dist/commands/downlink/GetArchiveHoursMC.d.ts +5 -4
- package/dist/commands/downlink/GetArchiveHoursMC.js +2 -1
- package/dist/commands/downlink/GetArchiveHoursMC.js.map +1 -1
- package/dist/commands/downlink/GetCurrentMC.d.ts +1 -0
- package/dist/commands/downlink/GetCurrentMC.js +1 -0
- package/dist/commands/downlink/GetCurrentMC.js.map +1 -1
- package/dist/commands/downlink/{ExAbsArchiveDaysMC.d.ts → GetExAbsArchiveDaysMC.d.ts} +12 -11
- package/dist/commands/downlink/{ExAbsArchiveDaysMC.js → GetExAbsArchiveDaysMC.js} +12 -11
- package/dist/commands/downlink/GetExAbsArchiveDaysMC.js.map +1 -0
- package/dist/commands/downlink/{ExAbsArchiveHoursMC.d.ts → GetExAbsArchiveHoursMC.d.ts} +12 -11
- package/dist/commands/downlink/{ExAbsArchiveHoursMC.js → GetExAbsArchiveHoursMC.js} +12 -11
- package/dist/commands/downlink/GetExAbsArchiveHoursMC.js.map +1 -0
- package/dist/commands/downlink/{ExAbsCurrentMC.d.ts → GetExAbsCurrentMC.d.ts} +8 -7
- package/dist/commands/downlink/{ExAbsCurrentMC.js → GetExAbsCurrentMC.js} +12 -11
- package/dist/commands/downlink/GetExAbsCurrentMC.js.map +1 -0
- package/dist/commands/downlink/{GetLmicVersion.d.ts → GetLmicInfo.d.ts} +7 -6
- package/dist/commands/downlink/{GetLmicVersion.js → GetLmicInfo.js} +12 -11
- package/dist/commands/downlink/GetLmicInfo.js.map +1 -0
- package/dist/commands/downlink/GetParameter.d.ts +4 -3
- package/dist/commands/downlink/GetParameter.js +3 -8
- package/dist/commands/downlink/GetParameter.js.map +1 -1
- package/dist/commands/downlink/{NewStatus.d.ts → GetStatus.d.ts} +9 -7
- package/dist/commands/downlink/{NewStatus.js → GetStatus.js} +18 -10
- package/dist/commands/downlink/GetStatus.js.map +1 -0
- package/dist/commands/downlink/SetParameter.d.ts +1 -0
- package/dist/commands/downlink/SetParameter.js +94 -16
- package/dist/commands/downlink/SetParameter.js.map +1 -1
- package/dist/commands/downlink/SetTime2000.d.ts +4 -3
- package/dist/commands/downlink/SetTime2000.js +1 -0
- package/dist/commands/downlink/SetTime2000.js.map +1 -1
- package/dist/commands/downlink/SoftRestart.d.ts +1 -0
- package/dist/commands/downlink/SoftRestart.js +1 -0
- package/dist/commands/downlink/SoftRestart.js.map +1 -1
- package/dist/commands/downlink/index.d.ts +5 -5
- package/dist/commands/downlink/index.js +5 -5
- package/dist/commands/downlink/index.js.map +1 -1
- package/dist/commands/uplink/CorrectTime2000Response.d.ts +39 -0
- package/dist/commands/uplink/{CorrectTime2000.js → CorrectTime2000Response.js} +23 -14
- package/dist/commands/uplink/CorrectTime2000Response.js.map +1 -0
- package/dist/commands/uplink/CurrentMC.d.ts +41 -0
- package/dist/commands/uplink/{GetCurrentMC.js → CurrentMC.js} +19 -18
- package/dist/commands/uplink/CurrentMC.js.map +1 -0
- package/dist/commands/uplink/DataDayMC.d.ts +32 -3
- package/dist/commands/uplink/DataDayMC.js +47 -4
- package/dist/commands/uplink/DataDayMC.js.map +1 -1
- package/dist/commands/uplink/DataHourMC.d.ts +32 -2
- package/dist/commands/uplink/DataHourMC.js +49 -4
- package/dist/commands/uplink/DataHourMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsCurrentMC.d.ts +32 -4
- package/dist/commands/uplink/ExAbsCurrentMC.js +46 -0
- package/dist/commands/uplink/ExAbsCurrentMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsDayMC.d.ts +32 -2
- package/dist/commands/uplink/ExAbsDayMC.js +50 -2
- package/dist/commands/uplink/ExAbsDayMC.js.map +1 -1
- package/dist/commands/uplink/ExAbsHourMC.d.ts +16 -11
- package/dist/commands/uplink/ExAbsHourMC.js +32 -9
- package/dist/commands/uplink/ExAbsHourMC.js.map +1 -1
- package/dist/commands/uplink/GetArchiveDaysMCResponse.d.ts +58 -0
- package/dist/commands/uplink/{GetArchiveDaysMC.js → GetArchiveDaysMCResponse.js} +44 -20
- package/dist/commands/uplink/GetArchiveDaysMCResponse.js.map +1 -0
- package/dist/commands/uplink/GetArchiveEventsResponse.d.ts +54 -0
- package/dist/commands/uplink/{GetArchiveEvents.js → GetArchiveEventsResponse.js} +24 -18
- package/dist/commands/uplink/GetArchiveEventsResponse.js.map +1 -0
- package/dist/commands/uplink/GetArchiveHoursMCResponse.d.ts +58 -0
- package/dist/commands/uplink/GetArchiveHoursMCResponse.js +77 -0
- package/dist/commands/uplink/GetArchiveHoursMCResponse.js.map +1 -0
- package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.d.ts +47 -0
- package/dist/commands/uplink/{ExAbsArchiveDaysMC.js → GetExAbsArchiveDaysMCResponse.js} +52 -7
- package/dist/commands/uplink/GetExAbsArchiveDaysMCResponse.js.map +1 -0
- package/dist/commands/uplink/GetExAbsArchiveHoursMCResponse.d.ts +44 -0
- package/dist/commands/uplink/{ExAbsArchiveHoursMC.js → GetExAbsArchiveHoursMCResponse.js} +46 -7
- package/dist/commands/uplink/GetExAbsArchiveHoursMCResponse.js.map +1 -0
- package/dist/commands/uplink/GetLmicInfoResponse.d.ts +52 -0
- package/dist/commands/uplink/{GetLmicVersion.js → GetLmicInfoResponse.js} +27 -27
- package/dist/commands/uplink/GetLmicInfoResponse.js.map +1 -0
- package/dist/commands/uplink/GetParameterResponse.d.ts +35 -0
- package/dist/commands/uplink/{GetParameter.js → GetParameterResponse.js} +25 -32
- package/dist/commands/uplink/GetParameterResponse.js.map +1 -0
- package/dist/commands/uplink/LastEvent.d.ts +19 -10
- package/dist/commands/uplink/LastEvent.js +21 -12
- package/dist/commands/uplink/LastEvent.js.map +1 -1
- package/dist/commands/uplink/NewEvent.d.ts +12 -8
- package/dist/commands/uplink/NewEvent.js +12 -8
- package/dist/commands/uplink/NewEvent.js.map +1 -1
- package/dist/commands/uplink/SetTime2000Response.d.ts +38 -0
- package/dist/commands/uplink/{SetTime2000.js → SetTime2000Response.js} +23 -15
- package/dist/commands/uplink/SetTime2000Response.js.map +1 -0
- package/dist/commands/uplink/SoftRestartResponse.d.ts +28 -0
- package/dist/commands/uplink/SoftRestartResponse.js +44 -0
- package/dist/commands/uplink/SoftRestartResponse.js.map +1 -0
- package/dist/commands/uplink/Status.d.ts +55 -0
- package/dist/commands/uplink/Status.js +153 -0
- package/dist/commands/uplink/Status.js.map +1 -0
- package/dist/commands/uplink/Time2000.d.ts +11 -9
- package/dist/commands/uplink/Time2000.js +18 -8
- package/dist/commands/uplink/Time2000.js.map +1 -1
- package/dist/commands/uplink/index.d.ts +12 -12
- package/dist/commands/uplink/index.js +12 -12
- package/dist/commands/uplink/index.js.map +1 -1
- package/dist/constants/deviceParameters.d.ts +26 -12
- package/dist/constants/deviceParameters.js +26 -12
- package/dist/constants/deviceParameters.js.map +1 -1
- package/dist/constants/hardwareTypes.d.ts +55 -27
- package/dist/constants/hardwareTypes.js +55 -27
- package/dist/constants/hardwareTypes.js.map +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/rx2SpreadFactors.d.ts +12 -0
- package/dist/constants/rx2SpreadFactors.js +13 -0
- package/dist/constants/rx2SpreadFactors.js.map +1 -0
- package/package.json +5 -1
- package/readme.md +33 -16
- package/dist/commands/downlink/ExAbsArchiveDaysMC.js.map +0 -1
- package/dist/commands/downlink/ExAbsArchiveHoursMC.js.map +0 -1
- package/dist/commands/downlink/ExAbsCurrentMC.js.map +0 -1
- package/dist/commands/downlink/GetLmicVersion.js.map +0 -1
- package/dist/commands/downlink/NewStatus.js.map +0 -1
- package/dist/commands/uplink/CorrectTime2000.d.ts +0 -37
- package/dist/commands/uplink/CorrectTime2000.js.map +0 -1
- package/dist/commands/uplink/ExAbsArchiveDaysMC.d.ts +0 -18
- package/dist/commands/uplink/ExAbsArchiveDaysMC.js.map +0 -1
- package/dist/commands/uplink/ExAbsArchiveHoursMC.d.ts +0 -18
- package/dist/commands/uplink/ExAbsArchiveHoursMC.js.map +0 -1
- package/dist/commands/uplink/GetArchiveDaysMC.d.ts +0 -50
- package/dist/commands/uplink/GetArchiveDaysMC.js.map +0 -1
- package/dist/commands/uplink/GetArchiveEvents.d.ts +0 -48
- package/dist/commands/uplink/GetArchiveEvents.js.map +0 -1
- package/dist/commands/uplink/GetArchiveHoursMC.d.ts +0 -69
- package/dist/commands/uplink/GetArchiveHoursMC.js +0 -72
- package/dist/commands/uplink/GetArchiveHoursMC.js.map +0 -1
- package/dist/commands/uplink/GetCurrentMC.d.ts +0 -40
- package/dist/commands/uplink/GetCurrentMC.js.map +0 -1
- package/dist/commands/uplink/GetLmicVersion.d.ts +0 -46
- package/dist/commands/uplink/GetLmicVersion.js.map +0 -1
- package/dist/commands/uplink/GetParameter.d.ts +0 -30
- package/dist/commands/uplink/GetParameter.js.map +0 -1
- package/dist/commands/uplink/NewStatus.d.ts +0 -56
- package/dist/commands/uplink/NewStatus.js +0 -141
- package/dist/commands/uplink/NewStatus.js.map +0 -1
- package/dist/commands/uplink/SetTime2000.d.ts +0 -37
- package/dist/commands/uplink/SetTime2000.js.map +0 -1
- package/dist/commands/uplink/SoftRestart.d.ts +0 -24
- package/dist/commands/uplink/SoftRestart.js +0 -34
- package/dist/commands/uplink/SoftRestart.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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import * as bitSet from '../../utils/bitSet.js';
|
|
3
|
+
interface ILmicCapabilities extends bitSet.TBooleanObject {
|
|
4
|
+
/** @see https://lora-alliance.org/resource_hub/lorawan-remote-multicast-setup-specification-v1-0-0/ */
|
|
5
|
+
isMulticastSupported: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* LoRaWAN Fragmented Data Block Transport
|
|
8
|
+
* @see https://lora-alliance.org/resource_hub/lorawan-fragmented-data-block-transport-specification-v1-0-0/
|
|
9
|
+
*/
|
|
10
|
+
isFragmentedDataSupported: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* GetLmicInfoResponse command parameters
|
|
14
|
+
*/
|
|
15
|
+
interface IGetLmicInfoResponseParameters {
|
|
16
|
+
capabilities: ILmicCapabilities;
|
|
17
|
+
version: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Uplink command.
|
|
21
|
+
*
|
|
22
|
+
* @example create command instance from command body hex dump
|
|
23
|
+
* ```js
|
|
24
|
+
* import GetLmicInfoResponse from 'jooby-codec/commands/uplink/GetLmicInfoResponse';
|
|
25
|
+
*
|
|
26
|
+
* const commandBody = new Uint8Array([0x01, 0x05]);
|
|
27
|
+
* const command = GetLmicInfoResponse.fromBytes(commandBody);
|
|
28
|
+
*
|
|
29
|
+
* console.log(command.parameters);
|
|
30
|
+
* // output:
|
|
31
|
+
* {
|
|
32
|
+
* version: 5,
|
|
33
|
+
* capabilities: {
|
|
34
|
+
* isMulticastSupported: true,
|
|
35
|
+
* isFragmentedDataSupported: false
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetLmicInfo.md#response)
|
|
41
|
+
*/
|
|
42
|
+
declare class GetLmicInfoResponse extends Command {
|
|
43
|
+
parameters: IGetLmicInfoResponseParameters;
|
|
44
|
+
constructor(parameters: IGetLmicInfoResponseParameters);
|
|
45
|
+
static readonly id = 543;
|
|
46
|
+
static readonly directionType = 2;
|
|
47
|
+
static readonly examples: TCommandExampleList;
|
|
48
|
+
static readonly hasParameters = true;
|
|
49
|
+
static fromBytes(data: Uint8Array): GetLmicInfoResponse;
|
|
50
|
+
toBytes(): Uint8Array;
|
|
51
|
+
}
|
|
52
|
+
export default GetLmicInfoResponse;
|
|
@@ -10,58 +10,58 @@ const lmicCapabilitiesBitMask = {
|
|
|
10
10
|
};
|
|
11
11
|
const examples = [
|
|
12
12
|
{
|
|
13
|
-
name: 'version:
|
|
13
|
+
name: 'version: 5, support only multicast',
|
|
14
14
|
parameters: {
|
|
15
|
-
version:
|
|
15
|
+
version: 5,
|
|
16
16
|
capabilities: {
|
|
17
17
|
isMulticastSupported: true,
|
|
18
18
|
isFragmentedDataSupported: false
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
hex: { header: '1f 02 02', body: '01
|
|
21
|
+
hex: { header: '1f 02 02', body: '01 05' }
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
name: 'version:
|
|
24
|
+
name: 'version: 8, support multicast and fragmented data',
|
|
25
25
|
parameters: {
|
|
26
|
-
version:
|
|
26
|
+
version: 8,
|
|
27
27
|
capabilities: {
|
|
28
28
|
isMulticastSupported: true,
|
|
29
29
|
isFragmentedDataSupported: true
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
hex: { header: '1f 02 02', body: '03
|
|
32
|
+
hex: { header: '1f 02 02', body: '03 08' }
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
35
|
/**
|
|
36
36
|
* Uplink command.
|
|
37
37
|
*
|
|
38
|
-
* @example
|
|
38
|
+
* @example create command instance from command body hex dump
|
|
39
39
|
* ```js
|
|
40
|
-
* import
|
|
40
|
+
* import GetLmicInfoResponse from 'jooby-codec/commands/uplink/GetLmicInfoResponse';
|
|
41
41
|
*
|
|
42
|
-
* const
|
|
43
|
-
*
|
|
42
|
+
* const commandBody = new Uint8Array([0x01, 0x05]);
|
|
43
|
+
* const command = GetLmicInfoResponse.fromBytes(commandBody);
|
|
44
|
+
*
|
|
45
|
+
* console.log(command.parameters);
|
|
46
|
+
* // output:
|
|
47
|
+
* {
|
|
48
|
+
* version: 5,
|
|
44
49
|
* capabilities: {
|
|
45
50
|
* isMulticastSupported: true,
|
|
46
|
-
* isFragmentedDataSupported:
|
|
51
|
+
* isFragmentedDataSupported: false
|
|
47
52
|
* }
|
|
48
|
-
* }
|
|
49
|
-
* const command = new GetLmicVersion(parameters);
|
|
50
|
-
*
|
|
51
|
-
* // output command binary in hex representation
|
|
52
|
-
* console.log(command.toHex());
|
|
53
|
-
* // 1f 02 02 03 22
|
|
53
|
+
* }
|
|
54
54
|
* ```
|
|
55
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetLmicInfo.md#response)
|
|
56
57
|
*/
|
|
57
|
-
class
|
|
58
|
+
class GetLmicInfoResponse extends Command {
|
|
58
59
|
constructor(parameters) {
|
|
59
60
|
super();
|
|
60
61
|
this.parameters = parameters;
|
|
61
62
|
}
|
|
62
63
|
// data - only body (without header)
|
|
63
64
|
static fromBytes(data) {
|
|
64
|
-
console.log({ data });
|
|
65
65
|
if (data.byteLength !== COMMAND_BODY_SIZE) {
|
|
66
66
|
throw new Error(`${this.getName()}. Wrong buffer size: ${data.byteLength}.`);
|
|
67
67
|
}
|
|
@@ -71,7 +71,7 @@ class GetLmicVersion extends Command {
|
|
|
71
71
|
if (!buffer.isEmpty) {
|
|
72
72
|
throw new Error(`${this.getName()}. BinaryBuffer is not empty.`);
|
|
73
73
|
}
|
|
74
|
-
return new
|
|
74
|
+
return new GetLmicInfoResponse({ capabilities, version });
|
|
75
75
|
}
|
|
76
76
|
// returns full message - header with body
|
|
77
77
|
toBytes() {
|
|
@@ -82,9 +82,9 @@ class GetLmicVersion extends Command {
|
|
|
82
82
|
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export default
|
|
90
|
-
//# sourceMappingURL=
|
|
85
|
+
GetLmicInfoResponse.id = COMMAND_ID;
|
|
86
|
+
GetLmicInfoResponse.directionType = UPLINK;
|
|
87
|
+
GetLmicInfoResponse.examples = examples;
|
|
88
|
+
GetLmicInfoResponse.hasParameters = true;
|
|
89
|
+
export default GetLmicInfoResponse;
|
|
90
|
+
//# sourceMappingURL=GetLmicInfoResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetLmicInfoResponse.js","sourceRoot":"","sources":["../../../src/commands/uplink/GetLmicInfoResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAwBrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,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,EAAE,CAAC;QAElC,IAAK,CAAC,MAAM,CAAC,OAAO,EAAG;YACnB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;SACpE;QAED,OAAO,IAAI,mBAAmB,CAAC,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC,CAAC;IAC5D,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,EAAC,YAAY,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,iBAAiB,CAAC,CAAC;QAEnD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEzB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AApCe,sBAAE,GAAG,UAAU,CAAC;AAEhB,iCAAa,GAAG,MAAM,CAAC;AAEvB,4BAAQ,GAAG,QAAQ,CAAC;AAEpB,iCAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IParameter } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
/**
|
|
4
|
+
* Uplink command.
|
|
5
|
+
*
|
|
6
|
+
* @example create command instance from command body hex dump
|
|
7
|
+
* ```js
|
|
8
|
+
* import GetParameterResponse from 'jooby-codec/commands/uplink/GetParameterResponse';
|
|
9
|
+
*
|
|
10
|
+
* const commandBody = new Uint8Array([
|
|
11
|
+
* 0x1d, 0x01, 0x00, 0x00, 0x01, 0x92, 0x80, 0x00, 0x00, 0x07, 0xf0
|
|
12
|
+
* ]);
|
|
13
|
+
* const command = GetParameterResponse.fromBytes(commandBody);
|
|
14
|
+
*
|
|
15
|
+
* console.log(command.parameters);
|
|
16
|
+
* // output:
|
|
17
|
+
* {
|
|
18
|
+
* id: 29,
|
|
19
|
+
* data: {value: 2032, meterValue: 402, pulseCoefficient: 1000, channel: 1}
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetParameter.md#response)
|
|
24
|
+
*/
|
|
25
|
+
declare class GetParameterResponse extends Command {
|
|
26
|
+
parameters: IParameter;
|
|
27
|
+
constructor(parameters: IParameter);
|
|
28
|
+
static readonly id = 4;
|
|
29
|
+
static readonly directionType = 2;
|
|
30
|
+
static readonly examples: TCommandExampleList;
|
|
31
|
+
static readonly hasParameters = true;
|
|
32
|
+
static fromBytes(data: Uint8Array): GetParameterResponse;
|
|
33
|
+
toBytes(): Uint8Array;
|
|
34
|
+
}
|
|
35
|
+
export default GetParameterResponse;
|
|
@@ -10,10 +10,7 @@ const examples = [
|
|
|
10
10
|
id: deviceParameters.INITIAL_DATA,
|
|
11
11
|
data: { value: 2023, meterValue: 204, pulseCoefficient: 100 }
|
|
12
12
|
},
|
|
13
|
-
hex: {
|
|
14
|
-
header: '04 0a',
|
|
15
|
-
body: '17 00 00 00 cc 82 00 00 07 e7'
|
|
16
|
-
}
|
|
13
|
+
hex: { header: '04 0a', body: '17 00 00 00 cc 82 00 00 07 e7' }
|
|
17
14
|
},
|
|
18
15
|
{
|
|
19
16
|
name: 'device sending absolute data',
|
|
@@ -21,10 +18,7 @@ const examples = [
|
|
|
21
18
|
id: deviceParameters.ABSOLUTE_DATA_STATUS,
|
|
22
19
|
data: { status: 1 }
|
|
23
20
|
},
|
|
24
|
-
hex: {
|
|
25
|
-
header: '04 02',
|
|
26
|
-
body: '18 01'
|
|
27
|
-
}
|
|
21
|
+
hex: { header: '04 02', body: '18 01' }
|
|
28
22
|
},
|
|
29
23
|
{
|
|
30
24
|
name: 'initial data from 1 channel',
|
|
@@ -32,10 +26,7 @@ const examples = [
|
|
|
32
26
|
id: deviceParameters.INITIAL_DATA_MULTI_CHANNEL,
|
|
33
27
|
data: { value: 2032, meterValue: 402, pulseCoefficient: 1000, channel: 1 }
|
|
34
28
|
},
|
|
35
|
-
hex: {
|
|
36
|
-
header: '04 0b',
|
|
37
|
-
body: '1d 01 00 00 01 92 80 00 00 07 f0'
|
|
38
|
-
}
|
|
29
|
+
hex: { header: '04 0b', body: '1d 01 00 00 01 92 80 00 00 07 f0' }
|
|
39
30
|
},
|
|
40
31
|
{
|
|
41
32
|
name: 'absolute data sending is disabled for 2 channel',
|
|
@@ -43,30 +34,32 @@ const examples = [
|
|
|
43
34
|
id: deviceParameters.ABSOLUTE_DATA_STATUS_MULTI_CHANNEL,
|
|
44
35
|
data: { status: 0, channel: 2 }
|
|
45
36
|
},
|
|
46
|
-
hex: {
|
|
47
|
-
header: '04 03',
|
|
48
|
-
body: '1e 02 00'
|
|
49
|
-
}
|
|
37
|
+
hex: { header: '04 03', body: '1e 02 00' }
|
|
50
38
|
}
|
|
51
39
|
];
|
|
52
40
|
/**
|
|
53
41
|
* Uplink command.
|
|
54
42
|
*
|
|
55
|
-
* @example
|
|
43
|
+
* @example create command instance from command body hex dump
|
|
56
44
|
* ```js
|
|
57
|
-
* import
|
|
58
|
-
* import {constants} from 'jooby-codec';
|
|
45
|
+
* import GetParameterResponse from 'jooby-codec/commands/uplink/GetParameterResponse';
|
|
59
46
|
*
|
|
60
|
-
* const
|
|
61
|
-
*
|
|
47
|
+
* const commandBody = new Uint8Array([
|
|
48
|
+
* 0x1d, 0x01, 0x00, 0x00, 0x01, 0x92, 0x80, 0x00, 0x00, 0x07, 0xf0
|
|
49
|
+
* ]);
|
|
50
|
+
* const command = GetParameterResponse.fromBytes(commandBody);
|
|
62
51
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
52
|
+
* console.log(command.parameters);
|
|
53
|
+
* // output:
|
|
54
|
+
* {
|
|
55
|
+
* id: 29,
|
|
56
|
+
* data: {value: 2032, meterValue: 402, pulseCoefficient: 1000, channel: 1}
|
|
57
|
+
* }
|
|
66
58
|
* ```
|
|
59
|
+
*
|
|
67
60
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetParameter.md#response)
|
|
68
61
|
*/
|
|
69
|
-
class
|
|
62
|
+
class GetParameterResponse extends Command {
|
|
70
63
|
constructor(parameters) {
|
|
71
64
|
super();
|
|
72
65
|
this.parameters = parameters;
|
|
@@ -74,7 +67,7 @@ class GetParameter extends Command {
|
|
|
74
67
|
// data - only body (without header)
|
|
75
68
|
static fromBytes(data) {
|
|
76
69
|
const buffer = new CommandBinaryBuffer(data);
|
|
77
|
-
return new
|
|
70
|
+
return new GetParameterResponse(buffer.getParameter());
|
|
78
71
|
}
|
|
79
72
|
// returns full message - header with body
|
|
80
73
|
toBytes() {
|
|
@@ -83,9 +76,9 @@ class GetParameter extends Command {
|
|
|
83
76
|
return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
export default
|
|
91
|
-
//# sourceMappingURL=
|
|
79
|
+
GetParameterResponse.id = COMMAND_ID;
|
|
80
|
+
GetParameterResponse.directionType = UPLINK;
|
|
81
|
+
GetParameterResponse.examples = examples;
|
|
82
|
+
GetParameterResponse.hasParameters = true;
|
|
83
|
+
export default GetParameterResponse;
|
|
84
|
+
//# sourceMappingURL=GetParameterResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetParameterResponse.js","sourceRoot":"","sources":["../../../src/commands/uplink/GetParameterResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAiC,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAC,MAAM,EAAC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qB,SAAQ,OAAO;IACtC,YAAqB,UAAsB;QACvC,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAY;IAE3C,CAAC;IAYD,oCAAoC;IACpC,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,oBAAoB,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAE9F,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAvBe,uBAAE,GAAG,UAAU,CAAC;AAEhB,kCAAa,GAAG,MAAM,CAAC;AAEvB,6BAAQ,GAAG,QAAQ,CAAC;AAEpB,kCAAa,GAAG,IAAI,CAAC;AAqBzC,eAAe,oBAAoB,CAAC"}
|
|
@@ -15,20 +15,29 @@ interface ILastEventParameters {
|
|
|
15
15
|
/**
|
|
16
16
|
* Uplink command.
|
|
17
17
|
*
|
|
18
|
-
* @example
|
|
18
|
+
* @example create command instance from command body hex dump
|
|
19
19
|
* ```js
|
|
20
|
-
* import LastEvent from 'jooby-codec/commands/
|
|
21
|
-
* import hardwareTypes from 'jooby-codec/constants/hardwareTypes';
|
|
20
|
+
* import LastEvent from 'jooby-codec/commands/uplink/LastEvent';
|
|
21
|
+
* import * as hardwareTypes from 'jooby-codec/constants/hardwareTypes.js';
|
|
22
22
|
*
|
|
23
|
-
* const
|
|
24
|
-
*
|
|
25
|
-
* hardwareTypes.IMP2EU
|
|
26
|
-
* );
|
|
23
|
+
* const commandBody = new Uint8Array([0x10, 0xe1, 0x01]);
|
|
24
|
+
* const command = LastEvent.fromBytes(commandBody, hardwareTypes.IMP4EU);
|
|
27
25
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* console.log(command.parameters);
|
|
27
|
+
* // output:
|
|
28
|
+
* {
|
|
29
|
+
* sequenceNumber: 16,
|
|
30
|
+
* status: {
|
|
31
|
+
* isBatteryLow: true,
|
|
32
|
+
* isConnectionLost: false,
|
|
33
|
+
* isFirstChannelInactive: false,
|
|
34
|
+
* isSecondChannelInactive: true,
|
|
35
|
+
* isThirdChannelInactive: true,
|
|
36
|
+
* isForthChannelInactive: true
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
31
39
|
* ```
|
|
40
|
+
*
|
|
32
41
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/LastEvent.md)
|
|
33
42
|
*/
|
|
34
43
|
declare class LastEvent extends Command {
|
|
@@ -5,7 +5,7 @@ import * as hardwareTypes from '../../constants/hardwareTypes.js';
|
|
|
5
5
|
const COMMAND_ID = 0x60;
|
|
6
6
|
const examples = [
|
|
7
7
|
{
|
|
8
|
-
name: 'status for
|
|
8
|
+
name: 'status for GASI3',
|
|
9
9
|
parameters: {
|
|
10
10
|
sequenceNumber: 32,
|
|
11
11
|
status: {
|
|
@@ -15,7 +15,7 @@ const examples = [
|
|
|
15
15
|
isMagneticInfluence: false
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
hardwareType: hardwareTypes.
|
|
18
|
+
hardwareType: hardwareTypes.GASI3,
|
|
19
19
|
hex: { header: '62', body: '20 09' }
|
|
20
20
|
},
|
|
21
21
|
{
|
|
@@ -65,20 +65,29 @@ const examples = [
|
|
|
65
65
|
/**
|
|
66
66
|
* Uplink command.
|
|
67
67
|
*
|
|
68
|
-
* @example
|
|
68
|
+
* @example create command instance from command body hex dump
|
|
69
69
|
* ```js
|
|
70
|
-
* import LastEvent from 'jooby-codec/commands/
|
|
71
|
-
* import hardwareTypes from 'jooby-codec/constants/hardwareTypes';
|
|
70
|
+
* import LastEvent from 'jooby-codec/commands/uplink/LastEvent';
|
|
71
|
+
* import * as hardwareTypes from 'jooby-codec/constants/hardwareTypes.js';
|
|
72
72
|
*
|
|
73
|
-
* const
|
|
74
|
-
*
|
|
75
|
-
* hardwareTypes.IMP2EU
|
|
76
|
-
* );
|
|
73
|
+
* const commandBody = new Uint8Array([0x10, 0xe1, 0x01]);
|
|
74
|
+
* const command = LastEvent.fromBytes(commandBody, hardwareTypes.IMP4EU);
|
|
77
75
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
76
|
+
* console.log(command.parameters);
|
|
77
|
+
* // output:
|
|
78
|
+
* {
|
|
79
|
+
* sequenceNumber: 16,
|
|
80
|
+
* status: {
|
|
81
|
+
* isBatteryLow: true,
|
|
82
|
+
* isConnectionLost: false,
|
|
83
|
+
* isFirstChannelInactive: false,
|
|
84
|
+
* isSecondChannelInactive: true,
|
|
85
|
+
* isThirdChannelInactive: true,
|
|
86
|
+
* isForthChannelInactive: true
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
81
89
|
* ```
|
|
90
|
+
*
|
|
82
91
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/LastEvent.md)
|
|
83
92
|
*/
|
|
84
93
|
class LastEvent extends Command {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastEvent.js","sourceRoot":"","sources":["../../../src/commands/uplink/LastEvent.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmC,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAiBlE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,QAAQ,GAAwB;IAClC;QACI,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AAI,mBAAmB;QAClC,oCAAoC;QACpC,CAAC,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAChE,CAAC;QAEF,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAEjD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AAlCe,YAAE,GAAG,UAAU,CAAC;AAEhB,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AAgCzC,eAAe,SAAS,CAAC"}
|
|
@@ -46,18 +46,22 @@ interface INewEventParameters {
|
|
|
46
46
|
/**
|
|
47
47
|
* Uplink command.
|
|
48
48
|
*
|
|
49
|
-
* @example
|
|
49
|
+
* @example create command instance from command body hex dump
|
|
50
50
|
* ```js
|
|
51
|
-
* import {constants} from 'jooby-codec'
|
|
52
51
|
* import NewEvent from 'jooby-codec/commands/uplink/NewEvent';
|
|
53
52
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
53
|
+
* const commandBody = new Uint8Array([
|
|
54
|
+
* 0x05, 0x02, 0x0c, 0xec
|
|
55
|
+
* ]);
|
|
56
|
+
* const command = NewEvent.fromBytes(commandBody);
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* console.log(command.parameters);
|
|
59
|
+
* // output:
|
|
60
|
+
* {
|
|
61
|
+
* id: 5,
|
|
62
|
+
* sequenceNumber: 2,
|
|
63
|
+
* data: {voltage: 3308}
|
|
64
|
+
* }
|
|
61
65
|
* ```
|
|
62
66
|
*
|
|
63
67
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/NewEvent.md)
|
|
@@ -99,18 +99,22 @@ const setDeviceId = (buffer, value) => {
|
|
|
99
99
|
/**
|
|
100
100
|
* Uplink command.
|
|
101
101
|
*
|
|
102
|
-
* @example
|
|
102
|
+
* @example create command instance from command body hex dump
|
|
103
103
|
* ```js
|
|
104
|
-
* import {constants} from 'jooby-codec'
|
|
105
104
|
* import NewEvent from 'jooby-codec/commands/uplink/NewEvent';
|
|
106
105
|
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
106
|
+
* const commandBody = new Uint8Array([
|
|
107
|
+
* 0x05, 0x02, 0x0c, 0xec
|
|
108
|
+
* ]);
|
|
109
|
+
* const command = NewEvent.fromBytes(commandBody);
|
|
110
110
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* console.log(command.parameters);
|
|
112
|
+
* // output:
|
|
113
|
+
* {
|
|
114
|
+
* id: 5,
|
|
115
|
+
* sequenceNumber: 2,
|
|
116
|
+
* data: {voltage: 3308}
|
|
117
|
+
* }
|
|
114
118
|
* ```
|
|
115
119
|
*
|
|
116
120
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/NewEvent.md)
|
|
@@ -1 +1 @@
|
|
|
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;AAE7D,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AA4DlE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,sGAAsG;AACtG,MAAM,qBAAqB,G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|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {status: 1}
|
|
7
|
+
*/
|
|
8
|
+
interface ISetTime2000ResponseParameters {
|
|
9
|
+
status: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Uplink command.
|
|
13
|
+
*
|
|
14
|
+
* @example create command instance from command body hex dump
|
|
15
|
+
* ```js
|
|
16
|
+
* import SetTime2000Response from 'jooby-codec/commands/uplink/SetTime2000Response';
|
|
17
|
+
*
|
|
18
|
+
* const commandBody = new Uint8Array([0x01]);
|
|
19
|
+
* const command = SetTime2000Response.fromBytes(commandBody);
|
|
20
|
+
*
|
|
21
|
+
* console.log(command.parameters);
|
|
22
|
+
* // output:
|
|
23
|
+
* {status: 1}
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/SetTime2000.md#response)
|
|
27
|
+
*/
|
|
28
|
+
declare class SetTime2000Response extends Command {
|
|
29
|
+
parameters: ISetTime2000ResponseParameters;
|
|
30
|
+
constructor(parameters: ISetTime2000ResponseParameters);
|
|
31
|
+
static readonly id = 2;
|
|
32
|
+
static readonly directionType = 2;
|
|
33
|
+
static readonly examples: TCommandExampleList;
|
|
34
|
+
static readonly hasParameters = true;
|
|
35
|
+
static fromBytes(data: Uint8Array): SetTime2000Response;
|
|
36
|
+
toBytes(): Uint8Array;
|
|
37
|
+
}
|
|
38
|
+
export default SetTime2000Response;
|
|
@@ -3,24 +3,31 @@ import BinaryBuffer from '../../BinaryBuffer.js';
|
|
|
3
3
|
import { UPLINK } from '../../constants/directions.js';
|
|
4
4
|
const COMMAND_ID = 0x02;
|
|
5
5
|
const COMMAND_BODY_SIZE = 1;
|
|
6
|
+
const examples = [
|
|
7
|
+
{
|
|
8
|
+
name: 'success',
|
|
9
|
+
parameters: { status: 1 },
|
|
10
|
+
hex: { header: '02 01', body: '01' }
|
|
11
|
+
}
|
|
12
|
+
];
|
|
6
13
|
/**
|
|
7
14
|
* Uplink command.
|
|
8
15
|
*
|
|
9
|
-
* @example
|
|
16
|
+
* @example create command instance from command body hex dump
|
|
10
17
|
* ```js
|
|
11
|
-
* import
|
|
18
|
+
* import SetTime2000Response from 'jooby-codec/commands/uplink/SetTime2000Response';
|
|
12
19
|
*
|
|
13
|
-
*
|
|
14
|
-
* const
|
|
15
|
-
* const command = new SetTime2000(parameters);
|
|
20
|
+
* const commandBody = new Uint8Array([0x01]);
|
|
21
|
+
* const command = SetTime2000Response.fromBytes(commandBody);
|
|
16
22
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
23
|
+
* console.log(command.parameters);
|
|
24
|
+
* // output:
|
|
25
|
+
* {status: 1}
|
|
20
26
|
* ```
|
|
27
|
+
*
|
|
21
28
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/SetTime2000.md#response)
|
|
22
29
|
*/
|
|
23
|
-
class
|
|
30
|
+
class SetTime2000Response extends Command {
|
|
24
31
|
constructor(parameters) {
|
|
25
32
|
super();
|
|
26
33
|
this.parameters = parameters;
|
|
@@ -37,7 +44,7 @@ class SetTime2000 extends Command {
|
|
|
37
44
|
if (!buffer.isEmpty) {
|
|
38
45
|
throw new Error(`${this.getName()}. BinaryBuffer is not empty.`);
|
|
39
46
|
}
|
|
40
|
-
return new
|
|
47
|
+
return new SetTime2000Response(parameters);
|
|
41
48
|
}
|
|
42
49
|
// returns full message - header with body
|
|
43
50
|
toBytes() {
|
|
@@ -47,8 +54,9 @@ class SetTime2000 extends Command {
|
|
|
47
54
|
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
SetTime2000Response.id = COMMAND_ID;
|
|
58
|
+
SetTime2000Response.directionType = UPLINK;
|
|
59
|
+
SetTime2000Response.examples = examples;
|
|
60
|
+
SetTime2000Response.hasParameters = true;
|
|
61
|
+
export default SetTime2000Response;
|
|
62
|
+
//# sourceMappingURL=SetTime2000Response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetTime2000Response.js","sourceRoot":"","sources":["../../../src/commands/uplink/SetTime2000Response.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,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;AAE5B,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC;QACvB,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAC;KACrC;CACJ,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,mBAAoB,SAAQ,OAAO;IACrC,YAAqB,UAA0C;QAC3D,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAgC;IAE/D,CAAC;IAYD,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;QAC7C,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,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/C,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;;AAnCe,sBAAE,GAAG,UAAU,CAAC;AAEhB,iCAAa,GAAG,MAAM,CAAC;AAEvB,4BAAQ,GAAG,QAAQ,CAAC;AAEpB,iCAAa,GAAG,IAAI,CAAC;AAiCzC,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
/**
|
|
3
|
+
* Uplink command.
|
|
4
|
+
*
|
|
5
|
+
* @example create command instance from command body hex dump
|
|
6
|
+
* ```js
|
|
7
|
+
* import SoftRestartResponse from 'jooby-codec/commands/uplink/SoftRestartResponse';
|
|
8
|
+
*
|
|
9
|
+
* const commandBody = new Uint8Array([]);
|
|
10
|
+
* const command = SoftRestartResponse.fromBytes(commandBody);
|
|
11
|
+
*
|
|
12
|
+
* // this command doesn't have any parameters
|
|
13
|
+
* console.log(command.parameters);
|
|
14
|
+
* // output:
|
|
15
|
+
* undefined
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/SoftRestart.md#response)
|
|
19
|
+
*/
|
|
20
|
+
declare class SoftRestartResponse extends Command {
|
|
21
|
+
static readonly id = 25;
|
|
22
|
+
static readonly directionType = 2;
|
|
23
|
+
static readonly examples: TCommandExampleList;
|
|
24
|
+
static readonly hasParameters = false;
|
|
25
|
+
static fromBytes(): SoftRestartResponse;
|
|
26
|
+
toBytes(): Uint8Array;
|
|
27
|
+
}
|
|
28
|
+
export default SoftRestartResponse;
|