1) update CI to add zip on commit for quick testing

2) fix gw readflux command (should be 8 bytes long but was packed as 10)
3) add support for non-gw VID/PID (generic serial port that is gw compatible)
4) manually set/clear DTR on serial port devices - this seems to be essential for tinyusb/arduino CDC

not tested with a gw but ought not to have broken anything!
This commit is contained in:
lady ada
2022-01-15 20:57:36 -05:00
parent 6a07ba850c
commit 45d7b284e3
5 changed files with 47 additions and 3 deletions

View File

@@ -45,5 +45,30 @@ std::vector<std::unique_ptr<CandidateDevice>> findUsbDevices(const std::set<uint
}
}
if (candidates.size() == 0) {
for (const auto& it : libusbp::list_connected_devices())
{
auto candidate = std::make_unique<CandidateDevice>();
candidate->device = it;
uint32_t id = (it.get_vendor_id() << 16) | it.get_product_id();
candidate->id = id;
candidate->serial = get_serial_number(it);
printf("USB ID %04x %04x: ", it.get_vendor_id(), it.get_product_id());
try
{
libusbp::serial_port port(candidate->device, 0, true);
candidate->serialPort = port.get_name();
printf("generic serialPort found\n");
candidates.push_back(std::move(candidate));
}
catch(const libusbp::error & error)
{
// not a serial port!
printf("not a port!\n");
continue;
}
}
}
return candidates;
}