source: azure_iot_hub_f767zi/trunk/asp_baseplatform/lwip/contrib-2.1.0/ports/unix/port/include/netif/sio.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.6 KB
Line 
1#ifndef SIO_UNIX_H
2#define SIO_UNIX_H
3
4#include "lwip/sys.h"
5#include "lwip/netif.h"
6#include "netif/fifo.h"
7/*#include "netif/pppif.h"*/
8
9struct sio_status_s {
10 int fd;
11 fifo_t myfifo;
12};
13
14/* BAUDRATE is defined in sio.c as it is implementation specific */
15/** Baudrates */
16typedef enum sioBaudrates {
17 SIO_BAUD_9600,
18 SIO_BAUD_19200,
19 SIO_BAUD_38400,
20 SIO_BAUD_57600,
21 SIO_BAUD_115200
22} sioBaudrates;
23
24/**
25* Poll for a new character from incoming data stream
26* @param siostat siostatus struct, contains sio instance data, given by sio_open
27* @return char read from input stream, or < 0 if no char was available
28*/
29s16_t sio_poll(sio_status_t * siostat);
30
31/**
32* Parse incoming characters until a string str is recieved, blocking call
33* @param str zero terminated string to expect
34* @param siostat siostatus struct, contains sio instance data, given by sio_open
35*/
36void sio_expect_string(u8_t *str, sio_status_t * siostat);
37
38/**
39* Write a char to output data stream
40* @param str pointer to a zero terminated string
41* @param siostat siostatus struct, contains sio instance data, given by sio_open
42*/
43void sio_send_string(u8_t *str, sio_status_t * siostat);
44
45/**
46* Flush outbuffer (send everything in buffer now), useful if some layer below is
47* holding on to data, waitng to fill a buffer
48* @param siostat siostatus struct, contains sio instance data, given by sio_open
49*/
50void sio_flush( sio_status_t * siostat );
51
52/**
53* Change baudrate of port, may close and reopen port
54* @param baud new baudrate
55* @param siostat siostatus struct, contains sio instance data, given by sio_open
56*/
57void sio_change_baud( sioBaudrates baud, sio_status_t * siostat );
58
59#endif
60
Note: See TracBrowser for help on using the repository browser.