Skip to content

Commit 415a08d

Browse files
committed
Add AIOC to list for cm108 ptt.
1 parent a3d3143 commit 415a08d

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/cm108.c

+24-4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* We have a few commercial products:
3535
*
3636
* DINAH https://hamprojects.info/dinah/
37+
* PAUL https://hamprojects.info/paul/
3738
* DMK URI http://www.dmkeng.com/URI_Order_Page.htm
3839
* RB-USB RIM http://www.repeater-builder.com/products/usb-rim-lite.html
3940
* RA-35 http://www.masterscommunications.com/products/radio-adapter/ra35.html
@@ -93,6 +94,12 @@
9394
* with a single USB Audio Adapter, but does not automatically handle the multiple device case.
9495
* Manual configuration needs to be used in this case.
9596
*
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+
*
96103
*---------------------------------------------------------------*/
97104

98105
#include "direwolf.h"
@@ -178,6 +185,11 @@ static int cm108_write (char *name, int iomask, int iodata);
178185
#define SSS_PID2 0x1607
179186
#define SSS_PID3 0x160b
180187

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+
181193

182194
// Device VID PID Number of GPIO
183195
// ------ --- --- --------------
@@ -217,7 +229,9 @@ static int cm108_write (char *name, int iomask, int iodata);
217229
|| p == CMEDIA_PID_CM119A \
218230
|| p == CMEDIA_PID_CM119B )) \
219231
|| \
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) )
221235

222236
// Look out for null source pointer, and avoid buffer overflow on destination.
223237

@@ -243,6 +257,12 @@ static void substr_se (char *dest, const char *src, int start, int endp1)
243257

244258
#endif
245259

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+
246266
/*
247267
* Result of taking inventory of USB soundcards and USB HIDs.
248268
*/
@@ -258,7 +278,8 @@ struct thing_s {
258278
// Oversized to silence a compiler warning.
259279
char plughw2[72]; // With name rather than number.
260280
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
262283
// The Windows path for a HID looks like this, lengths up to 95 seen.
263284
// \\?\hid#vid_0d8c&pid_000c&mi_03#8&164d11c9&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
264285
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
852873
*
853874
* Errors: A descriptive error message will be printed for any problem.
854875
*
855-
* Future: For our initial implementation we are making the simplifying
876+
* Shortcut: For our initial implementation we are making the simplifying
856877
* restriction of using only one GPIO pin per device and limit
857878
* configuration to PTT only.
858879
* 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)
882903

883904
iomask = 1 << (num - 1); // 0=input, 1=output
884905
iodata = state << (num - 1); // 0=low, 1=high
885-
886906
return (cm108_write (name, iomask, iodata));
887907

888908
} /* end cm108_set_gpio_pin */

0 commit comments

Comments
 (0)