@springfield/ham-radio-api 17.4.0 → 17.5.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/radio/protocol.d.ts
CHANGED
|
@@ -14,14 +14,39 @@ export type RadioByteToken = number | string;
|
|
|
14
14
|
export interface RadioExpectBytes {
|
|
15
15
|
bytes: number;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Read until a delimiter byte. Used for Kenwood live CAT lines ending in CR.
|
|
19
|
+
*/
|
|
20
|
+
export interface RadioExpectUntil {
|
|
21
|
+
until: RadioByteToken;
|
|
22
|
+
}
|
|
17
23
|
/**
|
|
18
24
|
* Expected serial reply for an exchange.
|
|
19
25
|
*
|
|
20
26
|
* - token: exact 1-byte match (ACK)
|
|
21
27
|
* - token array: exact multi-byte match, or a framed reply with `$` placeholders
|
|
22
28
|
* - `{ bytes: N }`: any N bytes
|
|
29
|
+
* - `{ until: token }`: variable-length reply ending at the delimiter (the delimiter is not included)
|
|
30
|
+
*/
|
|
31
|
+
export type RadioExpect = RadioByteToken | RadioByteToken[] | RadioExpectBytes | RadioExpectUntil;
|
|
32
|
+
/**
|
|
33
|
+
* Packer that converts live CAT replies into a logical memory-map record.
|
|
34
|
+
* `kenwood-th-f6` parses `MR`/`MNA` CSV into the 32-byte TH-F6 channel image.
|
|
23
35
|
*/
|
|
24
|
-
export type
|
|
36
|
+
export type RadioCatPack = "kenwood-th-f6";
|
|
37
|
+
/**
|
|
38
|
+
* Live CAT memory loop: one logical record per channel index, not clone blocks.
|
|
39
|
+
*/
|
|
40
|
+
export interface RadioCatMemoryConfig {
|
|
41
|
+
segment: string;
|
|
42
|
+
count: number;
|
|
43
|
+
recordSize: number;
|
|
44
|
+
pack: RadioCatPack;
|
|
45
|
+
indexWidth?: number;
|
|
46
|
+
emptyByte?: number;
|
|
47
|
+
timeout?: number;
|
|
48
|
+
interCommandDelayMs?: number;
|
|
49
|
+
}
|
|
25
50
|
/**
|
|
26
51
|
* One serial exchange: send bytes and/or wait for a reply, and/or change baud.
|
|
27
52
|
* At least one of `send`, `expect`, or `setBaudRate` must be present.
|
|
@@ -31,6 +56,10 @@ export interface RadioExchange {
|
|
|
31
56
|
send?: RadioByteToken[];
|
|
32
57
|
expect?: RadioExpect;
|
|
33
58
|
timeout?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Milliseconds to wait after send (Kenwood CAT wake CR before ID).
|
|
61
|
+
*/
|
|
62
|
+
delay?: number;
|
|
34
63
|
/**
|
|
35
64
|
* Switch the serial baud rate before send/expect. TH-D74 clone mode
|
|
36
65
|
* enters programming at 9600 then transfers at 57600.
|
|
@@ -72,5 +101,19 @@ export interface RadioWriteStep {
|
|
|
72
101
|
skip?: RadioMemorySegment[];
|
|
73
102
|
};
|
|
74
103
|
}
|
|
75
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Read memories with live CAT commands (Kenwood TH-F6 `MR`/`MNA`).
|
|
106
|
+
*/
|
|
107
|
+
export interface RadioCatReadStep {
|
|
108
|
+
description?: string;
|
|
109
|
+
catRead: RadioCatMemoryConfig;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Write memories with live CAT commands (Kenwood TH-F6 `MW`/`MNA`).
|
|
113
|
+
*/
|
|
114
|
+
export interface RadioCatWriteStep {
|
|
115
|
+
description?: string;
|
|
116
|
+
catWrite: RadioCatMemoryConfig;
|
|
117
|
+
}
|
|
118
|
+
export type RadioProtocolStep = RadioExchange | RadioReadStep | RadioWriteStep | RadioCatReadStep | RadioCatWriteStep;
|
|
76
119
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/radio/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAA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GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,IAAI,EAAE,cAAc,EAAE,CAAC;QACvB,MAAM,EAAE,WAAW,CAAC;QACpB,GAAG,CAAC,EAAE,aAAa,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,IAAI,EAAE,cAAc,EAAE,CAAC;QACvB,MAAM,EAAE,WAAW,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAC7B,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,CAAC"}
|
|
@@ -7,5 +7,13 @@ export interface RadioSerialConfig {
|
|
|
7
7
|
* Hardware RTS/CTS flow control. Kenwood TH-D74 clone mode needs this on macOS.
|
|
8
8
|
*/
|
|
9
9
|
rtscts?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Explicit RTS line. TH-F6 live CAT needs this false; omit to keep RTS asserted.
|
|
12
|
+
*/
|
|
13
|
+
rts?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Explicit DTR line. Omit to keep DTR asserted after open.
|
|
16
|
+
*/
|
|
17
|
+
dtr?: boolean;
|
|
10
18
|
}
|
|
11
19
|
//# sourceMappingURL=serial-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serial-config.d.ts","sourceRoot":"","sources":["../../src/radio/serial-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"serial-config.d.ts","sourceRoot":"","sources":["../../src/radio/serial-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf"}
|
package/package.json
CHANGED
package/src/radio/protocol.ts
CHANGED
|
@@ -17,14 +17,42 @@ export interface RadioExpectBytes {
|
|
|
17
17
|
bytes: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Read until a delimiter byte. Used for Kenwood live CAT lines ending in CR.
|
|
22
|
+
*/
|
|
23
|
+
export interface RadioExpectUntil {
|
|
24
|
+
until: RadioByteToken;
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
/**
|
|
21
28
|
* Expected serial reply for an exchange.
|
|
22
29
|
*
|
|
23
30
|
* - token: exact 1-byte match (ACK)
|
|
24
31
|
* - token array: exact multi-byte match, or a framed reply with `$` placeholders
|
|
25
32
|
* - `{ bytes: N }`: any N bytes
|
|
33
|
+
* - `{ until: token }`: variable-length reply ending at the delimiter (the delimiter is not included)
|
|
34
|
+
*/
|
|
35
|
+
export type RadioExpect = RadioByteToken | RadioByteToken[] | RadioExpectBytes | RadioExpectUntil;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Packer that converts live CAT replies into a logical memory-map record.
|
|
39
|
+
* `kenwood-th-f6` parses `MR`/`MNA` CSV into the 32-byte TH-F6 channel image.
|
|
40
|
+
*/
|
|
41
|
+
export type RadioCatPack = "kenwood-th-f6";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Live CAT memory loop: one logical record per channel index, not clone blocks.
|
|
26
45
|
*/
|
|
27
|
-
export
|
|
46
|
+
export interface RadioCatMemoryConfig {
|
|
47
|
+
segment: string;
|
|
48
|
+
count: number;
|
|
49
|
+
recordSize: number;
|
|
50
|
+
pack: RadioCatPack;
|
|
51
|
+
indexWidth?: number;
|
|
52
|
+
emptyByte?: number;
|
|
53
|
+
timeout?: number;
|
|
54
|
+
interCommandDelayMs?: number;
|
|
55
|
+
}
|
|
28
56
|
|
|
29
57
|
/**
|
|
30
58
|
* One serial exchange: send bytes and/or wait for a reply, and/or change baud.
|
|
@@ -35,6 +63,10 @@ export interface RadioExchange {
|
|
|
35
63
|
send?: RadioByteToken[];
|
|
36
64
|
expect?: RadioExpect;
|
|
37
65
|
timeout?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Milliseconds to wait after send (Kenwood CAT wake CR before ID).
|
|
68
|
+
*/
|
|
69
|
+
delay?: number;
|
|
38
70
|
/**
|
|
39
71
|
* Switch the serial baud rate before send/expect. TH-D74 clone mode
|
|
40
72
|
* enters programming at 9600 then transfers at 57600.
|
|
@@ -79,4 +111,20 @@ export interface RadioWriteStep {
|
|
|
79
111
|
};
|
|
80
112
|
}
|
|
81
113
|
|
|
82
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Read memories with live CAT commands (Kenwood TH-F6 `MR`/`MNA`).
|
|
116
|
+
*/
|
|
117
|
+
export interface RadioCatReadStep {
|
|
118
|
+
description?: string;
|
|
119
|
+
catRead: RadioCatMemoryConfig;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Write memories with live CAT commands (Kenwood TH-F6 `MW`/`MNA`).
|
|
124
|
+
*/
|
|
125
|
+
export interface RadioCatWriteStep {
|
|
126
|
+
description?: string;
|
|
127
|
+
catWrite: RadioCatMemoryConfig;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type RadioProtocolStep = RadioExchange | RadioReadStep | RadioWriteStep | RadioCatReadStep | RadioCatWriteStep;
|
|
@@ -7,4 +7,12 @@ export interface RadioSerialConfig {
|
|
|
7
7
|
* Hardware RTS/CTS flow control. Kenwood TH-D74 clone mode needs this on macOS.
|
|
8
8
|
*/
|
|
9
9
|
rtscts?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Explicit RTS line. TH-F6 live CAT needs this false; omit to keep RTS asserted.
|
|
12
|
+
*/
|
|
13
|
+
rts?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Explicit DTR line. Omit to keep DTR asserted after open.
|
|
16
|
+
*/
|
|
17
|
+
dtr?: boolean;
|
|
10
18
|
}
|