elmu6301 / Automated-Anechoic-Chamber

2 stars 0 forks source link

Usb search #26

Closed elmu6301 closed 3 years ago

elmu6301 commented 3 years ago

23

Overview

Modifies port connection to search for devices based on the interface name versus the COM port. Also detects if the device is on the transmitting or receiving side.

Updates

GraceButler commented 3 years ago

I just read through the code and it looks great! I have a couple of questions:

  1. Do we want to have a find_port and a find_ports function? (It looks like that's currently how it is)
  2. Are sort_devices_by and find_ports supposed to be an instance of the class (i.e. include self as a variable)?
  3. On line 76, is key=usb.sort_devices_by meant to have parentheses afterward to pass in a variable?

I just noticed that sort_devices_by and find_ports don't seem to have test functions, is that because they aren't part of the class?

Elena's answers:

  1. Yes find_port is used to find a single (i.e first) COM port with the interface name it's intended as a backup for find_ports. find_ports finds multiple COM ports with the same interface name, it's a more generalized verision of find_port. We may not need find_port but I am just going to leave it in for now.
  2. No. They need to be separate because we may not have an instance of MSP430 or know how many we actually have.
  3. Nope since we are passing in really a function pointer we don't need arguments

Also I guess I could add tests for them. I kinda forgot about doing that for them.