#include <mbg_tgt.h>
#include <mbg_tmo.h>
#include <mbgerror.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
Go to the source code of this file.
|  | 
| int | mbgserio_close (MBGSERIO_DEV **pp_mdev) | 
|  | Close a serial port specified by a MBGSERIO_DEV structure.  More... 
 | 
|  | 
| int | mbgserio_open (MBGSERIO_DEV **pp_mdev, const char *dev_name) | 
|  | Open a serial port and set up a MBGSERIO_DEV structure.  More... 
 | 
|  | 
| int | mbgserio_setup_port_str_list (MBG_STR_LIST **list, int max_devs) | 
|  | 
| void | mbgserio_free_str_list (MBG_STR_LIST *list) | 
|  | 
| int | mbgserio_set_parms (MBGSERIO_DEV *mdev, uint32_t baud_rate, const char *framing) | 
|  | 
| int | mbgserio_read (MBGSERIO_DEV *mdev, void *buffer, unsigned int count) | 
|  | 
| int | mbgserio_write (MBGSERIO_DEV *mdev, const void *buffer, unsigned int count) | 
|  | 
| void | mbgserio_flush_tx (MBGSERIO_DEV *mdev) | 
|  | 
| int | mbgserio_read_wait (MBGSERIO_DEV *mdev, void *buffer, uint count) | 
|  | 
◆ _ext
◆ _USE_SELECT_FOR_SERIAL_IO
      
        
          | #define _USE_SELECT_FOR_SERIAL_IO   1 | 
      
 
 
◆ DEFAULT_SERIAL_DEVICE_NAME
      
        
          | #define DEFAULT_SERIAL_DEVICE_NAME   "/dev/ttyS0" | 
      
 
 
◆ DEFAULT_SERIAL_DEVICE_NAME_2
      
        
          | #define DEFAULT_SERIAL_DEVICE_NAME_2   "/dev/ttyS1" | 
      
 
 
◆ MBG_STR_LIST
◆ mbgserio_close()
Close a serial port specified by a MBGSERIO_DEV structure. 
After the port has been closed the buffer which had been allocated for the MBGSERIO_DEV structure is freed, and the pointer to that buffer is set to NULL.
- Parameters
- 
  
    | [in,out] | pp_mdev | Address of a pointer to the control structure including the port handle |  
 
- Returns
- One of the MBG_RETURN_CODES 
Referenced by mbgextio_close_connection().
 
 
◆ mbgserio_flush_tx()
◆ mbgserio_free_str_list()
◆ mbgserio_open()
      
        
          | int mbgserio_open | ( | MBGSERIO_DEV ** | pp_mdev, | 
        
          |  |  | const char * | dev_name | 
        
          |  | ) |  |  | 
      
 
Open a serial port and set up a MBGSERIO_DEV structure. 
- Parameters
- 
  
    | [in,out] | pp_mdev | Address of a pointer to a MBGSERIO_DEV device control structure allocated and set up by this call. Set to NULL on error. |  | [in] | dev_name | Device name of the port to be opened. |  
 
- Returns
- One of the MBG_RETURN_CODES 
Referenced by dev_open_finish_setup().
 
 
◆ mbgserio_read()
      
        
          | int mbgserio_read | ( | MBGSERIO_DEV * | mdev, | 
        
          |  |  | void * | buffer, | 
        
          |  |  | unsigned int | count | 
        
          |  | ) |  |  | 
      
 
 
◆ mbgserio_read_wait()
◆ mbgserio_set_parms()
      
        
          | int mbgserio_set_parms | ( | MBGSERIO_DEV * | mdev, | 
        
          |  |  | uint32_t | baud_rate, | 
        
          |  |  | const char * | framing | 
        
          |  | ) |  |  | 
      
 
 
◆ mbgserio_setup_port_str_list()
      
        
          | int mbgserio_setup_port_str_list | ( | MBG_STR_LIST ** | list, | 
        
          |  |  | int | max_devs | 
        
          |  | ) |  |  | 
      
 
 
◆ mbgserio_write()
      
        
          | int mbgserio_write | ( | MBGSERIO_DEV * | mdev, | 
        
          |  |  | const void * | buffer, | 
        
          |  |  | unsigned int | count | 
        
          |  | ) |  |  |