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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDayMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/DataDayMC.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"DataDayMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/DataDayMC.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AAClE,OAAO,SAAiC,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAWrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,qDAAqD;AACrD,cAAc;AACd,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAA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AAO,CAAC,SAAS,CAAC,CAAC;QAC1B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AApCe,YAAE,GAAG,UAAU,CAAC;AAEhB,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AAkCzC,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import CurrentMC from './CurrentMC.js';
|
|
2
3
|
import { TTime2000 } from '../../utils/time.js';
|
|
3
4
|
import { IChannelHours } from '../../CommandBinaryBuffer.js';
|
|
4
5
|
interface IDataHourMCParameters {
|
|
@@ -6,11 +7,40 @@ interface IDataHourMCParameters {
|
|
|
6
7
|
startTime: TTime2000;
|
|
7
8
|
hours: number;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Uplink command.
|
|
12
|
+
*
|
|
13
|
+
* @example create command instance from command body hex dump
|
|
14
|
+
* ```js
|
|
15
|
+
* import DataHourMC from 'jooby-codec/commands/uplink/DataHourMC';
|
|
16
|
+
*
|
|
17
|
+
* const commandBody = new Uint8Array([
|
|
18
|
+
* 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0xc0, 0x06, 0x0c, 0x26, 0x08, 0xea, 0x01, 0x0b
|
|
19
|
+
* ]);
|
|
20
|
+
* const command = DataHourMC.fromBytes(commandBody);
|
|
21
|
+
*
|
|
22
|
+
* console.log(command.parameters);
|
|
23
|
+
* // output:
|
|
24
|
+
* {
|
|
25
|
+
* startTime: 756648000,
|
|
26
|
+
* hours: 1,
|
|
27
|
+
* channelList: [
|
|
28
|
+
* {value: 131, index: 0, diff: [10]},
|
|
29
|
+
* {value: 832, index: 1, diff: [12]},
|
|
30
|
+
* {value: 38, index: 2, diff: [8]},
|
|
31
|
+
* {value: 234, index: 3, diff: [11]}
|
|
32
|
+
* ]
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/CorrectTime2000.md#response)
|
|
37
|
+
*/
|
|
38
|
+
declare class DataHourMC extends CurrentMC {
|
|
10
39
|
parameters: IDataHourMCParameters;
|
|
11
40
|
constructor(parameters: IDataHourMCParameters);
|
|
12
41
|
static readonly id = 23;
|
|
13
42
|
static readonly directionType = 2;
|
|
43
|
+
static readonly examples: TCommandExampleList;
|
|
14
44
|
static readonly hasParameters = true;
|
|
15
45
|
static fromBytes(data: Uint8Array): DataHourMC;
|
|
16
46
|
toBytes(): Uint8Array;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import
|
|
2
|
+
import CurrentMC from './CurrentMC.js';
|
|
3
3
|
import { getSecondsFromDate, getDateFromSeconds } from '../../utils/time.js';
|
|
4
4
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
5
5
|
import { UPLINK } from '../../constants/directions.js';
|
|
@@ -8,7 +8,51 @@ const COMMAND_ID = 0x17;
|
|
|
8
8
|
// max hours diff - 7 (3 bit value)
|
|
9
9
|
// 4 + (4 channelList * 5 bytes of hour values) + (4 * 5 bytes of diff * 7 max hours diff)
|
|
10
10
|
const COMMAND_BODY_MAX_SIZE = 164;
|
|
11
|
-
|
|
11
|
+
const examples = [
|
|
12
|
+
{
|
|
13
|
+
name: '4 first channels at 2023.12.23 12:00:00 GMT',
|
|
14
|
+
parameters: {
|
|
15
|
+
startTime: 756648000,
|
|
16
|
+
hours: 1,
|
|
17
|
+
channelList: [
|
|
18
|
+
{ index: 0, value: 131, diff: [10] },
|
|
19
|
+
{ index: 1, value: 832, diff: [12] },
|
|
20
|
+
{ index: 2, value: 38, diff: [8] },
|
|
21
|
+
{ index: 3, value: 234, diff: [11] }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
hex: { header: '17 0f', body: '2f 97 0c 0f 83 01 0a c0 06 0c 26 08 ea 01 0b' }
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Uplink command.
|
|
29
|
+
*
|
|
30
|
+
* @example create command instance from command body hex dump
|
|
31
|
+
* ```js
|
|
32
|
+
* import DataHourMC from 'jooby-codec/commands/uplink/DataHourMC';
|
|
33
|
+
*
|
|
34
|
+
* const commandBody = new Uint8Array([
|
|
35
|
+
* 0x2f, 0x97, 0x0c, 0x0f, 0x83, 0x01, 0x0a, 0xc0, 0x06, 0x0c, 0x26, 0x08, 0xea, 0x01, 0x0b
|
|
36
|
+
* ]);
|
|
37
|
+
* const command = DataHourMC.fromBytes(commandBody);
|
|
38
|
+
*
|
|
39
|
+
* console.log(command.parameters);
|
|
40
|
+
* // output:
|
|
41
|
+
* {
|
|
42
|
+
* startTime: 756648000,
|
|
43
|
+
* hours: 1,
|
|
44
|
+
* channelList: [
|
|
45
|
+
* {value: 131, index: 0, diff: [10]},
|
|
46
|
+
* {value: 832, index: 1, diff: [12]},
|
|
47
|
+
* {value: 38, index: 2, diff: [8]},
|
|
48
|
+
* {value: 234, index: 3, diff: [11]}
|
|
49
|
+
* ]
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/CorrectTime2000.md#response)
|
|
54
|
+
*/
|
|
55
|
+
class DataHourMC extends CurrentMC {
|
|
12
56
|
constructor(parameters) {
|
|
13
57
|
super(parameters);
|
|
14
58
|
this.parameters = parameters;
|
|
@@ -19,9 +63,9 @@ class DataHourMC extends GetCurrentMC {
|
|
|
19
63
|
const date = buffer.getDate();
|
|
20
64
|
const { hour, hours } = buffer.getHours();
|
|
21
65
|
const channels = buffer.getChannels();
|
|
22
|
-
date.setUTCHours(hour);
|
|
23
|
-
let value;
|
|
24
66
|
const channelList = [];
|
|
67
|
+
let value;
|
|
68
|
+
date.setUTCHours(hour);
|
|
25
69
|
channels.forEach(channelIndex => {
|
|
26
70
|
// decode hour value for channel
|
|
27
71
|
value = buffer.getExtendedValue();
|
|
@@ -51,6 +95,7 @@ class DataHourMC extends GetCurrentMC {
|
|
|
51
95
|
}
|
|
52
96
|
DataHourMC.id = COMMAND_ID;
|
|
53
97
|
DataHourMC.directionType = UPLINK;
|
|
98
|
+
DataHourMC.examples = examples;
|
|
54
99
|
DataHourMC.hasParameters = true;
|
|
55
100
|
export default DataHourMC;
|
|
56
101
|
//# sourceMappingURL=DataHourMC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataHourMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/DataHourMC.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DataHourMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/DataHourMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AACtF,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,0EAA0E;AAC1E,mCAAmC;AACnC,0FAA0F;AAC1F,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,6CAA6C;QACnD,UAAU,E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B,EAAE,CAAC,CAAC;IAClE,CAAC;;AAtDe,aAAE,GAAG,UAAU,CAAC;AAEhB,wBAAa,GAAG,MAAM,CAAC;AAEvB,mBAAQ,GAAG,QAAQ,CAAC;AAEpB,wBAAa,GAAG,IAAI,CAAC;AAoDzC,eAAe,UAAU,CAAC"}
|
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
import Command from '../../Command.js';
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
2
|
import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
3
|
-
interface
|
|
3
|
+
interface IExAbsCurrentMCParameters {
|
|
4
4
|
channelList: Array<IChannelAbsoluteValue>;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Uplink command.
|
|
8
|
+
*
|
|
9
|
+
* @example create command instance from command body hex dump
|
|
10
|
+
* ```js
|
|
11
|
+
* import ExAbsCurrentMC from 'jooby-codec/commands/uplink/ExAbsCurrentMC';
|
|
12
|
+
*
|
|
13
|
+
* const commandBody = new Uint8Array([
|
|
14
|
+
* 0x1f, 0x0f, 0x04, 0x08, 0x64, 0xd6, 0x02
|
|
15
|
+
* ]);
|
|
16
|
+
* const command = ExAbsCurrentMC.fromBytes(commandBody);
|
|
17
|
+
*
|
|
18
|
+
* console.log(command.parameters);
|
|
19
|
+
* // output:
|
|
20
|
+
* {
|
|
21
|
+
* channelList: [
|
|
22
|
+
* {
|
|
23
|
+
* pulseCoefficient: 100,
|
|
24
|
+
* index: 3,
|
|
25
|
+
* value: 342
|
|
26
|
+
* }
|
|
27
|
+
* ]
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsCurrentMC.md)
|
|
32
|
+
*/
|
|
6
33
|
declare class ExAbsCurrentMC extends Command {
|
|
7
|
-
parameters:
|
|
8
|
-
constructor(parameters:
|
|
34
|
+
parameters: IExAbsCurrentMCParameters;
|
|
35
|
+
constructor(parameters: IExAbsCurrentMCParameters);
|
|
9
36
|
static id: number;
|
|
10
37
|
static readonly directionType = 2;
|
|
38
|
+
static readonly examples: TCommandExampleList;
|
|
11
39
|
static readonly hasParameters = true;
|
|
12
40
|
static fromBytes(data: Uint8Array): ExAbsCurrentMC;
|
|
13
41
|
toBytes(): Uint8Array;
|
|
@@ -5,6 +5,51 @@ const COMMAND_ID = 0x0f1f;
|
|
|
5
5
|
// channelList 3 byte (max channelList: 14)
|
|
6
6
|
// 3 + (14 * (1 byte IPK + 5 bytes of day values))
|
|
7
7
|
const COMMAND_BODY_MAX_SIZE = 87;
|
|
8
|
+
const examples = [
|
|
9
|
+
{
|
|
10
|
+
name: 'absolute current values from channel #3',
|
|
11
|
+
parameters: {
|
|
12
|
+
channelList: [
|
|
13
|
+
{
|
|
14
|
+
pulseCoefficient: 100,
|
|
15
|
+
index: 3,
|
|
16
|
+
value: 342
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
hex: {
|
|
21
|
+
header: '1f 0f 04',
|
|
22
|
+
body: '08 64 d6 02'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Uplink command.
|
|
28
|
+
*
|
|
29
|
+
* @example create command instance from command body hex dump
|
|
30
|
+
* ```js
|
|
31
|
+
* import ExAbsCurrentMC from 'jooby-codec/commands/uplink/ExAbsCurrentMC';
|
|
32
|
+
*
|
|
33
|
+
* const commandBody = new Uint8Array([
|
|
34
|
+
* 0x1f, 0x0f, 0x04, 0x08, 0x64, 0xd6, 0x02
|
|
35
|
+
* ]);
|
|
36
|
+
* const command = ExAbsCurrentMC.fromBytes(commandBody);
|
|
37
|
+
*
|
|
38
|
+
* console.log(command.parameters);
|
|
39
|
+
* // output:
|
|
40
|
+
* {
|
|
41
|
+
* channelList: [
|
|
42
|
+
* {
|
|
43
|
+
* pulseCoefficient: 100,
|
|
44
|
+
* index: 3,
|
|
45
|
+
* value: 342
|
|
46
|
+
* }
|
|
47
|
+
* ]
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsCurrentMC.md)
|
|
52
|
+
*/
|
|
8
53
|
class ExAbsCurrentMC extends Command {
|
|
9
54
|
constructor(parameters) {
|
|
10
55
|
super();
|
|
@@ -26,6 +71,7 @@ class ExAbsCurrentMC extends Command {
|
|
|
26
71
|
}
|
|
27
72
|
ExAbsCurrentMC.id = COMMAND_ID;
|
|
28
73
|
ExAbsCurrentMC.directionType = UPLINK;
|
|
74
|
+
ExAbsCurrentMC.examples = examples;
|
|
29
75
|
ExAbsCurrentMC.hasParameters = true;
|
|
30
76
|
export default ExAbsCurrentMC;
|
|
31
77
|
//# sourceMappingURL=ExAbsCurrentMC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExAbsCurrentMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExAbsCurrentMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsCurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAOrD,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,2CAA2C;AAC3C,kDAAkD;AAClD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,yCAAyC;QAC/C,UAAU,EAAE;YACR,WAAW,EAAE;gBACT;oBACI,gBAAgB,EAAE,GAAG;oBACrB,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,GAAG;iB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MC from './CurrentMC.js';
|
|
2
3
|
import { IChannelAbsoluteValue } from '../../CommandBinaryBuffer.js';
|
|
3
4
|
import { TTime2000 } from '../../utils/time.js';
|
|
4
5
|
interface IExAbsDayMCParameters {
|
|
5
6
|
channelList: Array<IChannelAbsoluteValue>;
|
|
6
7
|
startTime: TTime2000;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Uplink command.
|
|
11
|
+
*
|
|
12
|
+
* @example create command instance from command body hex dump
|
|
13
|
+
* ```js
|
|
14
|
+
* import ExAbsDayMC from 'jooby-codec/commands/uplink/ExAbsDayMC';
|
|
15
|
+
*
|
|
16
|
+
* const commandBody = new Uint8Array([
|
|
17
|
+
* 0x1f, 0x0b, 0x06, 0x2e, 0x6a, 0x01, 0x64, 0xd6, 0x02
|
|
18
|
+
* ]);
|
|
19
|
+
* const command = ExAbsDayMC.fromBytes(commandBody);
|
|
20
|
+
*
|
|
21
|
+
* console.log(command.parameters);
|
|
22
|
+
* // output:
|
|
23
|
+
* {
|
|
24
|
+
* startTime: 731721600,
|
|
25
|
+
* channelList: [
|
|
26
|
+
* {
|
|
27
|
+
* pulseCoefficient: 100,
|
|
28
|
+
* index: 0,
|
|
29
|
+
* value: 342
|
|
30
|
+
* }
|
|
31
|
+
* ]
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsDayMC.md)
|
|
36
|
+
*/
|
|
37
|
+
declare class ExAbsDayMC extends CurrentMC {
|
|
9
38
|
parameters: IExAbsDayMCParameters;
|
|
10
39
|
constructor(parameters: IExAbsDayMCParameters);
|
|
11
40
|
static id: number;
|
|
12
41
|
static readonly directionType = 2;
|
|
42
|
+
static readonly examples: TCommandExampleList;
|
|
13
43
|
static readonly hasParameters = true;
|
|
14
44
|
static fromBytes(data: Uint8Array): ExAbsDayMC;
|
|
15
45
|
toBytes(): Uint8Array;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Command from '../../Command.js';
|
|
2
|
-
import
|
|
2
|
+
import CurrentMC from './CurrentMC.js';
|
|
3
3
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
4
|
import { UPLINK } from '../../constants/directions.js';
|
|
5
5
|
import { getSecondsFromDate } from '../../utils/time.js';
|
|
@@ -7,7 +7,54 @@ const COMMAND_ID = 0x0b1f;
|
|
|
7
7
|
// date 2 bytes, channelList 3 bytes (max channelList: 14)
|
|
8
8
|
// 5 + (14 channelList * (1 byte IPK + 5 bytes of day values))
|
|
9
9
|
const COMMAND_BODY_MAX_SIZE = 89;
|
|
10
|
-
|
|
10
|
+
const examples = [
|
|
11
|
+
{
|
|
12
|
+
name: 'absolute day value for 2023.03.10 00:00:00 GMT',
|
|
13
|
+
parameters: {
|
|
14
|
+
startTime: 731721600,
|
|
15
|
+
channelList: [
|
|
16
|
+
{
|
|
17
|
+
pulseCoefficient: 100,
|
|
18
|
+
index: 0,
|
|
19
|
+
value: 342
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
hex: {
|
|
24
|
+
header: '1f 0b 06',
|
|
25
|
+
body: '2e 6a 01 64 d6 02'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Uplink command.
|
|
31
|
+
*
|
|
32
|
+
* @example create command instance from command body hex dump
|
|
33
|
+
* ```js
|
|
34
|
+
* import ExAbsDayMC from 'jooby-codec/commands/uplink/ExAbsDayMC';
|
|
35
|
+
*
|
|
36
|
+
* const commandBody = new Uint8Array([
|
|
37
|
+
* 0x1f, 0x0b, 0x06, 0x2e, 0x6a, 0x01, 0x64, 0xd6, 0x02
|
|
38
|
+
* ]);
|
|
39
|
+
* const command = ExAbsDayMC.fromBytes(commandBody);
|
|
40
|
+
*
|
|
41
|
+
* console.log(command.parameters);
|
|
42
|
+
* // output:
|
|
43
|
+
* {
|
|
44
|
+
* startTime: 731721600,
|
|
45
|
+
* channelList: [
|
|
46
|
+
* {
|
|
47
|
+
* pulseCoefficient: 100,
|
|
48
|
+
* index: 0,
|
|
49
|
+
* value: 342
|
|
50
|
+
* }
|
|
51
|
+
* ]
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/uplink/ExAbsDayMC.md)
|
|
56
|
+
*/
|
|
57
|
+
class ExAbsDayMC extends CurrentMC {
|
|
11
58
|
constructor(parameters) {
|
|
12
59
|
super(parameters);
|
|
13
60
|
this.parameters = parameters;
|
|
@@ -30,6 +77,7 @@ class ExAbsDayMC extends GetCurrentMC {
|
|
|
30
77
|
}
|
|
31
78
|
ExAbsDayMC.id = COMMAND_ID;
|
|
32
79
|
ExAbsDayMC.directionType = UPLINK;
|
|
80
|
+
ExAbsDayMC.examples = examples;
|
|
33
81
|
ExAbsDayMC.hasParameters = true;
|
|
34
82
|
export default ExAbsDayMC;
|
|
35
83
|
//# sourceMappingURL=ExAbsDayMC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExAbsDayMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsDayMC.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExAbsDayMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/ExAbsDayMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,mBAA4C,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AASlE,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,0DAA0D;AAC1D,8DAA8D;AAC9D,MAA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,aAAE,GAAG,UAAU,CAAC;AAEP,wBAAa,GAAG,MAAM,CAAC;AAEvB,mBAAQ,GAAG,QAAQ,CAAC;AAEpB,wBAAa,GAAG,IAAI,CAAC;AAyBzC,eAAe,UAAU,CAAC"}
|
|
@@ -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,CA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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,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;
|