@robotical/raftjs 2.1.0 → 2.1.3
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/devdocs/devbin-backwards-compatibility.md +105 -0
- package/devdocs/pseudocode-to-js-transpiler.md +563 -0
- package/dist/react-native/PseudocodeTranspiler.d.ts +6 -0
- package/dist/react-native/PseudocodeTranspiler.js +115 -0
- package/dist/react-native/PseudocodeTranspiler.js.map +1 -0
- package/dist/react-native/RaftAttributeHandler.d.ts +1 -1
- package/dist/react-native/RaftAttributeHandler.js +108 -32
- package/dist/react-native/RaftAttributeHandler.js.map +1 -1
- package/dist/react-native/RaftChannelBLE.web.d.ts +4 -0
- package/dist/react-native/RaftChannelBLE.web.js +59 -21
- package/dist/react-native/RaftChannelBLE.web.js.map +1 -1
- package/dist/react-native/RaftChannelSimulated.d.ts +1 -0
- package/dist/react-native/RaftChannelSimulated.js +9 -5
- package/dist/react-native/RaftChannelSimulated.js.map +1 -1
- package/dist/react-native/RaftChannelWebSocket.js +16 -1
- package/dist/react-native/RaftChannelWebSocket.js.map +1 -1
- package/dist/react-native/RaftConnector.d.ts +29 -1
- package/dist/react-native/RaftConnector.js +177 -11
- package/dist/react-native/RaftConnector.js.map +1 -1
- package/dist/react-native/RaftCustomAttrHandler.d.ts +2 -2
- package/dist/react-native/RaftCustomAttrHandler.js +32 -44
- package/dist/react-native/RaftCustomAttrHandler.js.map +1 -1
- package/dist/react-native/RaftDeviceInfo.d.ts +18 -0
- package/dist/react-native/RaftDeviceInfo.js +8 -0
- package/dist/react-native/RaftDeviceInfo.js.map +1 -1
- package/dist/react-native/RaftDeviceManager.d.ts +30 -3
- package/dist/react-native/RaftDeviceManager.js +618 -107
- package/dist/react-native/RaftDeviceManager.js.map +1 -1
- package/dist/react-native/RaftDeviceMgrIF.d.ts +11 -2
- package/dist/react-native/RaftDeviceStates.d.ts +27 -3
- package/dist/react-native/RaftDeviceStates.js +31 -6
- package/dist/react-native/RaftDeviceStates.js.map +1 -1
- package/dist/react-native/RaftFileHandler.d.ts +1 -1
- package/dist/react-native/RaftFileHandler.js +101 -34
- package/dist/react-native/RaftFileHandler.js.map +1 -1
- package/dist/react-native/RaftMicroPythonConsoleClient.d.ts +38 -0
- package/dist/react-native/RaftMicroPythonConsoleClient.js +45 -0
- package/dist/react-native/RaftMicroPythonConsoleClient.js.map +1 -0
- package/dist/react-native/RaftMsgHandler.d.ts +1 -1
- package/dist/react-native/RaftMsgHandler.js +6 -3
- package/dist/react-native/RaftMsgHandler.js.map +1 -1
- package/dist/react-native/RaftPublish.d.ts +2 -0
- package/dist/react-native/RaftPublish.js +81 -0
- package/dist/react-native/RaftPublish.js.map +1 -0
- package/dist/react-native/RaftStreamHandler.d.ts +11 -0
- package/dist/react-native/RaftStreamHandler.js +66 -0
- package/dist/react-native/RaftStreamHandler.js.map +1 -1
- package/dist/react-native/RaftStruct.d.ts +2 -2
- package/dist/react-native/RaftStruct.js +97 -26
- package/dist/react-native/RaftStruct.js.map +1 -1
- package/dist/react-native/RaftSystemType.d.ts +1 -0
- package/dist/react-native/RaftSystemUtils.d.ts +17 -1
- package/dist/react-native/RaftSystemUtils.js +51 -0
- package/dist/react-native/RaftSystemUtils.js.map +1 -1
- package/dist/react-native/RaftTimezone.d.ts +16 -0
- package/dist/react-native/RaftTimezone.js +153 -0
- package/dist/react-native/RaftTimezone.js.map +1 -0
- package/dist/react-native/RaftTypes.d.ts +46 -1
- package/dist/react-native/RaftTypes.js.map +1 -1
- package/dist/react-native/RaftUpdateManager.js +1 -1
- package/dist/react-native/RaftUpdateManager.js.map +1 -1
- package/dist/react-native/main.d.ts +3 -0
- package/dist/react-native/main.js +8 -1
- package/dist/react-native/main.js.map +1 -1
- package/dist/web/PseudocodeTranspiler.d.ts +6 -0
- package/dist/web/PseudocodeTranspiler.js +115 -0
- package/dist/web/PseudocodeTranspiler.js.map +1 -0
- package/dist/web/RaftAttributeHandler.d.ts +1 -1
- package/dist/web/RaftAttributeHandler.js +108 -32
- package/dist/web/RaftAttributeHandler.js.map +1 -1
- package/dist/web/RaftChannelBLE.web.d.ts +4 -0
- package/dist/web/RaftChannelBLE.web.js +59 -21
- package/dist/web/RaftChannelBLE.web.js.map +1 -1
- package/dist/web/RaftChannelSimulated.d.ts +1 -0
- package/dist/web/RaftChannelSimulated.js +9 -5
- package/dist/web/RaftChannelSimulated.js.map +1 -1
- package/dist/web/RaftChannelWebSocket.js +16 -1
- package/dist/web/RaftChannelWebSocket.js.map +1 -1
- package/dist/web/RaftConnector.d.ts +29 -1
- package/dist/web/RaftConnector.js +177 -11
- package/dist/web/RaftConnector.js.map +1 -1
- package/dist/web/RaftCustomAttrHandler.d.ts +2 -2
- package/dist/web/RaftCustomAttrHandler.js +32 -44
- package/dist/web/RaftCustomAttrHandler.js.map +1 -1
- package/dist/web/RaftDeviceInfo.d.ts +18 -0
- package/dist/web/RaftDeviceInfo.js +8 -0
- package/dist/web/RaftDeviceInfo.js.map +1 -1
- package/dist/web/RaftDeviceManager.d.ts +30 -3
- package/dist/web/RaftDeviceManager.js +618 -107
- package/dist/web/RaftDeviceManager.js.map +1 -1
- package/dist/web/RaftDeviceMgrIF.d.ts +11 -2
- package/dist/web/RaftDeviceStates.d.ts +27 -3
- package/dist/web/RaftDeviceStates.js +31 -6
- package/dist/web/RaftDeviceStates.js.map +1 -1
- package/dist/web/RaftFileHandler.d.ts +1 -1
- package/dist/web/RaftFileHandler.js +101 -34
- package/dist/web/RaftFileHandler.js.map +1 -1
- package/dist/web/RaftMicroPythonConsoleClient.d.ts +38 -0
- package/dist/web/RaftMicroPythonConsoleClient.js +45 -0
- package/dist/web/RaftMicroPythonConsoleClient.js.map +1 -0
- package/dist/web/RaftMsgHandler.d.ts +1 -1
- package/dist/web/RaftMsgHandler.js +6 -3
- package/dist/web/RaftMsgHandler.js.map +1 -1
- package/dist/web/RaftPublish.d.ts +2 -0
- package/dist/web/RaftPublish.js +81 -0
- package/dist/web/RaftPublish.js.map +1 -0
- package/dist/web/RaftStreamHandler.d.ts +11 -0
- package/dist/web/RaftStreamHandler.js +66 -0
- package/dist/web/RaftStreamHandler.js.map +1 -1
- package/dist/web/RaftStruct.d.ts +2 -2
- package/dist/web/RaftStruct.js +97 -26
- package/dist/web/RaftStruct.js.map +1 -1
- package/dist/web/RaftSystemType.d.ts +1 -0
- package/dist/web/RaftSystemUtils.d.ts +17 -1
- package/dist/web/RaftSystemUtils.js +51 -0
- package/dist/web/RaftSystemUtils.js.map +1 -1
- package/dist/web/RaftTimezone.d.ts +16 -0
- package/dist/web/RaftTimezone.js +153 -0
- package/dist/web/RaftTimezone.js.map +1 -0
- package/dist/web/RaftTypes.d.ts +46 -1
- package/dist/web/RaftTypes.js.map +1 -1
- package/dist/web/RaftUpdateManager.js +1 -1
- package/dist/web/RaftUpdateManager.js.map +1 -1
- package/dist/web/main.d.ts +3 -0
- package/dist/web/main.js +8 -1
- package/dist/web/main.js.map +1 -1
- package/examples/dashboard/package.json +2 -2
- package/examples/dashboard/src/DeviceActionsForm.tsx +177 -17
- package/examples/dashboard/src/DeviceLineChart.tsx +16 -3
- package/examples/dashboard/src/DevicePanel.tsx +92 -11
- package/examples/dashboard/src/DeviceSelectDialog.tsx +224 -0
- package/examples/dashboard/src/DeviceStatsPanel.tsx +76 -0
- package/examples/dashboard/src/DevicesPanel.tsx +11 -0
- package/examples/dashboard/src/LogConfigPanel.tsx +357 -0
- package/examples/dashboard/src/LogFilesPanel.tsx +200 -0
- package/examples/dashboard/src/LoggingPanel.tsx +264 -0
- package/examples/dashboard/src/Main.tsx +12 -2
- package/examples/dashboard/src/SettingsScreen.tsx +9 -4
- package/examples/dashboard/src/SystemTypeCog/CogStateInfo.ts +10 -3
- package/examples/dashboard/src/SystemTypeCog/SystemTypeCog.ts +37 -3
- package/examples/dashboard/src/SystemTypeGeneric/StateInfoGeneric.ts +10 -2
- package/examples/dashboard/src/SystemTypeGeneric/SystemTypeGeneric.ts +41 -7
- package/examples/dashboard/src/SystemTypeMarty/RICStateInfo.ts +34 -3
- package/examples/dashboard/src/styles.css +766 -1
- package/notes/web-ble-reconnect-retry.md +69 -0
- package/package.json +10 -7
- package/src/PseudocodeTranspiler.test.ts +372 -0
- package/src/PseudocodeTranspiler.ts +127 -0
- package/src/RaftAttributeHandler.ts +152 -76
- package/src/RaftChannelBLE.web.ts +62 -20
- package/src/RaftChannelSimulated.ts +10 -5
- package/src/RaftChannelWebSocket.ts +16 -2
- package/src/RaftConnector.ts +204 -17
- package/src/RaftCustomAttrHandler.ts +35 -45
- package/src/RaftDeviceInfo.ts +27 -0
- package/src/RaftDeviceManager.test.ts +164 -0
- package/src/RaftDeviceManager.ts +705 -127
- package/src/RaftDeviceMgrIF.ts +13 -2
- package/src/RaftDeviceStates.ts +49 -8
- package/src/RaftFileHandler.ts +112 -39
- package/src/RaftMicroPythonConsoleClient.ts +78 -0
- package/src/RaftMsgHandler.ts +8 -4
- package/src/RaftPublish.ts +92 -0
- package/src/RaftStreamHandler.ts +84 -1
- package/src/RaftStruct.test.ts +229 -0
- package/src/RaftStruct.ts +101 -37
- package/src/RaftSystemType.ts +1 -0
- package/src/RaftSystemUtils.ts +59 -0
- package/src/RaftTimezone.ts +151 -0
- package/src/RaftTypes.ts +57 -1
- package/src/RaftUpdateManager.ts +1 -1
- package/src/main.ts +3 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
//
|
|
3
|
+
// RaftTimezone
|
|
4
|
+
// Part of RaftJS — IANA timezone to POSIX TZ string conversion for ESP-IDF
|
|
5
|
+
//
|
|
6
|
+
// Rob Dobson 2026
|
|
7
|
+
// (C) 2026 All rights reserved
|
|
8
|
+
//
|
|
9
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
10
|
+
|
|
11
|
+
// Mapping of common IANA timezone names to POSIX TZ strings (with DST rules where applicable)
|
|
12
|
+
const IANA_TO_POSIX: Record<string, string> = {
|
|
13
|
+
// UTC / GMT
|
|
14
|
+
'UTC': 'UTC0',
|
|
15
|
+
'Etc/UTC': 'UTC0',
|
|
16
|
+
'Etc/GMT': 'GMT0',
|
|
17
|
+
|
|
18
|
+
// Europe
|
|
19
|
+
'Europe/London': 'GMT0BST,M3.5.0/1,M10.5.0',
|
|
20
|
+
'Europe/Dublin': 'IST-1GMT0,M10.5.0,M3.5.0/1',
|
|
21
|
+
'Europe/Paris': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
22
|
+
'Europe/Berlin': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
23
|
+
'Europe/Brussels': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
24
|
+
'Europe/Amsterdam': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
25
|
+
'Europe/Rome': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
26
|
+
'Europe/Madrid': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
27
|
+
'Europe/Zurich': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
28
|
+
'Europe/Vienna': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
29
|
+
'Europe/Stockholm': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
30
|
+
'Europe/Oslo': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
31
|
+
'Europe/Copenhagen': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
32
|
+
'Europe/Helsinki': 'EET-2EEST,M3.5.0/3,M10.5.0/4',
|
|
33
|
+
'Europe/Athens': 'EET-2EEST,M3.5.0/3,M10.5.0/4',
|
|
34
|
+
'Europe/Bucharest': 'EET-2EEST,M3.5.0/3,M10.5.0/4',
|
|
35
|
+
'Europe/Warsaw': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
36
|
+
'Europe/Prague': 'CET-1CEST,M3.5.0,M10.5.0/3',
|
|
37
|
+
'Europe/Lisbon': 'WET0WEST,M3.5.0/1,M10.5.0',
|
|
38
|
+
'Europe/Moscow': 'MSK-3',
|
|
39
|
+
'Europe/Istanbul': '<+03>-3',
|
|
40
|
+
'Europe/Kiev': 'EET-2EEST,M3.5.0/3,M10.5.0/4',
|
|
41
|
+
'Europe/Kyiv': 'EET-2EEST,M3.5.0/3,M10.5.0/4',
|
|
42
|
+
|
|
43
|
+
// Americas
|
|
44
|
+
'America/New_York': 'EST5EDT,M3.2.0,M11.1.0',
|
|
45
|
+
'America/Chicago': 'CST6CDT,M3.2.0,M11.1.0',
|
|
46
|
+
'America/Denver': 'MST7MDT,M3.2.0,M11.1.0',
|
|
47
|
+
'America/Los_Angeles': 'PST8PDT,M3.2.0,M11.1.0',
|
|
48
|
+
'America/Phoenix': 'MST7',
|
|
49
|
+
'America/Anchorage': 'AKST9AKDT,M3.2.0,M11.1.0',
|
|
50
|
+
'Pacific/Honolulu': 'HST10',
|
|
51
|
+
'America/Toronto': 'EST5EDT,M3.2.0,M11.1.0',
|
|
52
|
+
'America/Vancouver': 'PST8PDT,M3.2.0,M11.1.0',
|
|
53
|
+
'America/Edmonton': 'MST7MDT,M3.2.0,M11.1.0',
|
|
54
|
+
'America/Winnipeg': 'CST6CDT,M3.2.0,M11.1.0',
|
|
55
|
+
'America/Halifax': 'AST4ADT,M3.2.0,M11.1.0',
|
|
56
|
+
'America/St_Johns': 'NST3:30NDT,M3.2.0,M11.1.0',
|
|
57
|
+
'America/Mexico_City': 'CST6',
|
|
58
|
+
'America/Sao_Paulo': '<-03>3',
|
|
59
|
+
'America/Argentina/Buenos_Aires': '<-03>3',
|
|
60
|
+
'America/Santiago': '<-04>4<-03>,M9.1.6/24,M4.1.6/24',
|
|
61
|
+
'America/Bogota': '<-05>5',
|
|
62
|
+
'America/Lima': '<-05>5',
|
|
63
|
+
|
|
64
|
+
// Asia
|
|
65
|
+
'Asia/Tokyo': 'JST-9',
|
|
66
|
+
'Asia/Shanghai': 'CST-8',
|
|
67
|
+
'Asia/Hong_Kong': 'HKT-8',
|
|
68
|
+
'Asia/Taipei': 'CST-8',
|
|
69
|
+
'Asia/Singapore': '<+08>-8',
|
|
70
|
+
'Asia/Seoul': 'KST-9',
|
|
71
|
+
'Asia/Kolkata': 'IST-5:30',
|
|
72
|
+
'Asia/Calcutta': 'IST-5:30',
|
|
73
|
+
'Asia/Dubai': '<+04>-4',
|
|
74
|
+
'Asia/Riyadh': '<+03>-3',
|
|
75
|
+
'Asia/Tehran': '<+0330>-3:30',
|
|
76
|
+
'Asia/Karachi': 'PKT-5',
|
|
77
|
+
'Asia/Dhaka': '<+06>-6',
|
|
78
|
+
'Asia/Bangkok': '<+07>-7',
|
|
79
|
+
'Asia/Jakarta': 'WIB-7',
|
|
80
|
+
'Asia/Ho_Chi_Minh': '<+07>-7',
|
|
81
|
+
'Asia/Kuala_Lumpur': '<+08>-8',
|
|
82
|
+
'Asia/Manila': 'PST-8',
|
|
83
|
+
'Asia/Vladivostok': '<+10>-10',
|
|
84
|
+
'Asia/Novosibirsk': '<+07>-7',
|
|
85
|
+
'Asia/Yekaterinburg': '<+05>-5',
|
|
86
|
+
|
|
87
|
+
// Oceania
|
|
88
|
+
'Australia/Sydney': 'AEST-10AEDT,M10.1.0,M4.1.0/3',
|
|
89
|
+
'Australia/Melbourne': 'AEST-10AEDT,M10.1.0,M4.1.0/3',
|
|
90
|
+
'Australia/Brisbane': 'AEST-10',
|
|
91
|
+
'Australia/Perth': 'AWST-8',
|
|
92
|
+
'Australia/Adelaide': 'ACST-9:30ACDT,M10.1.0,M4.1.0/3',
|
|
93
|
+
'Australia/Darwin': 'ACST-9:30',
|
|
94
|
+
'Australia/Hobart': 'AEST-10AEDT,M10.1.0,M4.1.0/3',
|
|
95
|
+
'Pacific/Auckland': 'NZST-12NZDT,M9.5.0,M4.1.0/3',
|
|
96
|
+
'Pacific/Fiji': '<+12>-12',
|
|
97
|
+
|
|
98
|
+
// Africa
|
|
99
|
+
'Africa/Cairo': 'EET-2',
|
|
100
|
+
'Africa/Johannesburg': 'SAST-2',
|
|
101
|
+
'Africa/Lagos': 'WAT-1',
|
|
102
|
+
'Africa/Nairobi': 'EAT-3',
|
|
103
|
+
'Africa/Casablanca': '<+01>-1',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get the host machine's IANA timezone name.
|
|
108
|
+
* Returns undefined if not available.
|
|
109
|
+
*/
|
|
110
|
+
export function getHostTimezone(): string | undefined {
|
|
111
|
+
try {
|
|
112
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
113
|
+
} catch {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Convert an IANA timezone name to a POSIX TZ string suitable for ESP-IDF.
|
|
120
|
+
* Falls back to a simple UTC offset string if the IANA name is not in the lookup table.
|
|
121
|
+
* Returns undefined if timezone cannot be determined.
|
|
122
|
+
*/
|
|
123
|
+
export function ianaToPosixTZ(iana: string): string | undefined {
|
|
124
|
+
// Direct lookup
|
|
125
|
+
const posix = IANA_TO_POSIX[iana];
|
|
126
|
+
if (posix) return posix;
|
|
127
|
+
|
|
128
|
+
// Fallback: compute simple UTC offset from current Date (no DST transitions)
|
|
129
|
+
try {
|
|
130
|
+
const offsetMin = new Date().getTimezoneOffset(); // minutes west of UTC (e.g. -60 for UTC+1)
|
|
131
|
+
if (offsetMin === 0) return 'UTC0';
|
|
132
|
+
// POSIX TZ convention: positive = west of UTC (opposite of ISO 8601)
|
|
133
|
+
const hours = Math.trunc(offsetMin / 60);
|
|
134
|
+
const mins = Math.abs(offsetMin % 60);
|
|
135
|
+
let tz = `UTC${hours >= 0 ? '+' : '-'}${Math.abs(hours)}`;
|
|
136
|
+
if (mins > 0) tz += `:${mins.toString().padStart(2, '0')}`;
|
|
137
|
+
return tz;
|
|
138
|
+
} catch {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get the host machine's timezone as a POSIX TZ string.
|
|
145
|
+
* Attempts IANA lookup first, then falls back to UTC offset.
|
|
146
|
+
*/
|
|
147
|
+
export function getHostPosixTZ(): string | undefined {
|
|
148
|
+
const iana = getHostTimezone();
|
|
149
|
+
if (!iana) return undefined;
|
|
150
|
+
return ianaToPosixTZ(iana);
|
|
151
|
+
}
|
package/src/RaftTypes.ts
CHANGED
|
@@ -72,6 +72,31 @@ export class RaftOKFail {
|
|
|
72
72
|
rslt = 'failComms';
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
export type RaftPubTopicRec = {
|
|
76
|
+
name: string;
|
|
77
|
+
idx: number;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type RaftSubscriptionUpdateResponse = RaftOKFail & {
|
|
81
|
+
topics?: Array<RaftPubTopicRec>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type RaftPubTopicsResponse = RaftOKFail & {
|
|
85
|
+
topics?: Array<RaftPubTopicRec>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type RaftPublishFrameType = 'json' | 'binary' | 'unknown';
|
|
89
|
+
|
|
90
|
+
export type RaftPublishFrameMeta = {
|
|
91
|
+
frameType: RaftPublishFrameType;
|
|
92
|
+
topicIndex?: number;
|
|
93
|
+
topicName?: string;
|
|
94
|
+
version?: number;
|
|
95
|
+
binaryHasEnvelope?: boolean;
|
|
96
|
+
binaryPayloadOffset?: number;
|
|
97
|
+
jsonString?: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
75
100
|
export type RaftReportMsg = {
|
|
76
101
|
msgType?: string;
|
|
77
102
|
rslt?: string;
|
|
@@ -127,6 +152,7 @@ export type RaftFileStartResp = {
|
|
|
127
152
|
rslt: string;
|
|
128
153
|
batchMsgSize: number;
|
|
129
154
|
batchAckSize: number;
|
|
155
|
+
streamID?: number;
|
|
130
156
|
};
|
|
131
157
|
|
|
132
158
|
export type RaftStreamStartResp = {
|
|
@@ -181,6 +207,30 @@ export class RaftSysModInfoBLEMan {
|
|
|
181
207
|
|
|
182
208
|
export type RaftProgressCBType = (received: number, total: number) => void;
|
|
183
209
|
|
|
210
|
+
export type RaftStreamDataProgressCBType = (sent: number, total: number, progress: number) => void;
|
|
211
|
+
|
|
212
|
+
export type RaftRtStreamDataCBType = (data: Uint8Array, filePos: number, streamID: number) => void;
|
|
213
|
+
|
|
214
|
+
export type RaftRtStreamOptions = {
|
|
215
|
+
fileName: string;
|
|
216
|
+
endpoint: string;
|
|
217
|
+
onData: RaftRtStreamDataCBType;
|
|
218
|
+
sendInitialEmptyBlock?: boolean;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type RaftRtStreamHandle = {
|
|
222
|
+
streamID: number;
|
|
223
|
+
maxBlockSize: number;
|
|
224
|
+
sendBytes: (bytes: Uint8Array) => Promise<boolean>;
|
|
225
|
+
sendText: (text: string) => Promise<boolean>;
|
|
226
|
+
close: () => Promise<boolean>;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export type RaftRtStreamStartResp = RaftOKFail & {
|
|
230
|
+
streamID?: number;
|
|
231
|
+
maxBlockSize?: number;
|
|
232
|
+
};
|
|
233
|
+
|
|
184
234
|
export class RaftFileDownloadResult {
|
|
185
235
|
fileData: Uint8Array | null = null;
|
|
186
236
|
downloadedOk = false;
|
|
@@ -210,7 +260,13 @@ export type RaftFileDownloadStartResp = {
|
|
|
210
260
|
batchAckSize: number;
|
|
211
261
|
streamID: number;
|
|
212
262
|
fileLen: number;
|
|
213
|
-
crc16
|
|
263
|
+
crc16?: string;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export type RaftFileDownloadEndResp = {
|
|
267
|
+
req: string;
|
|
268
|
+
rslt: string;
|
|
269
|
+
crc16?: string;
|
|
214
270
|
}
|
|
215
271
|
|
|
216
272
|
export interface Dictionary<T> {
|
package/src/RaftUpdateManager.ts
CHANGED
|
@@ -414,7 +414,7 @@ export default class RICUpdateManager {
|
|
|
414
414
|
15000
|
|
415
415
|
);
|
|
416
416
|
// trigger and wait for reboot
|
|
417
|
-
RaftLog.debug(`Restarting
|
|
417
|
+
RaftLog.debug(`Restarting device`);
|
|
418
418
|
try {
|
|
419
419
|
await this._msgHandler.sendRICRESTURL<RaftOKFail>("reset");
|
|
420
420
|
} catch (error) {
|
package/src/main.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { default as RaftFileHandler } from './RaftFileHandler';
|
|
|
21
21
|
export { default as RaftLog } from './RaftLog';
|
|
22
22
|
export { default as RaftMiniHDLC } from './RaftMiniHDLC';
|
|
23
23
|
export { default as RaftMsgHandler } from './RaftMsgHandler'
|
|
24
|
+
export { default as RaftMicroPythonConsoleClient } from './RaftMicroPythonConsoleClient';
|
|
24
25
|
export { default as RaftStreamHandler } from './RaftStreamHandler';
|
|
25
26
|
export { default as RaftSystemUtils } from './RaftSystemUtils';
|
|
26
27
|
export { default as RaftUtils } from './RaftUtils';
|
|
@@ -29,6 +30,7 @@ export { default as RaftDeviceMgrIF } from './RaftDeviceMgrIF';
|
|
|
29
30
|
export { DeviceManager as RaftDeviceManager } from './RaftDeviceManager';
|
|
30
31
|
export type { DeviceDecodedData } from './RaftDeviceManager';
|
|
31
32
|
|
|
33
|
+
export * from './RaftPublish';
|
|
32
34
|
export * from './RaftTypes';
|
|
33
35
|
export * from './RaftSystemType';
|
|
34
36
|
export * from './RaftWifiTypes';
|
|
@@ -37,3 +39,4 @@ export * from './RaftUpdateEvents';
|
|
|
37
39
|
export * from "./RaftProtocolDefs";
|
|
38
40
|
export * from "./RaftDeviceStates";
|
|
39
41
|
export * from "./RaftDeviceInfo";
|
|
42
|
+
export { getHostTimezone, getHostPosixTZ, ianaToPosixTZ } from './RaftTimezone';
|