20 #include <constants.h> 25 #ifndef _BASICTYPES_H_ 26 #include <basictypes.h> 78 int read(
int fd,
char *buf,
int nbytes);
103 int peek(
int fd,
char *c);
130 int write(
int fd,
const char *buf,
int nbytes);
175 int writeall(
int fd,
const char *buf,
int nbytes);
209 int ReadWithTimeout(
int fd,
char *buf,
int nbytes,
unsigned long timeout);
264 int readall(
int fd,
char *buf,
int nbytes);
371 #define FD_SETSIZE (FDSET_ELEMENTS * 32) 376 uint32_t fd_set_elements[FDSET_ELEMENTS];
377 } __attribute__((packed)) fd_set;
436 void FD_CLR(
int fd, fd_set *pfds);
450 void FD_SET(
int fd, fd_set *pfds);
467 int extern_sem_select(
int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds,
OS_SEM &sem,
unsigned long timeout);
494 int select(
int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds,
unsigned long timeout);
518 int ZeroWaitSelect(
int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds);
528 #define IOCTL_TX_CHANGE_CRLF (1) 529 #define IOCTL_RX_CHANGE_CRLF (2) 530 #define IOCTL_RX_PROCESS_EDITS (4) 531 #define IOCTL_RX_ECHO (8) 532 #define IOCTL_TX_NO_BLOCK (32) 533 #define IOCTL_ALL_OPTIONS (15) 540 #define IOCTL_SET (0x4000) 541 #define IOCTL_CLR (0x2000) 565 int ioctl(
int fd,
int cmd);
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, unsigned long timeout)
This function waits for events to occur on one or more I/O resources associated with a set of file de...
Definition: iosys.cpp:362
int writeavail(int fd)
Check to see if a file descriptor is available for write.
Definition: iosys.cpp:407
int writestring(int fd, const char *str)
This function writes null terminated string data to the stream associated with a file descriptor (fd)...
Definition: iosys.cpp:387
void FDCallBack(int fd, FDChangeType change, void *pData)
This defines the funciton signature for FD notifcation callbacks.
Definition: iosys.h:398
void IrqStdio()
Automatically open the system default serial port in interrupt mode using the system default baud rat...
Definition: IrqStdio.cpp:12
int haserror(int fd)
Check to see if a file descriptor has an error.
Definition: iosys.cpp:412
Semaphores are used to control access to shared resource critical section, or to communicate between ...
Definition: nbrtos.h:318
int CurrentStdioFD(int stdio_fd)
Determine the current file descriptor mapped to stdio file.
Definition: fileio.cpp:453
int readall(int fd, char *buf, int nbytes)
This function reads data from a file descriptor (fd), with a specified time-out value (as opposed to ...
Definition: iosys.cpp:209
int PeekWithTimeout(int fd, char *c, unsigned long timeout)
This function peeks at data from a file descriptor (fd), with a specified time-out value (as opposed ...
int write(int fd, const char *buf, int nbytes)
This function writes data to the stream associated with a file descriptor (fd).
Definition: fileio.cpp:152
void FD_ZERO(fd_set *pfds)
This function zero's an fd_set (file descriptor set) so that it has no file descriptors (fds) selecte...
Definition: iosys.cpp:214
void RegisterFDCallBack(int fd, FDCallBack *fp, void *pData)
Register a call back function to recieve notifcation when an FD state changes. Register a NULL pf to ...
Definition: iosys.cpp:41
void FD_CLR(int fd, fd_set *pfds)
An fd_set (file descriptor set) holds a set of file descriptors (fds). This function clears or remove...
Definition: iosys.cpp:225
int ioctl(int fd, int cmd)
This function controls the selection of input/output control options for stdio: stdin = 0...
Definition: fileio.cpp:81
int read(int fd, char *buf, int nbytes)
This function reads data from a file descriptor (fd), and will block forever until at least one byte ...
Definition: fileio.cpp:288
int peek(int fd, char *c)
This function peeks at data from a file descriptor (fd), and will block forever until at least one by...
Definition: fileio.cpp:232
int ReadWithTimeout(int fd, char *buf, int nbytes, unsigned long timeout)
This function reads data from a file descriptor (fd), with a specified time-out value (as opposed to ...
Definition: iosys.cpp:164
FDChangeType
This enum lists the notificatiosn that a registered FD monitor can recieve.
Definition: iosys.h:382
int writeall(int fd, const char *buf, int nbytes)
This function writes data to the stream associated with a file descriptor (fd).
Definition: iosys.cpp:368
int ReplaceStdio(int stdio_fd, int new_fd)
This function allows you to map stdio to any file descriptor (fd).
Definition: fileio.cpp:431
int ReadAllWithTimeout(int fd, char *buf, int nbytes, unsigned long timeout)
This function reads data from a file descriptor (fd), with a specified time-out value (as opposed to ...
Definition: iosys.cpp:185
int FD_ISSET(int fd, fd_set *pfds)
An fd_set (file descriptor set) holds a set of file descriptors (fds). This function indicates whethe...
Definition: iosys.cpp:245
int charavail()
This function checks to see if data is available for read on stdin.
Definition: fileio.cpp:415
int dataavail(int fd)
This function checks to see if data is available for read.
Definition: iosys.cpp:401
int close(int fd)
This function closes the resources associated with a file descriptor (fd). This can be a TCP socket o...
Definition: fileio.cpp:99
void FD_SET(int fd, fd_set *pfds)
An fd_set (file descriptor set) holds a set of file descriptors (fds). This function sets or adds a s...
Definition: iosys.cpp:235
int ZeroWaitSelect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds)
This function returns whether events have occurred on one or more I/O resources associated with a set...
Definition: iosys.cpp:280