Follow-up Comment #2, bug #23685 (project avrdude):

I would solve the problem by introducing another method in the programmer data
structure.

const char* select_port(
  const char* port,            /* from cmd line */
  const char* default_serial,  /* value of default_serial */
  const char* default_parallel /* value of default_parallel */
)


The provided function has to return the correct value.
If port is given it returns port otherwise it returns the serial or parallel
value.

An USB programmer could also return a string like "usb" or anything else. When
we define that the function is called after pgm->setup() and the returned
value is not used after pgm->teardown(), the programmer also could create in
its private data a dynamic created string. (For example when programmers check
the usb ports to find the right device, they could show to used port here.)

PS:
Maybe we also should introduce a default_usb value (and add it to parameter
list above) as new programmers are likely to be connected by usb (or a serial
emulation).



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?23685>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/


_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev

Reply via email to