34
34
* We have a few commercial products:
35
35
*
36
36
* DINAH https://hamprojects.info/dinah/
37
+ * PAUL https://hamprojects.info/paul/
37
38
* DMK URI http://www.dmkeng.com/URI_Order_Page.htm
38
39
* RB-USB RIM http://www.repeater-builder.com/products/usb-rim-lite.html
39
40
* RA-35 http://www.masterscommunications.com/products/radio-adapter/ra35.html
93
94
* with a single USB Audio Adapter, but does not automatically handle the multiple device case.
94
95
* Manual configuration needs to be used in this case.
95
96
*
97
+ * Here is something new and interesting. The All in One cable (AIOC).
98
+ * https://github.com/skuep/AIOC/tree/master
99
+ *
100
+ * A microcontroller is used to emulate a CM108-compatible soundcard
101
+ * and a serial port. It fits right on the side of a Bao Feng or similar.
102
+ *
96
103
*---------------------------------------------------------------*/
97
104
98
105
#include "direwolf.h"
@@ -178,6 +185,11 @@ static int cm108_write (char *name, int iomask, int iodata);
178
185
#define SSS_PID2 0x1607
179
186
#define SSS_PID3 0x160b
180
187
188
+ // https://github.com/skuep/AIOC/blob/master/stm32/aioc-fw/Src/usb_descriptors.h
189
+
190
+ #define AIOC_VID 0x1209
191
+ #define AIOC_PID 0x7388
192
+
181
193
182
194
// Device VID PID Number of GPIO
183
195
// ------ --- --- --------------
@@ -217,7 +229,9 @@ static int cm108_write (char *name, int iomask, int iodata);
217
229
|| p == CMEDIA_PID_CM119A \
218
230
|| p == CMEDIA_PID_CM119B )) \
219
231
|| \
220
- (v == SSS_VID && (p == SSS_PID1 || p == SSS_PID2 || p == SSS_PID3)) )
232
+ (v == SSS_VID && (p == SSS_PID1 || p == SSS_PID2 || p == SSS_PID3)) \
233
+ || \
234
+ (v == AIOC_VID && p == AIOC_PID) )
221
235
222
236
// Look out for null source pointer, and avoid buffer overflow on destination.
223
237
@@ -243,6 +257,12 @@ static void substr_se (char *dest, const char *src, int start, int endp1)
243
257
244
258
#endif
245
259
260
+ // Maximum length of name for PTT HID.
261
+ // For Linux, this was originally 17 to handle names like /dev/hidraw3.
262
+ // Windows has more complicated names. The longest I saw was 95 but longer have been reported.
263
+
264
+ #define MAXX_HIDRAW_NAME_LEN 128
265
+
246
266
/*
247
267
* Result of taking inventory of USB soundcards and USB HIDs.
248
268
*/
@@ -258,7 +278,8 @@ struct thing_s {
258
278
// Oversized to silence a compiler warning.
259
279
char plughw2 [72 ]; // With name rather than number.
260
280
char devpath [128 ]; // Kernel dev path. Does not include /sys mount point.
261
- char devnode_hidraw [128 ]; // e.g. /dev/hidraw3 - for Linux - was length 17
281
+ char devnode_hidraw [MAXX_HIDRAW_NAME_LEN ];
282
+ // e.g. /dev/hidraw3 - for Linux - was length 17
262
283
// The Windows path for a HID looks like this, lengths up to 95 seen.
263
284
// \\?\hid#vid_0d8c&pid_000c&mi_03#8&164d11c9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
264
285
char devnode_usb [25 ]; // e.g. /dev/bus/usb/001/012
@@ -852,7 +873,7 @@ void cm108_find_ptt (char *output_audio_device, char *ptt_device, int ptt_devic
852
873
*
853
874
* Errors: A descriptive error message will be printed for any problem.
854
875
*
855
- * Future : For our initial implementation we are making the simplifying
876
+ * Shortcut : For our initial implementation we are making the simplifying
856
877
* restriction of using only one GPIO pin per device and limit
857
878
* configuration to PTT only.
858
879
* Longer term, we might want to have DCD, and maybe other
@@ -882,7 +903,6 @@ int cm108_set_gpio_pin (char *name, int num, int state)
882
903
883
904
iomask = 1 << (num - 1 ); // 0=input, 1=output
884
905
iodata = state << (num - 1 ); // 0=low, 1=high
885
-
886
906
return (cm108_write (name , iomask , iodata ));
887
907
888
908
} /* end cm108_set_gpio_pin */
0 commit comments