Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-libxively-6eca970 by
comm_layer_t Struct Reference
_The communication layer interface_ - contains function pointers, that's what we expose to the layers above and below More...
#include <comm_layer.h>
Data Fields | |
| connection_t *(* | open_connection )(const char *address, int32_t port) |
| Connect to a given host using it's address and port. | |
| int(* | send_data )(connection_t *conn, const char *data, size_t size) |
| Send data over the connection. | |
| int(* | read_data )(connection_t *conn, char *buffer, size_t buffer_size) |
| Read data from a connection. | |
| void(* | close_connection )(connection_t *conn) |
| Close connection and free all allocated memory (if any) | |
Detailed Description
_The communication layer interface_ - contains function pointers, that's what we expose to the layers above and below
It is effectively a class that holds declarations of pure virtual functions.
The interface contain methods related to connecting/disconnecting as well as reading/writing data to/from the remote endpoint.
This interface uses abstract `connection_t` class to hold information about the connection in a platform-independent fashion.
Definition at line 37 of file comm_layer.h.
Field Documentation
| void( * close_connection)(connection_t *conn) |
Close connection and free all allocated memory (if any)
- Note:
- Some implementations may be stack-based as only limited number of connections is expected in a typical use-case.
Definition at line 65 of file comm_layer.h.
| connection_t*( * open_connection)(const char *address, int32_t port) |
Connect to a given host using it's address and port.
- Note:
- It should not reset an existing connection.
- Returns:
- Pointer to `connection_t` or `0` in case of an error.
Definition at line 44 of file comm_layer.h.
| int( * read_data)(connection_t *conn, char *buffer, size_t buffer_size) |
Read data from a connection.
- Returns:
- Number of bytes read or `-1` in case of an error.
Definition at line 58 of file comm_layer.h.
| int( * send_data)(connection_t *conn, const char *data, size_t size) |
Send data over the connection.
- Returns:
- Number of bytes sent or `-1` in case of an error.
Definition at line 51 of file comm_layer.h.
Generated on Wed Jul 13 2022 02:16:23 by
1.7.2
