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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Command, { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import { IChannelValue } from '../../CommandBinaryBuffer.js';
|
|
3
|
+
/**
|
|
4
|
+
* CurrentMC command parameters.
|
|
5
|
+
*/
|
|
6
|
+
export interface ICurrentMCParameters {
|
|
7
|
+
channelList: Array<IChannelValue>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Uplink command.
|
|
11
|
+
*
|
|
12
|
+
* @example create command instance from command body hex dump
|
|
13
|
+
* ```js
|
|
14
|
+
* import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
|
|
15
|
+
*
|
|
16
|
+
* // failure
|
|
17
|
+
* const commandBody = new Uint8Array([0x01, 0x32]);
|
|
18
|
+
* const command = CurrentMC.fromBytes(commandBody);
|
|
19
|
+
*
|
|
20
|
+
* console.log(command.parameters);
|
|
21
|
+
* // output:
|
|
22
|
+
* {
|
|
23
|
+
* channelList: [
|
|
24
|
+
* {index: 1, value: 50}
|
|
25
|
+
* ]
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
|
|
30
|
+
*/
|
|
31
|
+
declare class CurrentMC extends Command {
|
|
32
|
+
parameters: ICurrentMCParameters;
|
|
33
|
+
constructor(parameters: ICurrentMCParameters);
|
|
34
|
+
static id: number;
|
|
35
|
+
static readonly directionType = 2;
|
|
36
|
+
static readonly examples: TCommandExampleList;
|
|
37
|
+
static readonly hasParameters = true;
|
|
38
|
+
static fromBytes(data: Uint8Array): CurrentMC;
|
|
39
|
+
toBytes(): Uint8Array;
|
|
40
|
+
}
|
|
41
|
+
export default CurrentMC;
|
|
@@ -39,27 +39,28 @@ const examples = [
|
|
|
39
39
|
}
|
|
40
40
|
];
|
|
41
41
|
/**
|
|
42
|
-
* Uplink command
|
|
42
|
+
* Uplink command.
|
|
43
43
|
*
|
|
44
|
-
* @example
|
|
44
|
+
* @example create command instance from command body hex dump
|
|
45
45
|
* ```js
|
|
46
|
-
* import
|
|
46
|
+
* import CurrentMC from 'jooby-codec/commands/uplink/CurrentMC';
|
|
47
47
|
*
|
|
48
|
-
*
|
|
48
|
+
* // failure
|
|
49
|
+
* const commandBody = new Uint8Array([0x01, 0x32]);
|
|
50
|
+
* const command = CurrentMC.fromBytes(commandBody);
|
|
51
|
+
*
|
|
52
|
+
* console.log(command.parameters);
|
|
53
|
+
* // output:
|
|
54
|
+
* {
|
|
49
55
|
* channelList: [
|
|
50
56
|
* {index: 1, value: 50}
|
|
51
57
|
* ]
|
|
52
|
-
* }
|
|
53
|
-
* const command = new GetCurrentMC(parameters);
|
|
54
|
-
*
|
|
55
|
-
* // output command binary in hex representation
|
|
56
|
-
* console.log(command.toHex());
|
|
57
|
-
* // 18 02 01 32
|
|
58
|
+
* }
|
|
58
59
|
* ```
|
|
59
60
|
*
|
|
60
61
|
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/GetCurrentMC.md#response)
|
|
61
62
|
*/
|
|
62
|
-
class
|
|
63
|
+
class CurrentMC extends Command {
|
|
63
64
|
constructor(parameters) {
|
|
64
65
|
super();
|
|
65
66
|
this.parameters = parameters;
|
|
@@ -74,7 +75,7 @@ class GetCurrentMC extends Command {
|
|
|
74
75
|
value: buffer.getExtendedValue(),
|
|
75
76
|
index: channelIndex
|
|
76
77
|
}));
|
|
77
|
-
return new
|
|
78
|
+
return new CurrentMC(parameters);
|
|
78
79
|
}
|
|
79
80
|
// returns full message - header with body
|
|
80
81
|
toBytes() {
|
|
@@ -85,9 +86,9 @@ class GetCurrentMC extends Command {
|
|
|
85
86
|
return Command.toBytes(COMMAND_ID, buffer.getBytesToOffset());
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export default
|
|
93
|
-
//# sourceMappingURL=
|
|
89
|
+
CurrentMC.id = COMMAND_ID;
|
|
90
|
+
CurrentMC.directionType = UPLINK;
|
|
91
|
+
CurrentMC.examples = examples;
|
|
92
|
+
CurrentMC.hasParameters = true;
|
|
93
|
+
export default CurrentMC;
|
|
94
|
+
//# sourceMappingURL=CurrentMC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrentMC.js","sourceRoot":"","sources":["../../../src/commands/uplink/CurrentMC.ts"],"names":[],"mappings":"AAAA,OAAO,OAA8B,MAAM,kBAAkB,CAAC;AAC9D,OAAO,mBAAoC,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,+BAA+B,CAAC;AAUrD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,oFAAoF;AACpF,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAC;gBACtB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;gBACrB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACxB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAC;KACnD;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,UAAU,EAAE;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;aACxB;SACJ;QACD,GAAG,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO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G,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,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;;AAhCM,YAAE,GAAG,UAAU,CAAC;AAEP,uBAAa,GAAG,MAAM,CAAC;AAEvB,kBAAQ,GAAG,QAAQ,CAAC;AAEpB,uBAAa,GAAG,IAAI,CAAC;AA8BzC,eAAe,SAAS,CAAC"}
|
|
@@ -1,16 +1,45 @@
|
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
1
2
|
import { TTime2000 } from '../../utils/time.js';
|
|
2
|
-
import
|
|
3
|
+
import CurrentMC, { ICurrentMCParameters } from './CurrentMC.js';
|
|
3
4
|
/**
|
|
4
5
|
* DataDayMC command parameters.
|
|
5
6
|
*/
|
|
6
|
-
interface IDataDayMCParameters extends
|
|
7
|
+
interface IDataDayMCParameters extends ICurrentMCParameters {
|
|
7
8
|
startTime: TTime2000;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Uplink command.
|
|
12
|
+
*
|
|
13
|
+
* @example create command instance from command body hex dump
|
|
14
|
+
* ```js
|
|
15
|
+
* import DataDayMC from 'jooby-codec/commands/uplink/DataDayMC';
|
|
16
|
+
*
|
|
17
|
+
* const commandBody = new Uint8Array([
|
|
18
|
+
* 0x2f, 0x97, 0xaa, 0x01, 0x0c, 0x83, 0x01, 0x08, 0x0a
|
|
19
|
+
* ]);
|
|
20
|
+
* const command = DataDayMC.fromBytes(commandBody);
|
|
21
|
+
*
|
|
22
|
+
* console.log(command.parameters);
|
|
23
|
+
* // output:
|
|
24
|
+
* {
|
|
25
|
+
* startTime: 756604800,
|
|
26
|
+
* channelList: [
|
|
27
|
+
* {value: 131, index: 3},
|
|
28
|
+
* {value: 8, index: 5},
|
|
29
|
+
* {value: 10, index: 7},
|
|
30
|
+
* {value: 12, index: 1}
|
|
31
|
+
* ]
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/DataDayMC.md#event)
|
|
36
|
+
*/
|
|
37
|
+
declare class DataDayMC extends CurrentMC {
|
|
10
38
|
parameters: IDataDayMCParameters;
|
|
11
39
|
constructor(parameters: IDataDayMCParameters);
|
|
12
40
|
static readonly id = 22;
|
|
13
41
|
static readonly directionType = 2;
|
|
42
|
+
static readonly examples: TCommandExampleList;
|
|
14
43
|
static readonly hasParameters = true;
|
|
15
44
|
static fromBytes(data: Uint8Array): DataDayMC;
|
|
16
45
|
toBytes(): Uint8Array;
|
|
@@ -2,13 +2,55 @@
|
|
|
2
2
|
import Command from '../../Command.js';
|
|
3
3
|
import CommandBinaryBuffer from '../../CommandBinaryBuffer.js';
|
|
4
4
|
import { getSecondsFromDate } from '../../utils/time.js';
|
|
5
|
-
import
|
|
5
|
+
import CurrentMC from './CurrentMC.js';
|
|
6
6
|
import { UPLINK } from '../../constants/directions.js';
|
|
7
7
|
const COMMAND_ID = 0x16;
|
|
8
8
|
// 2 byte for date + 2 for channels (max channels: 7)
|
|
9
9
|
// 4 + (7 * 4)
|
|
10
10
|
const COMMAND_BODY_MAX_SIZE = 32;
|
|
11
|
-
|
|
11
|
+
const examples = [
|
|
12
|
+
{
|
|
13
|
+
name: '4 channels at 2023.12.23 00:00:00 GMT',
|
|
14
|
+
parameters: {
|
|
15
|
+
startTime: 756604800,
|
|
16
|
+
channelList: [
|
|
17
|
+
{ index: 3, value: 131 },
|
|
18
|
+
{ index: 5, value: 8 },
|
|
19
|
+
{ index: 7, value: 10 },
|
|
20
|
+
{ index: 1, value: 12 }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
hex: { header: '16 09', body: '2f 97 aa 01 0c 83 01 08 0a' }
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Uplink command.
|
|
28
|
+
*
|
|
29
|
+
* @example create command instance from command body hex dump
|
|
30
|
+
* ```js
|
|
31
|
+
* import DataDayMC from 'jooby-codec/commands/uplink/DataDayMC';
|
|
32
|
+
*
|
|
33
|
+
* const commandBody = new Uint8Array([
|
|
34
|
+
* 0x2f, 0x97, 0xaa, 0x01, 0x0c, 0x83, 0x01, 0x08, 0x0a
|
|
35
|
+
* ]);
|
|
36
|
+
* const command = DataDayMC.fromBytes(commandBody);
|
|
37
|
+
*
|
|
38
|
+
* console.log(command.parameters);
|
|
39
|
+
* // output:
|
|
40
|
+
* {
|
|
41
|
+
* startTime: 756604800,
|
|
42
|
+
* channelList: [
|
|
43
|
+
* {value: 131, index: 3},
|
|
44
|
+
* {value: 8, index: 5},
|
|
45
|
+
* {value: 10, index: 7},
|
|
46
|
+
* {value: 12, index: 1}
|
|
47
|
+
* ]
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* [Command format documentation](https://github.com/jooby-dev/jooby-docs/blob/main/docs/commands/DataDayMC.md#event)
|
|
52
|
+
*/
|
|
53
|
+
class DataDayMC extends CurrentMC {
|
|
12
54
|
constructor(parameters) {
|
|
13
55
|
super(parameters);
|
|
14
56
|
this.parameters = parameters;
|
|
@@ -18,8 +60,8 @@ class DataDayMC extends GetCurrentMC {
|
|
|
18
60
|
const parameters = { channelList: [], startTime: 0 };
|
|
19
61
|
const buffer = new CommandBinaryBuffer(data);
|
|
20
62
|
const date = buffer.getDate();
|
|
21
|
-
const
|
|
22
|
-
parameters.channelList =
|
|
63
|
+
const channelList = buffer.getChannels();
|
|
64
|
+
parameters.channelList = channelList.map(channelIndex => ({
|
|
23
65
|
value: buffer.getExtendedValue(),
|
|
24
66
|
index: channelIndex
|
|
25
67
|
}));
|
|
@@ -38,6 +80,7 @@ class DataDayMC extends GetCurrentMC {
|
|
|
38
80
|
}
|
|
39
81
|
DataDayMC.id = COMMAND_ID;
|
|
40
82
|
DataDayMC.directionType = UPLINK;
|
|
83
|
+
DataDayMC.examples = examples;
|
|
41
84
|
DataDayMC.hasParameters = true;
|
|
42
85
|
export default DataDayMC;
|
|
43
86
|
//# sourceMappingURL=DataDayMC.js.map
|
|
@@ -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,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC;gBACpB,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAC;gBACrB,EAAC,KAA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AC,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,EAAE;YACR,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,CAAC;YACR,WAAW,EAAE;gBACT,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,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,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;iBACb;aACJ;SACJ;QACD,GAAG,EAAE;YACD,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,aAAa;SACtB;KACJ;CACJ,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,cAAe,SAAQ,OAAO;IAChC,YAAqB,UAAqC;QACtD,KAAK,EAAE,CAAC;QADS,eAAU,GAAV,UAAU,CAA2B;QAGtD,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,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO,IAAI,cAAc,CAAC,EAAC,WAAW,EAAE,MAAM,CAAC,6BAA6B,EAAE,EAAC,CAAC,CAAC;IACrF,CAAC;IAED,0CAA0C;IAC1C,OAAO;QACH,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QAC9D,MAAM,EAAC,WAAW,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtC,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;;AAxBM,iBAAE,GAAG,UAAU,CAAC;AAEP,4BAAa,GAAG,MAAM,CAAC;AAEvB,uBAAQ,GAAG,QAAQ,CAAC;AAEpB,4BAAa,GAAG,IAAI,CAAC;AAsBzC,eAAe,cAAc,CAAC"}
|
|
@@ -1,15 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TCommandExampleList } from '../../Command.js';
|
|
2
|
+
import CurrentMC 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,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,QAAQ,GAAwB;IAClC;QACI,IAAI,EAAE,gDAAgD;QACtD,UAAU,EAAE;YACR,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