@danidoble/webserial 4.4.5 → 4.5.0-alpha.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/boardroid.cjs +1 -1
- package/dist/boardroid.js +4 -3
- package/dist/devices-BndwHuvP.cjs +1 -0
- package/dist/devices-CHc7K4eY.js +67 -0
- package/dist/hopper.cjs +1 -1
- package/dist/hopper.js +1 -1
- package/dist/jofemar.cjs +1 -1
- package/dist/jofemar.js +7 -6
- package/dist/jsd.cjs +1 -0
- package/dist/jsd.js +2443 -0
- package/dist/kernel-As0xv_MS.cjs +1 -0
- package/dist/{kernel-DAorOZat.js → kernel-CFxkp4Nz.js} +147 -204
- package/dist/kernel.cjs +1 -1
- package/dist/kernel.js +4 -3
- package/dist/locker.cjs +1 -1
- package/dist/locker.js +12 -11
- package/dist/pinpad.cjs +11 -11
- package/dist/pinpad.js +684 -639
- package/dist/pinpax.cjs +2 -2
- package/dist/pinpax.js +4 -3
- package/dist/relay.cjs +1 -1
- package/dist/relay.js +8 -7
- package/dist/types/lib/commands/jsd/applications/licensing.d.ts +51 -0
- package/dist/types/lib/commands/jsd/applications/licensing.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/applications/manifest.d.ts +73 -0
- package/dist/types/lib/commands/jsd/applications/manifest.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/applications/vision.d.ts +444 -0
- package/dist/types/lib/commands/jsd/applications/vision.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/licensing/licensingClient.d.ts +34 -0
- package/dist/types/lib/commands/jsd/frames/licensing/licensingClient.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/licensing/opCodes.d.ts +28 -0
- package/dist/types/lib/commands/jsd/frames/licensing/opCodes.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/manifest/manifestClient.d.ts +40 -0
- package/dist/types/lib/commands/jsd/frames/manifest/manifestClient.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/manifest/opCodes.d.ts +28 -0
- package/dist/types/lib/commands/jsd/frames/manifest/opCodes.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/vision/opCodes.d.ts +72 -0
- package/dist/types/lib/commands/jsd/frames/vision/opCodes.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/frames/vision/visionClient.d.ts +336 -0
- package/dist/types/lib/commands/jsd/frames/vision/visionClient.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/protocol/crc16.d.ts +37 -0
- package/dist/types/lib/commands/jsd/protocol/crc16.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/protocol/responseHandler.d.ts +38 -0
- package/dist/types/lib/commands/jsd/protocol/responseHandler.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/protocol/rs232Strategy.d.ts +23 -0
- package/dist/types/lib/commands/jsd/protocol/rs232Strategy.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/protocol/tcpIpStrategy.d.ts +49 -0
- package/dist/types/lib/commands/jsd/protocol/tcpIpStrategy.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/types/LicensingClient.d.ts +32 -0
- package/dist/types/lib/commands/jsd/types/LicensingClient.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/types/jsd.types.d.ts +140 -0
- package/dist/types/lib/commands/jsd/types/jsd.types.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/types/manifestClient.d.ts +40 -0
- package/dist/types/lib/commands/jsd/types/manifestClient.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/types/transport.types.d.ts +29 -0
- package/dist/types/lib/commands/jsd/types/transport.types.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/types/visionClient.types.d.ts +356 -0
- package/dist/types/lib/commands/jsd/types/visionClient.types.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/utils/aplications.d.ts +48 -0
- package/dist/types/lib/commands/jsd/utils/aplications.d.ts.map +1 -0
- package/dist/types/lib/commands/jsd/utils/helpers.d.ts +15 -0
- package/dist/types/lib/commands/jsd/utils/helpers.d.ts.map +1 -0
- package/dist/types/lib/kernel.d.ts.map +1 -0
- package/dist/types/{main.d.ts → lib/main.d.ts} +6 -0
- package/dist/types/lib/main.d.ts.map +1 -0
- package/dist/types/lib/parsers/delimiterTransformer.d.ts +29 -0
- package/dist/types/lib/parsers/delimiterTransformer.d.ts.map +1 -0
- package/dist/types/lib/serial/boardroid.d.ts.map +1 -0
- package/dist/types/lib/serial/hopper.d.ts.map +1 -0
- package/dist/types/lib/serial/jofemar.d.ts.map +1 -0
- package/dist/types/lib/serial/jsd.d.ts +40 -0
- package/dist/types/lib/serial/jsd.d.ts.map +1 -0
- package/dist/types/{serial → lib/serial}/kernel.d.ts +1 -0
- package/dist/types/{serial → lib/serial}/kernel.d.ts.map +1 -1
- package/dist/types/lib/serial/locker.d.ts.map +1 -0
- package/dist/types/lib/serial/pinpad.d.ts.map +1 -0
- package/dist/types/lib/serial/pinpax.d.ts.map +1 -0
- package/dist/types/lib/serial/relay.d.ts.map +1 -0
- package/dist/types/{utils → lib/utils}/devices.d.ts +2 -0
- package/dist/types/lib/utils/devices.d.ts.map +1 -0
- package/dist/types/lib/utils/dispatcher.d.ts.map +1 -0
- package/dist/types/lib/utils/emulator.d.ts.map +1 -0
- package/dist/types/lib/utils/utils.d.ts.map +1 -0
- package/dist/types/test/t.d.ts +2 -0
- package/dist/types/test/t.d.ts.map +1 -0
- package/dist/webserial-core-3UL91lxi.cjs +4 -0
- package/dist/{webserial-core-CiU9IcKf.js → webserial-core-DSv1dX3s.js} +160 -140
- package/dist/webserial.cjs +1 -1
- package/dist/webserial.js +29 -23
- package/package.json +13 -8
- package/dist/kernel-g4zSg1Ll.cjs +0 -1
- package/dist/types/kernel.d.ts.map +0 -1
- package/dist/types/main.d.ts.map +0 -1
- package/dist/types/serial/boardroid.d.ts.map +0 -1
- package/dist/types/serial/hopper.d.ts.map +0 -1
- package/dist/types/serial/jofemar.d.ts.map +0 -1
- package/dist/types/serial/locker.d.ts.map +0 -1
- package/dist/types/serial/pinpad.d.ts.map +0 -1
- package/dist/types/serial/pinpax.d.ts.map +0 -1
- package/dist/types/serial/relay.d.ts.map +0 -1
- package/dist/types/utils/devices.d.ts.map +0 -1
- package/dist/types/utils/dispatcher.d.ts.map +0 -1
- package/dist/types/utils/emulator.d.ts.map +0 -1
- package/dist/types/utils/utils.d.ts.map +0 -1
- package/dist/webserial-core-D49c459A.cjs +0 -4
- /package/dist/types/{kernel.d.ts → lib/kernel.d.ts} +0 -0
- /package/dist/types/{serial → lib/serial}/boardroid.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/hopper.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/jofemar.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/locker.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/pinpad.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/pinpax.d.ts +0 -0
- /package/dist/types/{serial → lib/serial}/relay.d.ts +0 -0
- /package/dist/types/{utils → lib/utils}/dispatcher.d.ts +0 -0
- /package/dist/types/{utils → lib/utils}/emulator.d.ts +0 -0
- /package/dist/types/{utils → lib/utils}/utils.d.ts +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object containing all JSD (Jofemar) Operation Codes for Vision machines.
|
|
3
|
+
* These codes are used to identify the type of command or response in the protocol.
|
|
4
|
+
*/
|
|
5
|
+
export declare const JsdOpCode: {
|
|
6
|
+
readonly requestMachineStatus: 100;
|
|
7
|
+
readonly requestStatusChannel: 101;
|
|
8
|
+
readonly requestStatusSelection: 102;
|
|
9
|
+
readonly configureSelectionDispense: 103;
|
|
10
|
+
readonly addChannelToSelection: 104;
|
|
11
|
+
readonly requestMachineIdentification: 105;
|
|
12
|
+
readonly programWorkingTemperature: 106;
|
|
13
|
+
readonly programWaitingTimings: 107;
|
|
14
|
+
readonly resetSoldOutChannels: 108;
|
|
15
|
+
readonly programTimeWaitingAfterPickup: 109;
|
|
16
|
+
readonly requestJSDVersion: 110;
|
|
17
|
+
readonly requestFaultMachine: 111;
|
|
18
|
+
readonly manageJSDDispensingQueue: 112;
|
|
19
|
+
readonly defineSpecialCharacteristicsSelection: 113;
|
|
20
|
+
readonly configurePerishableProducts: 114;
|
|
21
|
+
readonly requestActiveFaults: 115;
|
|
22
|
+
readonly configureExtendedDispenseStatusData: 116;
|
|
23
|
+
readonly requestStatusTrayPositioningPhototransistors: 117;
|
|
24
|
+
readonly dispenseFromChannel: 150;
|
|
25
|
+
readonly dispenseFromSelection: 151;
|
|
26
|
+
readonly controlLights: 152;
|
|
27
|
+
readonly resetFaultsAndSelfTest: 153;
|
|
28
|
+
readonly performCollectCycle: 154;
|
|
29
|
+
readonly dispenseFromChannelExtended: 155;
|
|
30
|
+
readonly restartingTheJSDKnowingThatItIsDangerous: 156;
|
|
31
|
+
readonly responseFormatCmdWrong: 200;
|
|
32
|
+
readonly responseMachineStatus: 201;
|
|
33
|
+
readonly responseStatusChannel: 202;
|
|
34
|
+
readonly responseStatusSelection: 203;
|
|
35
|
+
readonly responseDispenseStatus: 204;
|
|
36
|
+
readonly responseConfigurationSelectionDispense: 205;
|
|
37
|
+
readonly responseConfigurationChannelsLinkedToSelection: 206;
|
|
38
|
+
readonly responseMachineIdentification: 207;
|
|
39
|
+
readonly responseCurrentTemperature: 208;
|
|
40
|
+
readonly responseReportEventsAlarmsAndFaults: 209;
|
|
41
|
+
readonly responseNewTimingWaitingForProductCollection: 210;
|
|
42
|
+
readonly responsePerformingProductCollectionCycle: 211;
|
|
43
|
+
readonly responseResetMachineSoldOutChannels: 212;
|
|
44
|
+
readonly responseNewTimingWaitingAfterProductCollection: 213;
|
|
45
|
+
readonly responseJSDVersion: 214;
|
|
46
|
+
readonly responseActiveFaults: 215;
|
|
47
|
+
readonly responseJSDDispensingQueue: 216;
|
|
48
|
+
readonly responseSpecialCharacteristicsSelection: 217;
|
|
49
|
+
readonly responsePerishableProducts: 218;
|
|
50
|
+
readonly responseActiveFaultsList: 219;
|
|
51
|
+
readonly responseJSDResetStatus: 220;
|
|
52
|
+
readonly responseExtendedDispenseStatusData: 221;
|
|
53
|
+
readonly responseTraysPositioningPhototransistorsStatus: 222;
|
|
54
|
+
readonly jsdErrorLicenseTemporarilyBlocked: 300;
|
|
55
|
+
readonly jsdErrorLicenseNotActive: 301;
|
|
56
|
+
readonly jsdErrorCommandNotExecutable: 302;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Type representing the values of the JsdOpCode object.
|
|
60
|
+
*/
|
|
61
|
+
export type JsdOpCode = (typeof JsdOpCode)[keyof typeof JsdOpCode];
|
|
62
|
+
/**
|
|
63
|
+
* Exported constant containing the JsdOpCode object.
|
|
64
|
+
*/
|
|
65
|
+
export declare const OP_CODES: typeof JsdOpCode;
|
|
66
|
+
/**
|
|
67
|
+
* Key Helper Data Types
|
|
68
|
+
* @param value number
|
|
69
|
+
* @returns string
|
|
70
|
+
*/
|
|
71
|
+
export declare const opCodeName: (value: number) => string;
|
|
72
|
+
//# sourceMappingURL=opCodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opCodes.d.ts","sourceRoot":"","sources":["../../../../../../../lib/commands/jsd/frames/vision/opCodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDZ,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,OAAO,SAAqB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAG3C,CAAC"}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import type { TransportProtocol, ValidMachineIndex } from '../../types/transport.types';
|
|
2
|
+
import type { AddChannelToSelectionOptions, ChannelLinkedToSelectionOptions, ConfigureExtendedDispenseStatusDataOptions, ConfigurePerishableProductsOptions, ConfigureSelectionDispenseOptions, ControlLightsOptions, DefineSpecialCharacteristicsSelectionOptions, DispenseFromChannelExtendedOptions, DispenseFromChannelOptions, DispenseFromSelectionOptions, DispenseStatusOptions, GeneralMachine, ProgramTimeWaitingAfterPickupOptions, ProgramWaitingTimingsOptions, ProgramWorkingTemperatureOptions, RequestStatusOptions, RequestStatusSelectionOptions, SpecialCharacteristicsSelectionOptions } from '../../types/visionClient.types';
|
|
3
|
+
import { BuildPacketResult } from '../../types/jsd.types';
|
|
4
|
+
/**
|
|
5
|
+
* High-Level Client for Vision Machines.
|
|
6
|
+
* It is agnostic to the transport layer (RS232 or TCP).
|
|
7
|
+
*/
|
|
8
|
+
export declare class VisionClient {
|
|
9
|
+
private transport;
|
|
10
|
+
private static readonly APP_ID;
|
|
11
|
+
constructor(transport: TransportProtocol);
|
|
12
|
+
/**
|
|
13
|
+
* Alias to Opcode 100: Connection command (no data).
|
|
14
|
+
* @param options Object containing the machine index and transport protocol.
|
|
15
|
+
* @param options.machine Machine index (0-3).
|
|
16
|
+
* @param options.transport Transport protocol instance to use.
|
|
17
|
+
* @returns The generated packet as a number array.
|
|
18
|
+
*/
|
|
19
|
+
static connection({ transport, packetId, }: {
|
|
20
|
+
transport: TransportProtocol;
|
|
21
|
+
packetId?: number;
|
|
22
|
+
}): BuildPacketResult;
|
|
23
|
+
/**
|
|
24
|
+
* Opcode 100: Request machine status.
|
|
25
|
+
* @param options Object containing the machine index.
|
|
26
|
+
* @param options.machine Machine index (0-3).
|
|
27
|
+
* @returns The generated packet as a number array.
|
|
28
|
+
*/
|
|
29
|
+
requestMachineStatus({ machine }: GeneralMachine): BuildPacketResult;
|
|
30
|
+
/**
|
|
31
|
+
* Opcode 101: Request status of a specific channel.
|
|
32
|
+
* @param options Object containing the options.
|
|
33
|
+
* @param options.machine Machine index (0-3).
|
|
34
|
+
* @param options.tray Tray number (11-18).
|
|
35
|
+
* @param options.channel Channel number (0-9).
|
|
36
|
+
* @returns The generated packet as a number array.
|
|
37
|
+
*/
|
|
38
|
+
requestStatusChannel({ machine, tray, channel }: RequestStatusOptions): BuildPacketResult;
|
|
39
|
+
/**
|
|
40
|
+
* Opcode 102: Request status of a specific selection.
|
|
41
|
+
* @param options Object containing the options.
|
|
42
|
+
* @param options.selection Selection number (1-240).
|
|
43
|
+
* @returns The generated packet as a number array.
|
|
44
|
+
*/
|
|
45
|
+
requestStatusSelection({ selection }: RequestStatusSelectionOptions): BuildPacketResult;
|
|
46
|
+
/**
|
|
47
|
+
* Configure dispense parameters for a selection.
|
|
48
|
+
* @param options Object containing the options.
|
|
49
|
+
* @param options.selection Selection number (1-240).
|
|
50
|
+
* @param options.speed Speed of the dispense engine (0-21).
|
|
51
|
+
* @param options.timePostRun Time post run (0-255).
|
|
52
|
+
* @returns The generated packet as a number array.
|
|
53
|
+
*/
|
|
54
|
+
configureSelectionDispense({ selection, speed, timePostRun, }: ConfigureSelectionDispenseOptions): BuildPacketResult;
|
|
55
|
+
/**
|
|
56
|
+
* Get current dispense configuration for a selection.
|
|
57
|
+
* @param options Object containing the options.
|
|
58
|
+
* @param options.machine Machine index (0-3).
|
|
59
|
+
* @returns The generated packet as a number array.
|
|
60
|
+
*/
|
|
61
|
+
getSelectionDispenseConfig({ machine }: GeneralMachine): BuildPacketResult;
|
|
62
|
+
/**
|
|
63
|
+
* Request to add a channel to a selection.
|
|
64
|
+
* @param options Object containing the options.
|
|
65
|
+
* @param options.selection Selection number (1-240).
|
|
66
|
+
* @param options.machine Machine index (0-3).
|
|
67
|
+
* @param options.tray Tray number (11-18).
|
|
68
|
+
* @param options.channel Channel number (0-9).
|
|
69
|
+
* @returns The generated packet as a number array.
|
|
70
|
+
*/
|
|
71
|
+
addChannelToSelection({ selection, machine, tray, channel }: AddChannelToSelectionOptions): BuildPacketResult;
|
|
72
|
+
/**
|
|
73
|
+
* Get channels linked to a selection.
|
|
74
|
+
* @param options Object containing the options.
|
|
75
|
+
* @param options.selection Selection number (1-240).
|
|
76
|
+
* @returns The generated packet as a number array.
|
|
77
|
+
*/
|
|
78
|
+
getChannelsLinkedToSelection({ selection }: ChannelLinkedToSelectionOptions): BuildPacketResult;
|
|
79
|
+
/**
|
|
80
|
+
* Request machine identification.
|
|
81
|
+
* @param options Object containing the options.
|
|
82
|
+
* @param options.machine Machine index (0-3).
|
|
83
|
+
* @returns The generated packet as a number array.
|
|
84
|
+
*/
|
|
85
|
+
requestMachineIdentification({ machine }: GeneralMachine): BuildPacketResult;
|
|
86
|
+
/**
|
|
87
|
+
* Format temperature to +05.0 or -03.5
|
|
88
|
+
* @param temperature The temperature value to format.
|
|
89
|
+
* @returns The formatted date string (5 characters).
|
|
90
|
+
*/
|
|
91
|
+
private formatTemperature;
|
|
92
|
+
/**
|
|
93
|
+
* Program working temperature.
|
|
94
|
+
* @param options Object containing the options.
|
|
95
|
+
* @param options.machine Machine index (0-3).
|
|
96
|
+
* @param options.temperature The target temperature.
|
|
97
|
+
* @param options.enable Boolean indicating if the temperature control should be enabled (true) or disabled (false).
|
|
98
|
+
* @returns The generated packet as a number array.
|
|
99
|
+
*/
|
|
100
|
+
programWorkingTemperature({ machine, temperature, enable, }: ProgramWorkingTemperatureOptions): BuildPacketResult;
|
|
101
|
+
/**
|
|
102
|
+
* Get working temperature.
|
|
103
|
+
* @param options Object containing the options.
|
|
104
|
+
* @param options.machine Machine index (0-3).
|
|
105
|
+
* @returns The generated packet as a number array.
|
|
106
|
+
*/
|
|
107
|
+
getWorkingTemperature({ machine }: GeneralMachine): BuildPacketResult;
|
|
108
|
+
/**
|
|
109
|
+
* Program waiting timings.
|
|
110
|
+
* @param options Object containing the options.
|
|
111
|
+
* @param options.collectPosition Time for collect position (1-10).
|
|
112
|
+
* @param options.dispenseManoeuvres Time for dispense manoeuvres (0-65).
|
|
113
|
+
* @param options.afterPickup Time waiting after pickup (1-255).
|
|
114
|
+
* @returns The generated packet as a number array.
|
|
115
|
+
*/
|
|
116
|
+
programWaitingTimings({ collectPosition, dispenseManoeuvres, afterPickup, }: ProgramWaitingTimingsOptions): BuildPacketResult;
|
|
117
|
+
/**
|
|
118
|
+
* Get waiting timings.
|
|
119
|
+
* @returns The generated packet as a number array.
|
|
120
|
+
*/
|
|
121
|
+
getWaitingTimings(): BuildPacketResult;
|
|
122
|
+
/**
|
|
123
|
+
* Reset sold-out status for all channels in a machine.
|
|
124
|
+
* @param options Object containing the options.
|
|
125
|
+
* @param options.machine Machine index (0-3).
|
|
126
|
+
* @returns The generated packet as a number array.
|
|
127
|
+
*/
|
|
128
|
+
resetSoldOutChannels({ machine }: GeneralMachine): BuildPacketResult;
|
|
129
|
+
/**
|
|
130
|
+
* Program time waiting after pickup.
|
|
131
|
+
* @param options Object containing the options.
|
|
132
|
+
* @param options.time Time in seconds (15-120).
|
|
133
|
+
* @returns The generated packet as a number array.
|
|
134
|
+
*/
|
|
135
|
+
programTimeWaitingAfterPickup({ time }: ProgramTimeWaitingAfterPickupOptions): BuildPacketResult;
|
|
136
|
+
/**
|
|
137
|
+
* Get time waiting after pickup.
|
|
138
|
+
* @returns The generated packet as a number array.
|
|
139
|
+
*/
|
|
140
|
+
getTimeWaitingAfterPickup(): BuildPacketResult;
|
|
141
|
+
/**
|
|
142
|
+
* Opcode 110: Request JSD firmware version.
|
|
143
|
+
* Data: None.
|
|
144
|
+
* @returns The generated packet as a number array.
|
|
145
|
+
*/
|
|
146
|
+
requestJSDVersion(): BuildPacketResult;
|
|
147
|
+
/**
|
|
148
|
+
* Opcode 111: Request or clear machine faults.
|
|
149
|
+
* @param options Object containing the options.
|
|
150
|
+
* @param options.machine Machine index (0-3).
|
|
151
|
+
* @param options.type Type of operation: 'report-active', 'report-inactive', or 'clear-inactive'.
|
|
152
|
+
* @returns The generated packet as a number array.
|
|
153
|
+
*/
|
|
154
|
+
private requestFaultMachine;
|
|
155
|
+
/**
|
|
156
|
+
* Request report of active faults.
|
|
157
|
+
* @param machine Machine index (0-3).
|
|
158
|
+
* @returns The generated packet as a number array.
|
|
159
|
+
*/
|
|
160
|
+
requestReportActiveFaults(machine: ValidMachineIndex): BuildPacketResult;
|
|
161
|
+
/**
|
|
162
|
+
* Request report of inactive faults.
|
|
163
|
+
* @param machine Machine index (0-3).
|
|
164
|
+
* @returns The generated packet as a number array.
|
|
165
|
+
*/
|
|
166
|
+
requestReportInactiveFaults(machine: ValidMachineIndex): BuildPacketResult;
|
|
167
|
+
/**
|
|
168
|
+
* Request to clear inactive faults.
|
|
169
|
+
* @param machine Machine index (0-3).
|
|
170
|
+
* @returns The generated packet as a number array.
|
|
171
|
+
*/
|
|
172
|
+
requestClearInactiveFaults(machine: ValidMachineIndex): BuildPacketResult;
|
|
173
|
+
/**
|
|
174
|
+
* Manage JSD dispensations requested list (product petitions queue).
|
|
175
|
+
* @param options Object containing the options.
|
|
176
|
+
* @param options.type Type of operation (0 = Request status, 1 = Clear queue).
|
|
177
|
+
* @returns The generated packet as a number array.
|
|
178
|
+
*/
|
|
179
|
+
private manageJSDDispensingQueue;
|
|
180
|
+
/**
|
|
181
|
+
* Request JSD dispensing queue status.
|
|
182
|
+
* @returns The generated packet as a number array.
|
|
183
|
+
*/
|
|
184
|
+
requestJSDDispensingQueueStatus(): BuildPacketResult;
|
|
185
|
+
/**
|
|
186
|
+
* Clear JSD dispensing queue.
|
|
187
|
+
* @returns The generated packet as a number array.
|
|
188
|
+
*/
|
|
189
|
+
clearJSDDispensingQueue(): BuildPacketResult;
|
|
190
|
+
/**
|
|
191
|
+
* Define special characteristics for a selection.
|
|
192
|
+
* @param options Object containing the options.
|
|
193
|
+
* @param options.selection Selection number (1-240).
|
|
194
|
+
* @param options.perishable Boolean indicating if the product is perishable.
|
|
195
|
+
* @param options.fragileOrHeavy Boolean [false=standard, true=fragile/heavy] (if fragileOrHeavy is true, multidispense is disabled).
|
|
196
|
+
* @param options.typeAdjustElevator Type of elevator adjustment ('lower' | 'upper').
|
|
197
|
+
* @param options.timeAdjustElevator Time for elevator adjustment (in ms).
|
|
198
|
+
* @returns The generated packet as a number array.
|
|
199
|
+
*/
|
|
200
|
+
defineSpecialCharacteristicsSelection({ selection, perishable, fragileOrHeavy, typeAdjustElevator, timeAdjustElevator, }: DefineSpecialCharacteristicsSelectionOptions): BuildPacketResult;
|
|
201
|
+
/**
|
|
202
|
+
* Get special characteristics for a selection.
|
|
203
|
+
* @param options Object containing the options.
|
|
204
|
+
* @param options.selection Selection number (1-240).
|
|
205
|
+
* @returns The generated packet as a number array.
|
|
206
|
+
*/
|
|
207
|
+
getSpecialCharacteristicsSelection({ selection }: SpecialCharacteristicsSelectionOptions): BuildPacketResult;
|
|
208
|
+
/**
|
|
209
|
+
* Configure perishable products settings for a machine.
|
|
210
|
+
* @param options Object containing the options.
|
|
211
|
+
* @param options.machine Machine index (0-3).
|
|
212
|
+
* @param options.enable Boolean indicating whether to enable perishable product settings.
|
|
213
|
+
* @param options.temperatureLimit Temperature limit.
|
|
214
|
+
* @param options.minutesToExpiry Minutes to expiry.
|
|
215
|
+
* @returns The generated packet as a number array.
|
|
216
|
+
*/
|
|
217
|
+
configurePerishableProducts({ machine, enable, temperatureLimit, minutesToExpiry, }: ConfigurePerishableProductsOptions): BuildPacketResult;
|
|
218
|
+
/**
|
|
219
|
+
* Request active faults for a machine.
|
|
220
|
+
* @param options Object containing the options.
|
|
221
|
+
* @param options.machine Machine index (0-3).
|
|
222
|
+
* @returns The generated packet as a number array.
|
|
223
|
+
*/
|
|
224
|
+
requestActiveFaults({ machine }: GeneralMachine): BuildPacketResult;
|
|
225
|
+
/**
|
|
226
|
+
* Configure extended dispense status data.
|
|
227
|
+
* @param options Object containing the options.
|
|
228
|
+
* @param options.enable Boolean indicating whether to enable extended dispense status data.
|
|
229
|
+
* @returns The generated packet as a number array.
|
|
230
|
+
*/
|
|
231
|
+
configureExtendedDispenseStatusData({ enable, }: ConfigureExtendedDispenseStatusDataOptions): BuildPacketResult;
|
|
232
|
+
/**
|
|
233
|
+
* Get extended dispense status data configuration.
|
|
234
|
+
* @returns The generated packet as a number array.
|
|
235
|
+
*/
|
|
236
|
+
getExtendedDispenseStatusDataConfig(): BuildPacketResult;
|
|
237
|
+
/**
|
|
238
|
+
* Request the status of the tray positioning phototransistors.
|
|
239
|
+
* @param options Object containing the options.
|
|
240
|
+
* @param options.machine Machine index (0-3).
|
|
241
|
+
* @returns The generated packet as a number array.
|
|
242
|
+
*/
|
|
243
|
+
requestStatusTrayPositioningPhototransistors({ machine }: GeneralMachine): BuildPacketResult;
|
|
244
|
+
/**
|
|
245
|
+
* Request dispense from channel.
|
|
246
|
+
* @param options Object containing the options.
|
|
247
|
+
* @param options.token Token for tracking the request.
|
|
248
|
+
* @param options.machine Machine index (0-3).
|
|
249
|
+
* @param options.tray Tray number (11-18).
|
|
250
|
+
* @param options.channel Channel number (0-9).
|
|
251
|
+
* @param options.speed Speed of the dispense engine (0-21).
|
|
252
|
+
* @param options.timePostRun Time post run (0-255).
|
|
253
|
+
* @returns The generated packet as a number array.
|
|
254
|
+
*/
|
|
255
|
+
dispenseFromChannel({ token, machine, tray, channel, speed, timePostRun, }: DispenseFromChannelOptions): BuildPacketResult;
|
|
256
|
+
/**
|
|
257
|
+
* Get dispense status from channel thought token.
|
|
258
|
+
* @param options Object containing the options.
|
|
259
|
+
* @param options.token Token for tracking the request.
|
|
260
|
+
* @returns The generated packet as a number array.
|
|
261
|
+
*/
|
|
262
|
+
getDispenseStatusFromChannel({ token }: DispenseStatusOptions): BuildPacketResult;
|
|
263
|
+
/**
|
|
264
|
+
* Request dispense from selection.
|
|
265
|
+
* @param options Object containing the options.
|
|
266
|
+
* @param options.token Token for tracking the request.
|
|
267
|
+
* @param options.selection Selection number (1-240).
|
|
268
|
+
* @returns The generated packet as a number array.
|
|
269
|
+
*/
|
|
270
|
+
dispenseFromSelection({ token, selection }: DispenseFromSelectionOptions): BuildPacketResult;
|
|
271
|
+
/**
|
|
272
|
+
* Get dispense status from selection thought token.
|
|
273
|
+
* @param options Object containing the options.
|
|
274
|
+
* @param options.token Token for tracking the request.
|
|
275
|
+
* @returns The generated packet as a number array.
|
|
276
|
+
*/
|
|
277
|
+
getDispenseStatusFromSelection({ token }: DispenseStatusOptions): BuildPacketResult;
|
|
278
|
+
/**
|
|
279
|
+
/**
|
|
280
|
+
* Change lighting status.
|
|
281
|
+
* @param options Object containing the options.
|
|
282
|
+
* @param options.machine Machine index (0-3).
|
|
283
|
+
* @param options.turnOn Boolean indicating whether to turn the lights on (true) or off (false).
|
|
284
|
+
* @returns The generated packet as a number array.
|
|
285
|
+
*/
|
|
286
|
+
controlLights({ machine, turnOn }: ControlLightsOptions): BuildPacketResult;
|
|
287
|
+
/**
|
|
288
|
+
/**
|
|
289
|
+
* Reset faults and perform self-test.
|
|
290
|
+
* @param options Object containing the options.
|
|
291
|
+
* @param options.machine Machine index (0-3).
|
|
292
|
+
* @returns The generated packet as a number array.
|
|
293
|
+
*/
|
|
294
|
+
resetFaultsAndSelfTest({ machine }: GeneralMachine): BuildPacketResult;
|
|
295
|
+
/**
|
|
296
|
+
/**
|
|
297
|
+
* Perform collect cycle.
|
|
298
|
+
* @param options Object containing the options.
|
|
299
|
+
* @param options.machine Machine index (0-3).
|
|
300
|
+
* @returns The generated packet as a number array.
|
|
301
|
+
*/
|
|
302
|
+
performCollectCycle({ machine }: GeneralMachine): BuildPacketResult;
|
|
303
|
+
/**
|
|
304
|
+
/**
|
|
305
|
+
* Request dispense from channel with extended options.
|
|
306
|
+
* @param options Object containing the extended dispense options.
|
|
307
|
+
* @param options.token Token for tracking the request.
|
|
308
|
+
* @param options.machine Machine index (0-3).
|
|
309
|
+
* @param options.tray Tray number (11-18).
|
|
310
|
+
* @param options.channel Channel number (0-9).
|
|
311
|
+
* @param options.speed Speed of the dispense engine (0-21).
|
|
312
|
+
* @param options.timePostRun Time post run (0-255).
|
|
313
|
+
* @param options.fragileOrHeavy Boolean indicating if the product is fragile or heavy.
|
|
314
|
+
* @param options.typeAdjustElevator Type of elevator adjustment ('lower' | 'upper').
|
|
315
|
+
* @param options.timeAdjustElevator Time for elevator adjustment (in ms).
|
|
316
|
+
* @returns The generated packet as a number array.
|
|
317
|
+
*/
|
|
318
|
+
dispenseFromChannelExtended({ token, machine, tray, channel, speed, timePostRun, fragileOrHeavy, typeAdjustElevator, timeAdjustElevator, }: DispenseFromChannelExtendedOptions): BuildPacketResult;
|
|
319
|
+
/**
|
|
320
|
+
/**
|
|
321
|
+
* Get dispense status from channel with extended options using a token.
|
|
322
|
+
* @param options Object containing the options.
|
|
323
|
+
* @param options.token Token for tracking the request.
|
|
324
|
+
* @returns The generated packet as a number array.
|
|
325
|
+
*/
|
|
326
|
+
getDispenseStatusFromChannelExtended({ token }: DispenseStatusOptions): BuildPacketResult;
|
|
327
|
+
/**
|
|
328
|
+
* Request for a complete JSD reset.
|
|
329
|
+
* VERY IMPORTANT: the JSD will respond with Opcode 220. Once received by the JSD, it will perform a total
|
|
330
|
+
* reset without taking care of the machine's current situation (manoeuvres, dispenses, etc.).
|
|
331
|
+
* This must not be used for solving anything and must be used thinking about the possible consequences.
|
|
332
|
+
* @returns The generated packet as a number array.
|
|
333
|
+
*/
|
|
334
|
+
restartingTheJSDKnowingThatItIsDangerous(): BuildPacketResult;
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=visionClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visionClient.d.ts","sourceRoot":"","sources":["../../../../../../../lib/commands/jsd/frames/vision/visionClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,0CAA0C,EAC1C,kCAAkC,EAClC,iCAAiC,EACjC,oBAAoB,EACpB,4CAA4C,EAC5C,kCAAkC,EAClC,0BAA0B,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AI,EACJ,OAAO,EACP,KAAK,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,EAAE,kCAAkC,GAAG,iBAAiB;IAQzD;;;;;;OAMG;IACI,oCAAoC,CAAC,EAAE,KAAK,EAAE,EAAE,qBAAqB,GAAG,iBAAiB;IAKhG;;;;;;OAMG;IACI,wCAAwC,IAAI,iBAAiB;CAIrE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRC-16 Calculator for JSD Protocol
|
|
3
|
+
* "The polynomic to be used is 0x8005"
|
|
4
|
+
*
|
|
5
|
+
* Configuration flags for testing different firmware versions:
|
|
6
|
+
* - USE_BIG_ENDIAN: byte order (true = Big Endian, false = Little Endian)
|
|
7
|
+
* - USE_REFLECTED: CRC algorithm type (true = reflected/LSB-first, false = non-reflected/MSB-first)
|
|
8
|
+
*/
|
|
9
|
+
export declare class CRC16 {
|
|
10
|
+
/**
|
|
11
|
+
* Byte order configuration
|
|
12
|
+
* - true: Big Endian (high byte first) - Current JSD firmware
|
|
13
|
+
* - false: Little Endian (low byte first)
|
|
14
|
+
*/
|
|
15
|
+
private static readonly USE_BIG_ENDIAN;
|
|
16
|
+
/**
|
|
17
|
+
* CRC algorithm type
|
|
18
|
+
* - false: Non-reflected/MSB-first with polynomial 0x8005 - Current JSD firmware
|
|
19
|
+
* - true: Reflected/LSB-first with polynomial 0xA001 (reflected 0x8005)
|
|
20
|
+
*/
|
|
21
|
+
private static readonly USE_REFLECTED;
|
|
22
|
+
/**
|
|
23
|
+
* Calculate CRC-16 based on configuration flags.
|
|
24
|
+
* @param bytes - Array of bytes to calculate CRC for.
|
|
25
|
+
* @returns [firstByte, secondByte] - Order depends on USE_BIG_ENDIAN setting.
|
|
26
|
+
*/
|
|
27
|
+
static calculate(bytes: number[]): [number, number];
|
|
28
|
+
/**
|
|
29
|
+
* Get current configuration info (for debugging).
|
|
30
|
+
* @returns Object containing configuration flags.
|
|
31
|
+
*/
|
|
32
|
+
static getConfig(): {
|
|
33
|
+
bigEndian: boolean;
|
|
34
|
+
reflected: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=crc16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crc16.d.ts","sourceRoot":"","sources":["../../../../../../lib/commands/jsd/protocol/crc16.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,KAAK;IAChB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAQ;IAE9C;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAS;IAE9C;;;;OAIG;WACW,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAiC1D;;;OAGG;WACW,SAAS,IAAI;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE;CAMtE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structure of the processed result.
|
|
3
|
+
* @property type - Type of response (ACK, NACK, or DATA).
|
|
4
|
+
* @property id - Packet ID.
|
|
5
|
+
* @property opcode - Opcode of the response (optional).
|
|
6
|
+
* @property params - Array of parameters (optional).
|
|
7
|
+
* @property rawAscii - Raw ASCII string (optional).
|
|
8
|
+
*/
|
|
9
|
+
export interface VisionResponse {
|
|
10
|
+
type: 'ACK' | 'NACK' | 'DATA';
|
|
11
|
+
id: number;
|
|
12
|
+
opcode?: number;
|
|
13
|
+
appId?: number;
|
|
14
|
+
noBytes?: number;
|
|
15
|
+
params?: string[];
|
|
16
|
+
rawAscii?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Response Handler for JSD Protocol
|
|
20
|
+
* Parses frames received from the JSD device
|
|
21
|
+
*/
|
|
22
|
+
export declare class ResponseHandler {
|
|
23
|
+
/**
|
|
24
|
+
* Reverse Transparency (Byte Destuffing).
|
|
25
|
+
* Converts 0xDB,0xDC -> 0xC0 and 0xDB,0xDD -> 0xDB.
|
|
26
|
+
* @param escapedBytes - Array of bytes or Buffer with escaped characters.
|
|
27
|
+
* @returns Array of numbers with unescaped bytes.
|
|
28
|
+
*/
|
|
29
|
+
private static unescapeBytes;
|
|
30
|
+
/**
|
|
31
|
+
* Parses a raw received frame.
|
|
32
|
+
* Automatically strips 0xC0 flags if present at the beginning/end.
|
|
33
|
+
* @param rawFrame - Raw bytes received from JSD device.
|
|
34
|
+
* @returns Parsed response object or error message string if invalid.
|
|
35
|
+
*/
|
|
36
|
+
static parseFrame(rawFrame: number[] | Uint8Array): VisionResponse | string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=responseHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseHandler.d.ts","sourceRoot":"","sources":["../../../../../../lib/commands/jsd/protocol/responseHandler.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAuB5B;;;;;OAKG;WACW,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM;CAoEnF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BuildPacketResult } from '../types/jsd.types';
|
|
2
|
+
import { TcpIpStrategy } from './tcpIpStrategy';
|
|
3
|
+
/**
|
|
4
|
+
* RS232 Transport Strategy for JSD Protocol.
|
|
5
|
+
* Structure: [Start Flag] [Escaped(Code + ID + Data + CRC)] [End Flag].
|
|
6
|
+
* Data format: ASCII string "Opcode,Args" (e.g., "100,0").
|
|
7
|
+
*/
|
|
8
|
+
export declare class Rs232Strategy extends TcpIpStrategy {
|
|
9
|
+
protected packetIdCounter: number;
|
|
10
|
+
protected _name: string;
|
|
11
|
+
get packetId(): number;
|
|
12
|
+
_overridePacketId(packetId: number): void;
|
|
13
|
+
private getNextPacketId;
|
|
14
|
+
/**
|
|
15
|
+
* Build a packet for RS232 transport.
|
|
16
|
+
* @param opcode - Operation code.
|
|
17
|
+
* @param args - Arguments string.
|
|
18
|
+
* @param APP_ID - Application ID.
|
|
19
|
+
* @returns Array of numbers representing the packet.
|
|
20
|
+
*/
|
|
21
|
+
buildPacket(opcode: number, args: string, APP_ID: number): BuildPacketResult;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=rs232Strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rs232Strategy.d.ts","sourceRoot":"","sources":["../../../../../../lib/commands/jsd/protocol/rs232Strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAC9C,SAAS,CAAC,eAAe,SAAQ;IACjC,SAAS,CAAC,KAAK,SAAW;IAE1B,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAEM,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIhD,OAAO,CAAC,eAAe;IAOvB;;;;;;OAMG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB;CAgBpF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BuildPacketResult } from '../types/jsd.types';
|
|
2
|
+
import { TransportProtocol } from '../types/transport.types';
|
|
3
|
+
/**
|
|
4
|
+
* TCP/IP Transport Strategy for JSD Protocol.
|
|
5
|
+
* Structure: [NumBytes(2)] [AppID(2)] [Opcode(2)] [Data(n)].
|
|
6
|
+
* All headers are Little Endian (low byte first, high byte second).
|
|
7
|
+
* No Flags, No CRC, No Escaping - TCP handles error correction.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TcpIpStrategy implements TransportProtocol {
|
|
10
|
+
/**
|
|
11
|
+
* Application ID for Vision Machines (Snacks, PPEs, Supplies, Medicines, etc.)
|
|
12
|
+
* Each Jofemar application has its specific protocol and application number
|
|
13
|
+
* APP_ID = 402 → Vision
|
|
14
|
+
* APP_ID = 601 → Manifest & Log of events
|
|
15
|
+
* @see APP_NO
|
|
16
|
+
*/
|
|
17
|
+
protected _name: string;
|
|
18
|
+
get name(): string;
|
|
19
|
+
get packetId(): number;
|
|
20
|
+
_overridePacketId(packetId: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* Convert number to 2 bytes Little Endian.
|
|
23
|
+
* Example: 10000 → 0x2710 → [0x10, 0x27].
|
|
24
|
+
* @param val - Number to convert.
|
|
25
|
+
* @returns Tuple of two numbers [lowByte, highByte].
|
|
26
|
+
*/
|
|
27
|
+
private toLittleEndian;
|
|
28
|
+
/**
|
|
29
|
+
* Build a packet for TCP/IP transport.
|
|
30
|
+
* @param opcode - Operation code.
|
|
31
|
+
* @param args - Arguments string.
|
|
32
|
+
* @param APP_ID - Application ID.
|
|
33
|
+
* @returns Array of numbers representing the packet.
|
|
34
|
+
*/
|
|
35
|
+
buildPacket(opcode: number, args: string, APP_ID: number): BuildPacketResult;
|
|
36
|
+
/**
|
|
37
|
+
* Transparency (Byte Stuffing): 0xC0 -> 0xDB, 0xDC | 0xDB -> 0xDB, 0xDD.
|
|
38
|
+
* @param bytes - Array of bytes to escape.
|
|
39
|
+
* @returns Array of escaped bytes.
|
|
40
|
+
*/
|
|
41
|
+
protected escapeBytes(bytes: number[]): number[];
|
|
42
|
+
/**
|
|
43
|
+
* Build an Acknowledge (ACK) packet.
|
|
44
|
+
* @param packetId - Packet ID to acknowledge.
|
|
45
|
+
* @returns Array of numbers representing the ACK packet.
|
|
46
|
+
*/
|
|
47
|
+
buildAckPacket(packetId: number): number[];
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=tcpIpStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcpIpStrategy.d.ts","sourceRoot":"","sources":["../../../../../../lib/commands/jsd/protocol/tcpIpStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,iBAAiB;IACrD;;;;;;OAMG;IAEH,SAAS,CAAC,KAAK,SAAW;IAE1B,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,QAAQ,IAAI,MAAM,CAG5B;IAEM,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMhD;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;;OAMG;IACI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAuBnF;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAUhD;;;;OAIG;IACI,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;CAalD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Events emitted by the Licensing application.
|
|
3
|
+
*/
|
|
4
|
+
export interface LicensingEvents {
|
|
5
|
+
'wrong-cmd': [
|
|
6
|
+
data: {
|
|
7
|
+
opcodeName: string;
|
|
8
|
+
opcode: number;
|
|
9
|
+
params: string[];
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
'feature-status': [
|
|
13
|
+
data: {
|
|
14
|
+
feature: string;
|
|
15
|
+
active: boolean;
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
seed: [
|
|
19
|
+
data: {
|
|
20
|
+
seed: string;
|
|
21
|
+
hex: string;
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
'temporary-license-status': [
|
|
25
|
+
data: {
|
|
26
|
+
status: string;
|
|
27
|
+
remainingDays: number;
|
|
28
|
+
daysSinceExpiration: number;
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=LicensingClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LicensingClient.d.ts","sourceRoot":"","sources":["../../../../../../lib/commands/jsd/types/LicensingClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE;QACX,IAAI,EAAE;YACJ,UAAU,EAAE,MAAM,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,EAAE,CAAC;SAClB;KACF,CAAC;IACF,gBAAgB,EAAE;QAChB,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,MAAM,EAAE,OAAO,CAAC;SACjB;KACF,CAAC;IACF,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;SACb;KACF,CAAC;IACF,0BAA0B,EAAE;QAC1B,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM,CAAC;YACf,aAAa,EAAE,MAAM,CAAC;YACtB,mBAAmB,EAAE,MAAM,CAAC;SAC7B;KACF,CAAC;CACH"}
|