Implement find_usb_serial_port for MacOS, switch HYTE CNVS implementation to serial-based

This commit is contained in:
Adam Honse 2025-07-14 12:39:15 -05:00
parent 75bf674537
commit f03e4fd049
9 changed files with 164 additions and 248 deletions

View file

@ -460,6 +460,8 @@ bool serial_port::serial_open()
| Configure baud rate |
\*-----------------------------------------*/
ioctl(file_descriptor, IOSSIOSPEED, &baud_rate);
printf("Port opened fd %d", file_descriptor);
#endif
/*-----------------------------------------------------*\
@ -595,9 +597,10 @@ int serial_port::serial_write(char * buffer, int length)
\*-----------------------------------------------------*/
#ifdef __APPLE__
int byteswritten;
tcdrain(file_descriptor);
byteswritten = write(file_descriptor, buffer, length);
tcdrain(file_descriptor);
printf("serial write fd %d", file_descriptor);
printf("tcdrain %d\r\n",tcdrain(file_descriptor));
printf("write %d\r\n", byteswritten = write(file_descriptor, buffer, length));
printf("tcdrain %d\r\n", tcdrain(file_descriptor));
return byteswritten;
#endif