Commit e4ba333f authored by jdelange's avatar jdelange
Browse files

* fix blocking issues for linux serial driver



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@2551 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 9fb73d5e
......@@ -137,7 +137,7 @@ void __po_hi_c_driver_serial_linux_init_sender (__po_hi_device_id id)
return;
}
po_hi_c_driver_serial_fd_write = open (serialconf->devname, O_RDWR | O_NOCTTY | O_NONBLOCK);
po_hi_c_driver_serial_fd_write = open (serialconf->devname, O_WRONLY | O_NOCTTY | O_NONBLOCK);
if (po_hi_c_driver_serial_fd_write < 0)
{
......@@ -145,7 +145,7 @@ void __po_hi_c_driver_serial_linux_init_sender (__po_hi_device_id id)
}
else
{
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Device successfully opened, fd=%d\n", po_hi_c_driver_serial_fd_write);
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Device successfully opened for sending, fd=%d\n", po_hi_c_driver_serial_fd_write);
}
tcgetattr (po_hi_c_driver_serial_fd_write, &oldtio); /* save current serial port settings */
......@@ -266,15 +266,15 @@ void __po_hi_c_driver_serial_linux_init_receiver (__po_hi_device_id id)
return;
}
po_hi_c_driver_serial_fd_read = open (serialconf->devname, O_RDONLY | O_NOCTTY);
po_hi_c_driver_serial_fd_read = open (serialconf->devname, O_RDONLY | O_NOCTTY | O_NONBLOCK);
if (po_hi_c_driver_serial_fd_read < 0)
{
__PO_HI_DEBUG_CRITICAL ("[LINUX SERIAL] Error while opening device %s\n", serialconf->devname);
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Error while opening device %s\n", serialconf->devname);
}
else
{
__PO_HI_DEBUG_INFO ("[LINUX SERIAL] Device successfully opened, fd=%d\n", po_hi_c_driver_serial_fd_read);
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] Device successfully opened for reading, fd=%d\n", po_hi_c_driver_serial_fd_read);
}
tcgetattr (po_hi_c_driver_serial_fd_read, &oldtio); /* save current serial port settings */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment