Network interface functions#
The header file for the Network interface is fullsdknet.h
.
NOTE:: Use the functions of the Management interface to configure lab.SCHC FullSDK stack before using the Network interface.
The network interface allows the application to send and receive raw IPv6 packets to and from a remote application.
In order to be able to use this interface, extension API functions (fullsdkextapi.h) must be formerly used to configure the network information.
- Sending packets – If a data packet to send is larger than what Layer 2 can accept, the fragmentation mechanism is activated. This fragmentation is transparent to the remote application: it will receive the data packet all at once.
- Receiving packets – Fragmentation can also be activated in a receive operation, if the packet sent by the remote application is larger than what Layer 2 can accept.
Initialization#
The first function that the application must call is net_initialize()
to be
able to send or receive data packets.
This function must be provided with the following callback parameters:
transmission_result
: It will inform the application of the end of a send request (success or failure).data_received
: It will inform the application when a data packet is received.
net_initialize()
returns a status code indicating whether the initialization
is successful or not.
Configuration#
The configuration of the network interface highly depends on the application that uses it.
Configuration functions are provided in the extension API (fullsdkextapi.h
header file) to meet the integrator's specific application needs.
Transmission#
A send operation is requested by calling the net_sendto()
function. The
function immediately returns a status that informs the caller whether the
request has been accepted or not.
The request can be refused, for example when there is an ongoing send operation, or when the connectivity is not available.
If the request has been accepted, the result of the send operation will be
provided later, by a call to the net_transmission_result
callback (which is
provided at initialization by net_initialize()
).
A new request will not be accepted until the net_transmission_result
callback
is called.
Reception#
When a data packet is received, the related callback declared via
net_initialize()
, is called.
Check the header file (fullsdknet.h
) for information about flow control for
reception.