Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Changes between Version 4 and Version 5 of TBR/Website/FAQ


Ignore:
Timestamp:
04/30/07 04:49:00 (17 years ago)
Author:
Paulw
Comment:

Descript RTEMS_IO_RCVWAKEUP

Legend:

Unmodified
Added
Removed
Modified
  • TBR/Website/FAQ

    v4 v5  
    2222
    2323Not that I know of but I do know Robert Wade. :)
     24
     25
     265. ''Does RTEMS support select() on serial ports
     27
     28No. However, there is a method to register a call back on serial communications that can be used
     29for the same effect.  ioctl( fd, RTEMS_IO_RCVWAKEUP, &wakeup);
     30
     31Here is a code snippet:
     32
     33void receive_callback(struct termios *tty, void * arg )
     34{
     35    (void) rtems_event_send( (rtems_id) arg, EVENT_RS232_RX );
     36}
     37
     38To install the callback
     39
     40   rtems_id task;
     41   struct ttywakeup wakeup;
     42
     43   rtems_task_ident( RTEMS_SELF, RTEMS_LOCAL, &task);
     44
     45   wakeup.sw_pfn = receive_callback;
     46   wakeup.sw_arg = (void *) task ;
     47
     48   ioctl( fd, RTEMS_IO_RCVWAKEUP, &wakeup);