jooby-codec 1.8.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 +108 -9
- package/dist/CommandBinaryBuffer.js +230 -26
- 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/GetStatus.d.ts +1 -0
- package/dist/commands/downlink/GetStatus.js +1 -1
- package/dist/commands/downlink/GetStatus.js.map +1 -1
- 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 +4 -4
- package/dist/commands/downlink/index.js +4 -4
- 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/{GetStatus.d.ts → Status.d.ts} +19 -21
- package/dist/commands/uplink/{GetStatus.js → Status.js} +31 -37
- 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 +14 -0
- package/dist/constants/deviceParameters.js +14 -0
- 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 +1 -0
- package/dist/constants/index.js +1 -0
- 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 +4 -1
- package/readme.md +2 -2
- 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/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/GetStatus.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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Command from '../../Command.js';
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
2
|
import { TTime2000 } from '../../utils/time.js';
|
|
3
3
|
import { IChannelHourAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* ExAbsHourMC command parameters
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* // archive hours values from 001-03-10T12:00:00.000Z with 1-hour diff
|
|
@@ -27,13 +27,20 @@ interface IUplinkExAbsHourMCParameters {
|
|
|
27
27
|
hours: number;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Uplink command
|
|
30
|
+
* Uplink command.
|
|
31
31
|
*
|
|
32
|
-
* @example
|
|
32
|
+
* @example create command instance from command body hex dump
|
|
33
33
|
* ```js
|
|
34
|
-
* import ExAbsHourMC from 'jooby-codec/commands/uplink/
|
|
34
|
+
* import ExAbsHourMC from 'jooby-codec/commands/uplink/ExAbsHourMC';
|
|
35
|
+
*
|
|
36
|
+
* const commandBody = new Uint8Array([
|
|
37
|
+
* 0x2e, 0x6a, 0x0c, 0x01, 0x64, 0xb9, 0xf3, 0x14, 0x80, 0x01
|
|
38
|
+
* ]);
|
|
39
|
+
* const command = ExAbsHourMC.fromBytes(commandBody);
|
|
35
40
|
*
|
|
36
|
-
*
|
|
41
|
+
* console.log(command.parameters);
|
|
42
|
+
* // output:
|
|
43
|
+
* {
|
|
37
44
|
* startTime: 731764800,
|
|
38
45
|
* hours: 1,
|
|
39
46
|
* channelList: [
|
|
@@ -44,12 +51,9 @@ interface IUplinkExAbsHourMCParameters {
|
|
|
44
51
|
* diff: [128]
|
|
45
52
|
* }
|
|
46
53
|
* ]
|
|
47
|
-
* }
|
|
48
|
-
*
|
|
49
|
-
* // output command binary in hex representation
|
|
50
|
-
* console.log(command.toHex());
|
|
51
|
-
* // 1a 0d 2f 97 0c 0f 83 01 0a 08 0a 08 0a 0c 0a
|
|
54
|
+
* }
|
|
52
55
|
* ```
|
|
56
|
+
*
|
|
53
57
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsHourMC.md)
|
|
54
58
|
*/
|
|
55
59
|
declare class ExAbsHourMC extends Command {
|
|
@@ -57,6 +61,7 @@ declare class ExAbsHourMC extends Command {
|
|
|
57
61
|
constructor(parameters: IUplinkExAbsHourMCParameters);
|
|
58
62
|
static readonly id = 2591;
|
|
59
63
|
static readonly directionType = 2;
|
|
64
|
+
static readonly examples: TCommandExampleList;
|
|
60
65
|
static readonly hasParameters = true;
|
|
61
66
|
static fromBytes(data: Uint8Array): ExAbsHourMC;
|
|
62
67
|
toBytes(): Uint8Array;
|
|
@@ -7,14 +7,39 @@ const COMMAND_ID = 0x0a1f;
|
|
|
7
7
|
// max hours diff - 7 (3 bit value)
|
|
8
8
|
// 4 + (4 channelList * (1 byte IPK + 5 bytes of hour value)) + (4 * 2 bytes of diff * 7 max hours diff)
|
|
9
9
|
const COMMAND_BODY_MAX_SIZE = 84;
|
|
10
|
+
const examples = [
|
|
11
|
+
{
|
|
12
|
+
name: '1 channel at 2023.03.10 12:00:00 GMT',
|
|
13
|
+
parameters: {
|
|
14
|
+
startTime: 731764800,
|
|
15
|
+
hours: 1,
|
|
16
|
+
channelList: [
|
|
17
|
+
{
|
|
18
|
+
pulseCoefficient: 100,
|
|
19
|
+
index: 0,
|
|
20
|
+
value: 342457,
|
|
21
|
+
diff: [128]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
hex: { header: '1f 0a 0a', body: '2e 6a 0c 01 64 b9 f3 14 80 01' }
|
|
26
|
+
}
|
|
27
|
+
];
|
|
10
28
|
/**
|
|
11
|
-
* Uplink command
|
|
29
|
+
* Uplink command.
|
|
12
30
|
*
|
|
13
|
-
* @example
|
|
31
|
+
* @example create command instance from command body hex dump
|
|
14
32
|
* ```js
|
|
15
|
-
* import ExAbsHourMC from 'jooby-codec/commands/uplink/
|
|
33
|
+
* import ExAbsHourMC from 'jooby-codec/commands/uplink/ExAbsHourMC';
|
|
34
|
+
*
|
|
35
|
+
* const commandBody = new Uint8Array([
|
|
36
|
+
* 0x2e, 0x6a, 0x0c, 0x01, 0x64, 0xb9, 0xf3, 0x14, 0x80, 0x01
|
|
37
|
+
* ]);
|
|
38
|
+
* const command = ExAbsHourMC.fromBytes(commandBody);
|
|
16
39
|
*
|
|
17
|
-
*
|
|
40
|
+
* console.log(command.parameters);
|
|
41
|
+
* // output:
|
|
42
|
+
* {
|
|
18
43
|
* startTime: 731764800,
|
|
19
44
|
* hours: 1,
|
|
20
45
|
* channelList: [
|
|
@@ -25,12 +50,9 @@ const COMMAND_BODY_MAX_SIZE = 84;
|
|
|
25
50
|
* diff: [128]
|
|
26
51
|
* }
|
|
27
52
|
* ]
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* // output command binary in hex representation
|
|
31
|
-
* console.log(command.toHex());
|
|
32
|
-
* // 1a 0d 2f 97 0c 0f 83 01 0a 08 0a 08 0a 0c 0a
|
|
53
|
+
* }
|
|
33
54
|
* ```
|
|
55
|
+
*
|
|
34
56
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsHourMC.md)
|
|
35
57
|
*/
|
|
36
58
|
class ExAbsHourMC extends Command {
|
|
@@ -83,6 +105,7 @@ class ExAbsHourMC extends Command {
|
|
|
83
105
|
}
|
|
84
106
|
ExAbsHourMC.id = COMMAND_ID;
|
|
85
107
|
ExAbsHourMC.directionType = UPLINK;
|
|
108
|
+
ExAbsHourMC.examples = examples;
|
|
86
109
|
ExAbsHourMC.hasParameters = true;
|
|
87
110
|
export default ExAbsHourMC;
|
|
88
111
|
//# sourceMappingURL=ExAbsHourMC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExAbsHourMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsHourMC.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExAbsHourMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsHourMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AACtF,OAAO,mBAAgD,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AA8BrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,uEAAuE;AACvE,mCAAmC;AACnC,wGAAwG;AACxG,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,CAAC;YACR,WAAW,EAAE;gBACT;oBACI,gBAAgB,EAAE,GAAG;oBACrB,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,CAAC,GAAG,CAAC;iBACd;aACJ;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,+BAA+B,EAAC;KACnE;CACJ,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAY,SAAQ,OAAO;IAC7B,YAAqB,UAAwC;QACzD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA8B;QAGzD,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAA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AqB,CAAC,CAAC;QAC9D,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAExD,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEhC,KAAM,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAC,IAAI,WAAW,EAAG;YACzD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;YAClC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;SACjE;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA3De,cAAE,GAAG,UAAU,CAAC;AAEhB,yBAAa,GAAG,MAAM,CAAC;AAEvB,oBAAQ,GAAG,QAAQ,CAAC;AAEpB,yBAAa,GAAG,IAAI,CAAC;AAyDzC,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IChannelDays } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
import { TTime2000 } from '../../utils/time.js';
|
|
4
|
+
/**
|
|
5
|
+
* GetArchiveDaysMCResponse command parameters
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // archive 2 days values from 2001-03-10T00:00:00.000Z
|
|
9
|
+
* {
|
|
10
|
+
* channelList: [{index: 0, days: [{value: 234, day: 0}, {value: 332, day: 1}]}],
|
|
11
|
+
* date: '2001-03-10T12:00:00.000Z',
|
|
12
|
+
* days: 2
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
interface IGetArchiveDaysMCResponseParameters {
|
|
16
|
+
channelList: Array<IChannelDays>;
|
|
17
|
+
startTime: TTime2000;
|
|
18
|
+
days: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Uplink command.
|
|
22
|
+
*
|
|
23
|
+
* @example create command instance from command body hex dump
|
|
24
|
+
* ```js
|
|
25
|
+
* import GetArchiveDaysMCResponse from 'jooby-codec/commands/uplink/GetArchiveDaysMCResponse';
|
|
26
|
+
*
|
|
27
|
+
* const commandBody = new Uint8Array([
|
|
28
|
+
* 0xa9, 0x6d, 0x01, 0x02, 0xea, 0x01, 0xcc, 0x02
|
|
29
|
+
* ]);
|
|
30
|
+
* const command = GetArchiveDaysMCResponse.fromBytes(commandBody);
|
|
31
|
+
*
|
|
32
|
+
* console.log(command.parameters);
|
|
33
|
+
* // output:
|
|
34
|
+
* {
|
|
35
|
+
* startTime: 2678227200,
|
|
36
|
+
* days: 2,
|
|
37
|
+
* channelList: [
|
|
38
|
+
* {
|
|
39
|
+
* index: 0,
|
|
40
|
+
* dayList: [234, 332]
|
|
41
|
+
* }
|
|
42
|
+
* ]
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveDaysMC.md#response)
|
|
47
|
+
*/
|
|
48
|
+
declare class GetArchiveDaysMCResponse extends Command {
|
|
49
|
+
parameters: IGetArchiveDaysMCResponseParameters;
|
|
50
|
+
constructor(parameters: IGetArchiveDaysMCResponseParameters);
|
|
51
|
+
static readonly id = 27;
|
|
52
|
+
static readonly directionType = 2;
|
|
53
|
+
static readonly examples: TCommandExampleList;
|
|
54
|
+
static readonly hasParameters = true;
|
|
55
|
+
static fromBytes(data: Uint8Array): GetArchiveDaysMCResponse;
|
|
56
|
+
toBytes(): Uint8Array;
|
|
57
|
+
}
|
|
58
|
+
export default GetArchiveDaysMCResponse;
|
|
@@ -6,28 +6,51 @@ const COMMAND_ID = 0x1b;
|
|
|
6
6
|
// date 2 bytes, channelList 1 byte (max channelList: 4), days 1 byte (max days - 255)
|
|
7
7
|
// 4 + (4 channelList * 5 bytes of day values * 255 max days)
|
|
8
8
|
const COMMAND_BODY_MAX_SIZE = 5104;
|
|
9
|
+
const examples = [
|
|
10
|
+
{
|
|
11
|
+
name: 'get day values from 2001.03.10 12:00:00 GMT for 0 channel',
|
|
12
|
+
parameters: {
|
|
13
|
+
startTime: 2678227200,
|
|
14
|
+
days: 2,
|
|
15
|
+
channelList: [
|
|
16
|
+
{
|
|
17
|
+
index: 0,
|
|
18
|
+
dayList: [234, 332]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
hex: { header: '1b 08', body: 'a9 6d 01 02 ea 01 cc 02' }
|
|
23
|
+
}
|
|
24
|
+
];
|
|
9
25
|
/**
|
|
10
|
-
* Uplink command
|
|
26
|
+
* Uplink command.
|
|
11
27
|
*
|
|
12
|
-
* @example
|
|
28
|
+
* @example create command instance from command body hex dump
|
|
13
29
|
* ```js
|
|
14
|
-
* import
|
|
15
|
-
*
|
|
16
|
-
* const parameters = {
|
|
17
|
-
* channelList: [{index: 0, days: [{value: 234, day: 0}, {value: 332, day: 1}]}],
|
|
18
|
-
* date: '2001-03-10T12:00:00.000Z',
|
|
19
|
-
* days: 2
|
|
20
|
-
* };
|
|
30
|
+
* import GetArchiveDaysMCResponse from 'jooby-codec/commands/uplink/GetArchiveDaysMCResponse';
|
|
21
31
|
*
|
|
22
|
-
* const
|
|
32
|
+
* const commandBody = new Uint8Array([
|
|
33
|
+
* 0xa9, 0x6d, 0x01, 0x02, 0xea, 0x01, 0xcc, 0x02
|
|
34
|
+
* ]);
|
|
35
|
+
* const command = GetArchiveDaysMCResponse.fromBytes(commandBody);
|
|
23
36
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
37
|
+
* console.log(command.parameters);
|
|
38
|
+
* // output:
|
|
39
|
+
* {
|
|
40
|
+
* startTime: 2678227200,
|
|
41
|
+
* days: 2,
|
|
42
|
+
* channelList: [
|
|
43
|
+
* {
|
|
44
|
+
* index: 0,
|
|
45
|
+
* dayList: [234, 332]
|
|
46
|
+
* }
|
|
47
|
+
* ]
|
|
48
|
+
* }
|
|
27
49
|
* ```
|
|
50
|
+
*
|
|
28
51
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveDaysMC.md#response)
|
|
29
52
|
*/
|
|
30
|
-
class
|
|
53
|
+
class GetArchiveDaysMCResponse extends Command {
|
|
31
54
|
constructor(parameters) {
|
|
32
55
|
super();
|
|
33
56
|
this.parameters = parameters;
|
|
@@ -50,7 +73,7 @@ class GetArchiveDaysMC extends Command {
|
|
|
50
73
|
dayList.push(buffer.getExtendedValue());
|
|
51
74
|
}
|
|
52
75
|
});
|
|
53
|
-
return new
|
|
76
|
+
return new GetArchiveDaysMCResponse({ channelList, days, startTime: getSecondsFromDate(date) });
|
|
54
77
|
}
|
|
55
78
|
// returns full message - header with body
|
|
56
79
|
toBytes() {
|
|
@@ -65,8 +88,9 @@ class GetArchiveDaysMC extends Command {
|
|
|
65
88
|
return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
|
|
66
89
|
}
|
|
67
90
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
91
|
+
GetArchiveDaysMCResponse.id = COMMAND_ID;
|
|
92
|
+
GetArchiveDaysMCResponse.directionType = UPLINK;
|
|
93
|
+
GetArchiveDaysMCResponse.examples = examples;
|
|
94
|
+
GetArchiveDaysMCResponse.hasParameters = true;
|
|
95
|
+
export default GetArchiveDaysMCResponse;
|
|
96
|
+
//# sourceMappingURL=GetArchiveDaysMCResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetArchiveDaysMCResponse.js","sourceRoot":"","sources":["../../../src/commands/uplink/GetArchiveDaysMCResponse.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,EAAC,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AAqBlE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,sFAAsF;AACtF,6DAA6D;AAC7D,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,2DAA2D;QACjE,UAAU,EAAE;YACR,SAAS,EAAE,UAAU;YACrB,IAAI,EAAE,CAAC;YACP,WAAW,EAAE;gBACT;oBACI,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;iBACtB;aACJ;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAC;KAC1D;CACJ,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,wBAAyB,SAAQ,OAAO;IAC1C,YAAqB,UAA+C;QAChE,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAAqC;QAGhE,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAChG,CAAC;IAYD,oCAAoC;IACpC,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,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AAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AA/Ce,2BAAE,GAAG,UAAU,CAAC;AAEhB,sCAAa,GAAG,MAAM,CAAC;AAEvB,iCAAQ,GAAG,QAAQ,CAAC;AAEpB,sCAAa,GAAG,IAAI,CAAC;AA6CzC,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { TTime2000 } from '../../utils/time.js';
|
|
3
|
+
interface IArchiveEvent {
|
|
4
|
+
time: TTime2000;
|
|
5
|
+
id: number;
|
|
6
|
+
sequenceNumber: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* GetArchiveEventsResponse command parameters
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```js
|
|
13
|
+
* import {constants} from 'jooby-codec';
|
|
14
|
+
*
|
|
15
|
+
* // one `MAGNET_ON` event at 2023-04-05 13:17:20 GMT
|
|
16
|
+
* [events: {id: constants.events.MAGNET_ON, sequenceNumber: 1, time: 734015840}]
|
|
17
|
+
*/
|
|
18
|
+
interface IGetArchiveEventsResponseParameters {
|
|
19
|
+
eventList: Array<IArchiveEvent>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Uplink command.
|
|
23
|
+
*
|
|
24
|
+
* @example create command instance from command body hex dump
|
|
25
|
+
* ```js
|
|
26
|
+
* import GetArchiveEventsResponse from 'jooby-codec/commands/uplink/GetArchiveEventsResponse';
|
|
27
|
+
*
|
|
28
|
+
* const commandBody = new Uint8Array([
|
|
29
|
+
* 0x2b, 0xc0, 0x31, 0x60, 0x01, 0x01
|
|
30
|
+
* ]);
|
|
31
|
+
* const command = GetArchiveEventsResponse.fromBytes(commandBody);
|
|
32
|
+
*
|
|
33
|
+
* console.log(command.parameters);
|
|
34
|
+
* // output:
|
|
35
|
+
* {
|
|
36
|
+
* eventList: [
|
|
37
|
+
* {time: 734015840, id: 1, sequenceNumber: 1}
|
|
38
|
+
* ]
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveEvents.md#response)
|
|
43
|
+
*/
|
|
44
|
+
declare class GetArchiveEventsResponse extends Command {
|
|
45
|
+
parameters: IGetArchiveEventsResponseParameters;
|
|
46
|
+
constructor(parameters: IGetArchiveEventsResponseParameters);
|
|
47
|
+
static readonly id = 11;
|
|
48
|
+
static readonly directionType = 2;
|
|
49
|
+
static readonly examples: TCommandExampleList;
|
|
50
|
+
static readonly hasParameters = true;
|
|
51
|
+
static fromBytes(data: Uint8Array): GetArchiveEventsResponse;
|
|
52
|
+
toBytes(): Uint8Array;
|
|
53
|
+
}
|
|
54
|
+
export default GetArchiveEventsResponse;
|
|
@@ -7,7 +7,7 @@ const COMMAND_ID = 0x0b;
|
|
|
7
7
|
const COMMAND_BODY_MIN_SIZE = 4 + 1 + 1;
|
|
8
8
|
const examples = [
|
|
9
9
|
{
|
|
10
|
-
name: '1 event
|
|
10
|
+
name: '1 event "MAGNET_ON" at 2023.04.05 13:17:20 GMT',
|
|
11
11
|
parameters: {
|
|
12
12
|
eventList: [
|
|
13
13
|
{
|
|
@@ -20,7 +20,7 @@ const examples = [
|
|
|
20
20
|
hex: { header: '0b 06', body: '2b c0 31 60 01 01' }
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
name: '4 events
|
|
23
|
+
name: '4 events',
|
|
24
24
|
parameters: {
|
|
25
25
|
eventList: [
|
|
26
26
|
{
|
|
@@ -61,21 +61,27 @@ const setEvent = (buffer, event) => {
|
|
|
61
61
|
/**
|
|
62
62
|
* Uplink command.
|
|
63
63
|
*
|
|
64
|
-
* @example
|
|
64
|
+
* @example create command instance from command body hex dump
|
|
65
65
|
* ```js
|
|
66
|
-
* import
|
|
67
|
-
* import {constants} from 'jooby-codec';
|
|
66
|
+
* import GetArchiveEventsResponse from 'jooby-codec/commands/uplink/GetArchiveEventsResponse';
|
|
68
67
|
*
|
|
69
|
-
* const
|
|
70
|
-
*
|
|
68
|
+
* const commandBody = new Uint8Array([
|
|
69
|
+
* 0x2b, 0xc0, 0x31, 0x60, 0x01, 0x01
|
|
70
|
+
* ]);
|
|
71
|
+
* const command = GetArchiveEventsResponse.fromBytes(commandBody);
|
|
71
72
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
73
|
+
* console.log(command.parameters);
|
|
74
|
+
* // output:
|
|
75
|
+
* {
|
|
76
|
+
* eventList: [
|
|
77
|
+
* {time: 734015840, id: 1, sequenceNumber: 1}
|
|
78
|
+
* ]
|
|
79
|
+
* }
|
|
75
80
|
* ```
|
|
81
|
+
*
|
|
76
82
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveEvents.md#response)
|
|
77
83
|
*/
|
|
78
|
-
class
|
|
84
|
+
class GetArchiveEventsResponse extends Command {
|
|
79
85
|
constructor(parameters) {
|
|
80
86
|
super();
|
|
81
87
|
this.parameters = parameters;
|
|
@@ -87,7 +93,7 @@ class GetArchiveEvents extends Command {
|
|
|
87
93
|
while (buffer.bytesLeft > 0) {
|
|
88
94
|
eventList.push(getEvent(buffer));
|
|
89
95
|
}
|
|
90
|
-
return new
|
|
96
|
+
return new GetArchiveEventsResponse({ eventList });
|
|
91
97
|
}
|
|
92
98
|
// returns full message - header with body
|
|
93
99
|
toBytes() {
|
|
@@ -97,9 +103,9 @@ class GetArchiveEvents extends Command {
|
|
|
97
103
|
return Command.toBytes(COMMAND_ID, buffer.toUint8Array());
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
export default
|
|
105
|
-
//# sourceMappingURL=
|
|
106
|
+
GetArchiveEventsResponse.id = COMMAND_ID;
|
|
107
|
+
GetArchiveEventsResponse.directionType = UPLINK;
|
|
108
|
+
GetArchiveEventsResponse.examples = examples;
|
|
109
|
+
GetArchiveEventsResponse.hasParameters = true;
|
|
110
|
+
export default GetArchiveEventsResponse;
|
|
111
|
+
//# sourceMappingURL=GetArchiveEventsResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetArchiveEventsResponse.js","sourceRoot":"","sources":["../../../src/commands/uplink/GetArchiveEventsResponse.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAyBpD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,6EAA6E;AAC7E,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gDAAgD;QACtD,UAAU,EAAE;YACR,SAAS,EAAE;gBACP;oBACI,IAAI,EAAE,SAAS;oBACf,EAAE,EAAE,MAAM,CAAC,SAAS;oBACpB,cAAc,EAAE,CAAC;iBACpB;aACJ;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAC;KACpD;IACD;QACI,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE;YACR,SAAS,EAAE;gBACP;oBACI,IAAI,EAAE,SAAS;oBACf,EAAE,EAAE,MAAM,CAAC,UAAU;oBACrB,cAAc,EAAE,CAAC;iBACpB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,EAAE,EAAE,MAAM,CAAC,SAAS;oBACpB,cAAc,EAAE,CAAC;iBACpB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,EAAE,EAAE,MAAM,CAAC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AAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,EAAC,SAAS,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,SAAS,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAC;QAEjF,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAEpD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D,CAAC;;AA7Be,2BAAE,GAAG,UAAU,CAAC;AAEhB,sCAAa,GAAG,MAAM,CAAC;AAEvB,iCAAQ,GAAG,QAAQ,CAAC;AAEpB,sCAAa,GAAG,IAAI,CAAC;AA2BzC,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IChannelHours } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
import { TTime2000 } from '../../utils/time.js';
|
|
4
|
+
/**
|
|
5
|
+
* GetArchiveHoursMCResponse command parameters
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // archive hours values from 001-03-10T12:00:00.000Z with 1-hour diff
|
|
9
|
+
* {
|
|
10
|
+
* channelList: [{value: 101, index: 0, diff: [1]}],
|
|
11
|
+
* startTime: 756648000,
|
|
12
|
+
* hours: 1
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
interface IGetArchiveHoursMCResponseParameters {
|
|
16
|
+
channelList: Array<IChannelHours>;
|
|
17
|
+
startTime: TTime2000;
|
|
18
|
+
hours: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Uplink command.
|
|
22
|
+
*
|
|
23
|
+
* @example create command instance from command body hex dump
|
|
24
|
+
* ```js
|
|
25
|
+
* import GetArchiveHoursMCResponse from 'jooby-codec/commands/uplink/GetArchiveHoursMCResponse';
|
|
26
|
+
*
|
|
27
|
+
* const commandBody = new Uint8Array([
|
|
28
|
+
* 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0x08, 0x0a, 0x08, 0x0a, 0x0c, 0x0a
|
|
29
|
+
* ]);
|
|
30
|
+
* const command = GetArchiveHoursMCResponse.fromBytes(commandBody);
|
|
31
|
+
*
|
|
32
|
+
* console.log(command.parameters);
|
|
33
|
+
* // output:
|
|
34
|
+
* {
|
|
35
|
+
* startTime: 756648000,
|
|
36
|
+
* hours: 1,
|
|
37
|
+
* channelList: [
|
|
38
|
+
* {index: 0, value: 131, diff: [10]},
|
|
39
|
+
* {index: 1, value: 8, diff: [10]},
|
|
40
|
+
* {index: 2, value: 8, diff: [10]},
|
|
41
|
+
* {index: 3, value: 12, diff: [10]}
|
|
42
|
+
* ]
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveHoursMC.md#response)
|
|
47
|
+
*/
|
|
48
|
+
declare class GetArchiveHoursMCResponse extends Command {
|
|
49
|
+
parameters: IGetArchiveHoursMCResponseParameters;
|
|
50
|
+
constructor(parameters: IGetArchiveHoursMCResponseParameters);
|
|
51
|
+
static readonly id = 26;
|
|
52
|
+
static readonly directionType = 2;
|
|
53
|
+
static readonly examples: TCommandExampleList;
|
|
54
|
+
static readonly hasParameters = true;
|
|
55
|
+
static fromBytes(data: Uint8Array): GetArchiveHoursMCResponse;
|
|
56
|
+
toBytes(): Uint8Array;
|
|
57
|
+
}
|
|
58
|
+
export default GetArchiveHoursMCResponse;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import Command from '../../Command.js';
|
|
2
|
+
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
3
|
+
import { UPLINK } from '../../constants/directions.js';
|
|
4
|
+
const COMMAND_ID = 0x1a;
|
|
5
|
+
// date 2 bytes, hour 1 byte, channelList - 1 byte, so max channelList = 4
|
|
6
|
+
// max hours diff - 7 (3 bit value)
|
|
7
|
+
// 4 + (4 channelList * 5 bytes of hour values) + (4 * 5 bytes of diff * 7 max hours diff)
|
|
8
|
+
const COMMAND_BODY_MAX_SIZE = 164;
|
|
9
|
+
const examples = [
|
|
10
|
+
{
|
|
11
|
+
name: '4 channels at 2023.12.23 12:00:00 GMT',
|
|
12
|
+
parameters: {
|
|
13
|
+
startTime: 756648000,
|
|
14
|
+
hours: 1,
|
|
15
|
+
channelList: [
|
|
16
|
+
{ index: 0, value: 131, diff: [10] },
|
|
17
|
+
{ index: 1, value: 8, diff: [10] },
|
|
18
|
+
{ index: 2, value: 8, diff: [10] },
|
|
19
|
+
{ index: 3, value: 12, diff: [10] }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
hex: { header: '1a 0d', body: '2f 97 0c 0f 83 01 0a 08 0a 08 0a 0c 0a' }
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Uplink command.
|
|
27
|
+
*
|
|
28
|
+
* @example create command instance from command body hex dump
|
|
29
|
+
* ```js
|
|
30
|
+
* import GetArchiveHoursMCResponse from 'jooby-codec/commands/uplink/GetArchiveHoursMCResponse';
|
|
31
|
+
*
|
|
32
|
+
* const commandBody = new Uint8Array([
|
|
33
|
+
* 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0x08, 0x0a, 0x08, 0x0a, 0x0c, 0x0a
|
|
34
|
+
* ]);
|
|
35
|
+
* const command = GetArchiveHoursMCResponse.fromBytes(commandBody);
|
|
36
|
+
*
|
|
37
|
+
* console.log(command.parameters);
|
|
38
|
+
* // output:
|
|
39
|
+
* {
|
|
40
|
+
* startTime: 756648000,
|
|
41
|
+
* hours: 1,
|
|
42
|
+
* channelList: [
|
|
43
|
+
* {index: 0, value: 131, diff: [10]},
|
|
44
|
+
* {index: 1, value: 8, diff: [10]},
|
|
45
|
+
* {index: 2, value: 8, diff: [10]},
|
|
46
|
+
* {index: 3, value: 12, diff: [10]}
|
|
47
|
+
* ]
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetArchiveHoursMC.md#response)
|
|
52
|
+
*/
|
|
53
|
+
class GetArchiveHoursMCResponse extends Command {
|
|
54
|
+
constructor(parameters) {
|
|
55
|
+
super();
|
|
56
|
+
this.parameters = parameters;
|
|
57
|
+
this.parameters.channelList = this.parameters.channelList.sort((a, b) => a.index - b.index);
|
|
58
|
+
}
|
|
59
|
+
// data - only body (without header)
|
|
60
|
+
static fromBytes(data) {
|
|
61
|
+
const buffer = new CommandBinaryBuffer(data);
|
|
62
|
+
return new GetArchiveHoursMCResponse(buffer.getChannelsValuesWithHourDiff());
|
|
63
|
+
}
|
|
64
|
+
// returns full message - header with body
|
|
65
|
+
toBytes() {
|
|
66
|
+
const buffer = new CommandBinaryBuffer(COMMAND_BODY_MAX_SIZE);
|
|
67
|
+
const { hours, startTime, channelList } = this.parameters;
|
|
68
|
+
buffer.setChannelsValuesWithHourDiff(hours, startTime, channelList);
|
|
69
|
+
return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
GetArchiveHoursMCResponse.id = COMMAND_ID;
|
|
73
|
+
GetArchiveHoursMCResponse.directionType = UPLINK;
|
|
74
|
+
GetArchiveHoursMCResponse.examples = examples;
|
|
75
|
+
GetArchiveHoursMCResponse.hasParameters = true;
|
|
76
|
+
export default GetArchiveHoursMCResponse;
|
|
77
|
+
//# sourceMappingURL=GetArchiveHoursMCResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetArchiveHoursMCResponse.js","sourceRoot":"","sources":["../../../src/commands/uplink/GetArchiveHoursMCResponse.ts"],"names":[],"mappings":"AAAA,O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;IAYD,oCAAoC;IACpC,MAAM,CAAC,SAAS,CAAG,IAAgB;QAC/B,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAExD,MAAM,CAAC,6BAA6B,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAEpE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBe,4BAAE,GAAG,UAAU,CAAC;AAEhB,uCAAa,GAAG,MAAM,CAAC;AAEvB,kCAAQ,GAAG,QAAQ,CAAC;AAEpB,uCAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IChannelArchiveDays } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
import { TTime2000 } from '../../utils/time.js';
|
|
4
|
+
interface IGetExAbsArchiveDaysMCResponseParameters {
|
|
5
|
+
channelList: Array<IChannelArchiveDays>;
|
|
6
|
+
startTime: TTime2000;
|
|
7
|
+
days: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Uplink command.
|
|
11
|
+
*
|
|
12
|
+
* @example create command instance from command body hex dump
|
|
13
|
+
* ```js
|
|
14
|
+
* import GetExAbsArchiveDaysMCResponse from 'jooby-codec/commands/uplink/GetExAbsArchiveDaysMCResponse';
|
|
15
|
+
*
|
|
16
|
+
* const commandBody = new Uint8Array([
|
|
17
|
+
* 0x2e, 0x6a, 0x10, 0x02, 0x94, 0x2b, 0xaa, 0x2c
|
|
18
|
+
* ]);
|
|
19
|
+
* const command = GetExAbsArchiveDaysMCResponse.fromBytes(commandBody);
|
|
20
|
+
*
|
|
21
|
+
* console.log(command.parameters);
|
|
22
|
+
* // output:
|
|
23
|
+
* {
|
|
24
|
+
* startTime: 731721600,
|
|
25
|
+
* days: 2,
|
|
26
|
+
* channelList: [
|
|
27
|
+
* {
|
|
28
|
+
* index: 4,
|
|
29
|
+
* dayList: [5524, 5674]
|
|
30
|
+
* }
|
|
31
|
+
* ]
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetExAbsArchiveDaysMC.md#response)
|
|
36
|
+
*/
|
|
37
|
+
declare class GetExAbsArchiveDaysMCResponse extends Command {
|
|
38
|
+
parameters: IGetExAbsArchiveDaysMCResponseParameters;
|
|
39
|
+
constructor(parameters: IGetExAbsArchiveDaysMCResponseParameters);
|
|
40
|
+
static id: number;
|
|
41
|
+
static readonly directionType = 2;
|
|
42
|
+
static readonly examples: TCommandExampleList;
|
|
43
|
+
static readonly hasParameters = true;
|
|
44
|
+
static fromBytes(data: Uint8Array): GetExAbsArchiveDaysMCResponse;
|
|
45
|
+
toBytes(): Uint8Array;
|
|
46
|
+
}
|
|
47
|
+
export default GetExAbsArchiveDaysMCResponse;
|