Fix uart query
This commit is contained in:
parent
eb876b3468
commit
ee075738b8
2 changed files with 3 additions and 8 deletions
|
@ -5,7 +5,7 @@ use service_specific::*;
|
|||
|
||||
fn main() -> Result<()> {
|
||||
let mut port = Port::open(SerialPortSettings {
|
||||
baud_rate: 9600,
|
||||
baud_rate: 57600,
|
||||
data_bits: DataBits::Eight,
|
||||
parity: Parity::None,
|
||||
stop_bits: StopBits::One,
|
||||
|
|
|
@ -68,13 +68,8 @@ impl Port {
|
|||
for available_port in available_ports.iter() {
|
||||
if let serialport::SerialPortType::UsbPort(usb_info) = &available_port.port_type {
|
||||
// check for the correct device
|
||||
if let Some(product_name) = &usb_info.product {
|
||||
if product_name == "FT232R_USB_UART"
|
||||
&& usb_info.vid == 0x0403
|
||||
&& usb_info.pid == 0x6001
|
||||
{
|
||||
return Ok(available_port.port_name.clone());
|
||||
}
|
||||
if usb_info.vid == 0x0403 && usb_info.pid == 0x6001 {
|
||||
return Ok(available_port.port_name.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue