FreeRTOS Tetris
Macros | Typedefs | Enumerations | Functions
AsyncIO.h File Reference

A single file asyncronous UNIX communications library to perform UDP, TCP and POSIX message queue communications. More...

#include <netinet/in.h>
Include dependency graph for AsyncIO.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MQ_MAXMSG   256
 
#define MQ_MSGSIZE   256
 

Typedefs

typedef void * aIO_handle_t
 Handle used to reference and opened asyncronour communications channel.
 
typedef void(* aIO_callback_t) (size_t recv_size, char *buffer, void *args)
 Callback for an asynchronous IO connection. More...
 

Enumerations

enum  aIO_socket_e { UDP, TCP }
 Socket protocols supported.
 

Functions

void aIODeinit (void)
 Function that closes all open connections. More...
 
void aIOCloseConn (aIO_handle_t conn)
 Closes a connection and frees all resources used by that connection. More...
 
int aIOMessageQueuePut (char *mq_name, char *buffer)
 Sends the data stored in buffer to the message queue with the provided name. More...
 
int aIOSocketPut (aIO_socket_e protocol, char *s_addr, in_port_t port, char *buffer, size_t buffer_size)
 Send the data stored in buffer to the socket described by s_addr and port. More...
 
aIO_handle_t aIOOpenMessageQueue (char *name, long max_msg_num, long max_msg_size, aIO_callback_t callback, void *args)
 Open a POSIX message queue. More...
 
aIO_handle_t aIOOpenUDPSocket (char *s_addr, in_port_t port, size_t buffer_size, aIO_callback_t callback, void *args)
 Opens a socket enpoint. More...
 
aIO_handle_t aIOOpenTCPSocket (char *s_addr, in_port_t port, size_t buffer_size, aIO_callback_t callback, void *args)
 Opens a socket enpoint. More...
 

Detailed Description

A single file asyncronous UNIX communications library to perform UDP, TCP and POSIX message queue communications.

Author
Alex Hoffman
Date
20 January 2020
   ----------------------------------------------------------------------
    Copyright (C) Alexander Hoffman, 2019
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------