lwIP  2.1.0
Lightweight IP stack
6LoWPAN over BLE (RFC7668)

Functions

void ble_addr_to_eui64 (uint8_t *dst, const uint8_t *src, int public_addr)
 
void eui64_to_ble_addr (uint8_t *dst, const uint8_t *src)
 
err_t rfc7668_set_context (u8_t idx, const ip6_addr_t *context)
 
err_t rfc7668_output (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr)
 
err_t rfc7668_input (struct pbuf *p, struct netif *netif)
 
err_t rfc7668_if_init (struct netif *netif)
 

Detailed Description

This file implements a RFC7668 implementation for 6LoWPAN over Bluetooth Low Energy. The specification is very similar to 6LoWPAN, so most of the code is re-used. Compared to 6LoWPAN, much functionality is already implemented in lower BLE layers (fragmenting, session management,...).

Usage:

Function Documentation

◆ ble_addr_to_eui64()

void ble_addr_to_eui64 ( uint8_t *  dst,
const uint8_t *  src,
int  public_addr 
)

convert BT address to EUI64 addr

This method converts a Bluetooth MAC address to an EUI64 address, which is used within IPv6 communication

Parameters
dstIPv6 destination space
srcBLE MAC address source
public_addrIf the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise
See also
LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS

◆ eui64_to_ble_addr()

void eui64_to_ble_addr ( uint8_t *  dst,
const uint8_t *  src 
)

convert EUI64 address to Bluetooth MAC addr

This method converts an EUI64 address to a Bluetooth MAC address,

Parameters
dstBLE MAC address destination
srcIPv6 source

◆ rfc7668_if_init()

err_t rfc7668_if_init ( struct netif netif)

Initialize the netif

No flags are used (broadcast not possible, not ethernet, ...) The shortname for this netif is "BT"

Parameters
netifthe network interface to be initialized as RFC7668 netif
Returns
ERR_OK if everything went fine

◆ rfc7668_input()

err_t rfc7668_input ( struct pbuf p,
struct netif netif 
)

Process a received raw payload from an L2CAP channel

Parameters
pthe received packet, p->payload pointing to the IPv6 header (maybe compressed)
netifthe network interface on which the packet was received
Returns
ERR_OK if everything was fine

◆ rfc7668_output()

err_t rfc7668_output ( struct netif netif,
struct pbuf q,
const ip6_addr_t ip6addr 
)

Compress outgoing IPv6 packet and pass it on to netif->linkoutput

Parameters
netifThe lwIP network interface which the IP packet will be sent on.
qThe pbuf(s) containing the IP packet to be sent.
ip6addrThe IP address of the packet destination.
Returns
See rfc7668_compress

◆ rfc7668_set_context()

err_t rfc7668_set_context ( u8_t  idx,
const ip6_addr_t context 
)

Set context id IPv6 address

Store one IPv6 address to a given context id.

Parameters
idxContext id
contextIPv6 addr for this context
Returns
ERR_OK (if everything is fine), ERR_ARG (if the context id is out of range), ERR_VAL (if contexts disabled)