Table of Contents
The core IPv6 module handles the initialization of various modules and registers a callback function.
To start Nordic's IPv6 Stack, call ipv6_init with the EUI-64 that was constructed using IPV6_EUI64_CREATE_FROM_EUI48 . The application must also define an asynchronous callback to receive information about the IPv6 interface.
ipv6_init function initializes the following modules:
- Memory manager
- Packet Buffer
- Context Manager
- User Datagram Protocol (UDP) (internal)
- Internet Control Message Protocol (ICMP) (internal)
Asynchronous Event Notification Callback
IPv6 notifies the application of the following asynchronous events, using the callback function that was registered during initialization:
| Event | Description |
|---|---|
| IPV6_EVT_INTERFACE_ADD | Notification that an IPv6 interface was added. |
| IPV6_EVT_INTERFACE_DELETE | Notification that an IPv6 interface was deleted. |
| IPV6_EVT_INTERFACE_RX_DATA | Notification of IPv6 data, depending on the configuration (see IPV6_ENABLE_UNSUPPORTED_PROTOCOLS_TO_APPLICATION ) |
The IPv6 stack supports only ICMPv6 and UDP, but other transport protocols like TCP can be implemented using asynchronous unsupported protocol events. In this case, you must enable IPV6_ENABLE_UNSUPPORTED_PROTOCOLS_TO_APPLICATION .
Code examples
IPv6 initialization
Configuration parameters
The following configuration parameters should be defined in
sdk_config.h
.
IPV6_DISABLE_LOGS
Disables debug tracing in the module. To enable tracing, this flag must be set to 0 and ENABLE_DEBUG_LOG_SUPPORT must be set to 1.
| Description | Value |
|---|---|
| Enable debug trace | 0 |
| Disable debug trace | 1 |
| Dependencies | ENABLE_DEBUG_LOG_SUPPORT |
IPV6_DISABLE_API_PARAM_CHECK
Disables API parameter checks in the module. Set this define to 1 to disable checks on API parameters in the module.
API parameter checks are added to ensure that the correct parameters are passed to the module. These checks are useful during development phase, but they might be redundant when the application is finalized. Disabling these checks might improve performance.
| Description | Value |
|---|---|
| Enable API parameters check | 0 |
| Disable API parameters check | 1 |
| Dependencies | None |
IPV6_MAX_INTERFACE
Maximum number of interfaces that can be managed by the module. This is usually as many 6LoWPAN channels as the application is configured to support.
| Restriction | Value |
|---|---|
| Minimum value | 1 |
| Maximum value | BLE_6LOWPAN_MAX_INTERFACE |
| Recommended value | BLE_6LOWPAN_MAX_INTERFACE |
| Dependencies | BLE_6LOWPAN_MAX_INTERFACE |
IPV6_DEFAULT_HOP_LIMIT
Default value of the hop limit in IPv6 header.
| Restriction | Value |
|---|---|
| Minimum value | 1 |
| Maximum value | 255 |
| Dependencies | None |
IPV6_ENABLE_UNSUPPORTED_PROTOCOLS_TO_APPLICATION
Enables calls of the application event handler if using an unsupported transport protocols (for example, TCP).
| Description | Value |
|---|---|
| Enable | 1 |
| Disable | 0 |
| Dependencies | None |