nRF5 SDK v16.0.0
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
BLE 6LoWPAN library

6LoWPAN techniques defined for BLE. More...

Modules

 6LoWPAN over BLE and Internet Protocol Support Profile library configuration
 

Data Structures

struct  ble_6lowpan_data_rx_t
 Event parameters associated with the BLE_6LO_EVT_INTERFACE_DATA_RX event. More...
 
union  ble_6lowpan_event_param_t
 Asynchronous event parameter type. More...
 
struct  ble_6lowpan_event_t
 Asynchronous event type. More...
 
struct  ble_6lowpan_init_t
 Initialization parameters type. More...
 

Macros

#define BLE_6LOWPAN_MAX_INTERFACE   1
 Maximum 6LoWPAN interface supported by module.
 
#define BLE_6LOWPAN_TX_FIFO_SIZE   16
 Maximum transmit packets that are buffered per interface. More...
 

Typedefs

typedef void(* ble_6lowpan_evt_handler_t )(iot_interface_t *p_interface, ble_6lowpan_event_t *p_event)
 Asynchronous event notification callback type.
 

Enumerations

enum  ble_6lowpan_event_id_t {
  BLE_6LO_EVT_ERROR,
  BLE_6LO_EVT_INTERFACE_ADD,
  BLE_6LO_EVT_INTERFACE_DELETE,
  BLE_6LO_EVT_INTERFACE_DATA_RX
}
 Asynchronous event identifiers type. More...
 

Functions

uint32_t ble_6lowpan_init (const ble_6lowpan_init_t *p_init)
 Initializes the module. More...
 
uint32_t ble_6lowpan_interface_disconnect (const iot_interface_t *p_interface)
 Disconnects 6LoWPAN interface. More...
 
uint32_t ble_6lowpan_interface_send (const iot_interface_t *p_interface, const uint8_t *p_packet, uint16_t packet_len)
 Sends IPv6 packet on the 6LoWPAN interface. More...
 

Detailed Description

6LoWPAN techniques defined for BLE.

This module implements 6LoWPAN techniques defined for BLE, including IP and UDP header compression and decompression and conversion of EUI-48 BLE addresses to EUI-64 and on to IPv6 addresses. This layer does not implement IP level functionality of neighbor discovery etc.

Note
Currently, only the 6LoWPAN node (host) role is supported.

Macro Definition Documentation

#define BLE_6LOWPAN_TX_FIFO_SIZE   16

Maximum transmit packets that are buffered per interface.

FIFO size must be a power of 2.

Enumeration Type Documentation

Asynchronous event identifiers type.

Enumerator
BLE_6LO_EVT_ERROR 

Notification of an error in the module.

BLE_6LO_EVT_INTERFACE_ADD 

Notification of a new 6LoWPAN interface added.

BLE_6LO_EVT_INTERFACE_DELETE 

Notification of a 6LoWPAN interface deleted.

BLE_6LO_EVT_INTERFACE_DATA_RX 

Notification of an IP packet received on the interface.

Function Documentation

uint32_t ble_6lowpan_init ( const ble_6lowpan_init_t p_init)

Initializes the module.

Parameters
[in]p_initInitialization parameters.
Return values
NRF_SUCCESSIf initialization was successful. Otherwise, an error code is returned.
uint32_t ble_6lowpan_interface_disconnect ( const iot_interface_t p_interface)

Disconnects 6LoWPAN interface.

This function is used to terminate connection on the L2CAP CoC layer. It calls ble_ipsp_disconnect to perform disconnection procedure. The registered callback from 6LoWPAN module propagates BLE_6LO_EVT_INTERFACE_DELETE event after operation is finished.

Parameters
[in]p_interfaceIdentifies the interface on which the disconnection has to be performed.
Return values
NRF_SUCCESSIf disconnection was successful. Otherwise, an error code is returned.
uint32_t ble_6lowpan_interface_send ( const iot_interface_t p_interface,
const uint8_t *  p_packet,
uint16_t  packet_len 
)

Sends IPv6 packet on the 6LoWPAN interface.

This function is used to send an IPv6 packet on the interface. 6LoWPAN compression techniques are applied on the packet before the packet is transmitted. The packet might not be transferred to the peer immediately based on the flow control on the BLE Link. In this case, the packet is queued to be transferred later.

Parameters
[in]p_interfaceIdentifies the interface on which the packet is to be sent.
[in]p_packetIPv6 packet to be sent. Memory for the packet should be allocated using mem_alloc and should not be freed. The module is responsible for freeing the memory using mem_free. The module will free the packet once the transmission is complete or the packet can no longer be transmitted (in case of link disconnection.)
[in]packet_lenLength of the IPv6 packet.
Return values
NRF_SUCCESSIf the send request was successful.

Documentation feedback | Developer Zone | Subscribe | Updated