@springfield/ham-radio-api 17.5.0 → 17.6.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.
@@ -1,5 +1,19 @@
1
1
  export interface RadioSerialConfig {
2
+ /**
3
+ * Default baud rate used to open the programming port.
4
+ *
5
+ * When `baudRates` is listed, this must be one of those values. HamBench
6
+ * selects it automatically unless the user previously chose another rate
7
+ * for the same radio.
8
+ */
2
9
  baudRate: number;
10
+ /**
11
+ * Baud rates the radio's programming port accepts.
12
+ *
13
+ * Omit when only `baudRate` is valid. HamBench shows a baud selector on
14
+ * import and write when this list has more than one value.
15
+ */
16
+ baudRates?: number[];
3
17
  dataBits?: 8 | 5 | 6 | 7;
4
18
  stopBits?: 1 | 1.5 | 2;
5
19
  parity?: "none" | "even" | "odd";
@@ -16,4 +30,11 @@ export interface RadioSerialConfig {
16
30
  */
17
31
  dtr?: boolean;
18
32
  }
33
+ /**
34
+ * Baud rates the programming port may be opened at.
35
+ *
36
+ * Uses `baudRates` when the radio lists them; otherwise the single `baudRate`
37
+ * default is the only option.
38
+ */
39
+ export declare function programmingPortBaudRates(config: RadioSerialConfig): number[];
19
40
  //# 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;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf"}
1
+ {"version":3,"file":"serial-config.d.ts","sourceRoot":"","sources":["../../src/radio/serial-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,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;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAM5E"}
@@ -1,2 +1,13 @@
1
- export {};
1
+ /**
2
+ * Baud rates the programming port may be opened at.
3
+ *
4
+ * Uses `baudRates` when the radio lists them; otherwise the single `baudRate`
5
+ * default is the only option.
6
+ */
7
+ export function programmingPortBaudRates(config) {
8
+ if (config.baudRates && config.baudRates.length > 0) {
9
+ return [...config.baudRates];
10
+ }
11
+ return [config.baudRate];
12
+ }
2
13
  //# sourceMappingURL=serial-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serial-config.js","sourceRoot":"","sources":["../../src/radio/serial-config.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"serial-config.js","sourceRoot":"","sources":["../../src/radio/serial-config.ts"],"names":[],"mappings":"AAiCA;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAyB;IAChE,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,OAAO,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "17.5.0",
3
+ "version": "17.6.0",
4
4
  "author": "Bryan Hunt",
5
5
  "files": [
6
6
  "dist/",
@@ -1,5 +1,19 @@
1
1
  export interface RadioSerialConfig {
2
+ /**
3
+ * Default baud rate used to open the programming port.
4
+ *
5
+ * When `baudRates` is listed, this must be one of those values. HamBench
6
+ * selects it automatically unless the user previously chose another rate
7
+ * for the same radio.
8
+ */
2
9
  baudRate: number;
10
+ /**
11
+ * Baud rates the radio's programming port accepts.
12
+ *
13
+ * Omit when only `baudRate` is valid. HamBench shows a baud selector on
14
+ * import and write when this list has more than one value.
15
+ */
16
+ baudRates?: number[];
3
17
  dataBits?: 8 | 5 | 6 | 7;
4
18
  stopBits?: 1 | 1.5 | 2;
5
19
  parity?: "none" | "even" | "odd";
@@ -16,3 +30,17 @@ export interface RadioSerialConfig {
16
30
  */
17
31
  dtr?: boolean;
18
32
  }
33
+
34
+ /**
35
+ * Baud rates the programming port may be opened at.
36
+ *
37
+ * Uses `baudRates` when the radio lists them; otherwise the single `baudRate`
38
+ * default is the only option.
39
+ */
40
+ export function programmingPortBaudRates(config: RadioSerialConfig): number[] {
41
+ if (config.baudRates && config.baudRates.length > 0) {
42
+ return [...config.baudRates];
43
+ }
44
+
45
+ return [config.baudRate];
46
+ }