INet
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.
Header
#include <inet/inet.h>
Functions
void | inet_start (void) |
void | inet_finish (void) |
Types and Constants
enum | ierror_t |
struct | Http |
The INet library implements general Internet protocols. Although Sockets allow us to open a communication channel between two remote machines, it is necessary to define a format for the messages that both interlocutors will exchange, in order for communication to be carried out satisfactorily. Any modern operating system provides APIs to use the most popular Internet services, like HTTP. INet accesses this functionality under a common unified and simplified interface (Figure 1).
Important. To use INet in your projects, you will have to link the library explicitly in theCMakeLists.txt
of your application, through the macronap_link_inet
.
1 2 |
nap_desktop_app(Products "" NRC_EMBEDDED) nap_link_inet(Products) |
Important. On Linux you will need to install the curl development libraries.
1 |
sudo apt-get install libcurl4-openssl-dev |

enum ierror_t
Error codes of network connections.
enum ierror_t
{
ekINONET,
ekINOHOST,
ekITIMEOUT,
ekISTREAM,
ekISERVER,
ekINOIMPL,
ekIUNDEF,
ekIOK
};
ekINONET | There is no internet connection on the device. |
ekINOHOST | Unable to connect to the remote server. |
ekITIMEOUT | Maximum timeout for connection has been exceeded. |
ekISTREAM | Error in the I/O channel when reading or writing. |
ekISERVER | Error in server response format. |
ekINOIMPL | Functionality not implemented. |
ekIUNDEF | Undetermined error. |
ekIOK | No error. |
struct Http
Manage an HTTP connection initiated from the client process.
struct Http;
inet_start ()
Start the inet library, reserving space for the global internal structures.
void
inet_start(void);
inet_finish ()
Ends the inet library, freeing the space of the global internal structures.
void
inet_finish(void);