aboutsummaryrefslogtreecommitdiff
path: root/transport/serial/usb.go
diff options
context:
space:
mode:
authorNoah Stride <[email protected]>2024-02-05 15:32:49 +0000
committerGitHub <[email protected]>2024-02-05 05:32:49 -1000
commit598d6e45b2a79b169056c5abe7a6266aa6d5cb23 (patch)
tree5a628024bd06a73fda221712a87eaf20b30ccf29 /transport/serial/usb.go
parent95a38401baeb4df14d701405609a3dd26ffd747f (diff)
Refactor Meshtastic "Stream" Protocol handling and implement TCP listener (#5)
* Start hacking on a "StreamConn" * Tidy up write side * Write basic send/receive test * Add support for "wake" Start2 spam * Add test case for reply * Add TCP listener to meshtastic stream conn * Very ugly basic impl that supports `meshtastic --nodes` * Support graceful disconnection command from client * Refactor handling for handleToRadioWantConfigID into it's own method * Send FromRadio messages to clients * Refactor client logic into own type * Fix up serial support for new client * Fix eample * Remove datadump * Make TCP listener optional * Add locking for reading/writing from the connection * Explain knownDevices * Properly close streamConn in example
Diffstat (limited to 'transport/serial/usb.go')
-rw-r--r--transport/serial/usb.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/transport/serial/usb.go b/transport/serial/usb.go
index b341321..7656fa4 100644
--- a/transport/serial/usb.go
+++ b/transport/serial/usb.go
@@ -12,7 +12,11 @@ type usbDevice struct {
}
var knownDevices = []usbDevice{
- {VID: "239A", PID: "8029"}, // rak4631_19003
+ // rak4631_19003
+ {VID: "239A", PID: "8029"},
+ // CP210x UART Bridge
+ // Commonly found on Heltec and other devices.
+ {VID: "10C4", PID: "EA60"},
}
func GetPorts() []string {
@@ -26,7 +30,7 @@ func GetPorts() []string {
return nil
}
for _, port := range ports {
- //fmt.Printf("Found port: %s\n", port.SettingName)
+ // fmt.Printf("Found port: %s %s\n", port.PID, port.VID)
if port.IsUSB {
for _, device := range knownDevices {
if device.VID != port.VID {