nRF51 IoT SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Internet Protocol Support Profile

Internet Protocol Support Profile. More...

Data Structures

struct  ble_ipsp_evt_t
 IPSP event and associated parameter type. More...
 
struct  ble_ipsp_handle_t
 IPSP handle. More...
 
struct  ble_ipsp_init_t
 IPSP initialization structure. More...
 

Macros

#define BLE_IPSP_MAX_CHANNELS   1
 Maximum IPSP channels required to be supported.
 
#define BLE_IPSP_MTU   1024
 Maximum Transmit Unit on IPSP channel.
 
#define BLE_IPSP_RX_MPS   50
 Receive MPS used by IPSP.
 
#define BLE_IPSP_RX_BUFFER_SIZE   1024
 Maximum data size that can be received. More...
 
#define BLE_IPSP_RX_BUFFER_COUNT   4
 Maximum number of receive buffers. More...
 
#define BLE_IPSP_PSM   0x0023
 L2CAP Protocol Service Multiplexers number.
 
#define BLE_IPSP_INVALID_CID   0x0000
 Invalid channel ID representation.
 

Typedefs

typedef uint32_t(* ble_ipsp_evt_handler_t )(ble_ipsp_handle_t *p_handle, ble_ipsp_evt_t *p_evt)
 Profile event handler type. More...
 

Enumerations

enum  ble_ipsp_evt_type_t {
  BLE_IPSP_EVT_CHANNEL_CONNECTED,
  BLE_IPSP_EVT_CHANNEL_DISCONNECTED,
  BLE_IPSP_EVT_CHANNEL_DATA_RX,
  BLE_IPSP_EVT_CHANNEL_DATA_TX_COMPLETE
}
 IPSP Event IDs. More...
 

Functions

uint32_t ble_ipsp_init (const ble_ipsp_init_t *p_init)
 Function for initializing the Internet Protocol Support Profile. More...
 
uint32_t ble_ipsp_send (ble_ipsp_handle_t const *p_handle, uint8_t const *p_data, uint16_t data_len)
 Function for sending IP data to peer. More...
 
uint32_t ble_ipsp_disconnect (ble_ipsp_handle_t const *p_handle)
 Function for disconnecting IP transport. More...
 
void ble_ipsp_evt_handler (ble_evt_t *p_evt)
 BLE event handler function. More...
 

Detailed Description

Internet Protocol Support Profile.

This module implements the Internet Protocol Support Profile creating and managing transport for 6lowpan. GATT is used to discover if IPSP is supported or not, but no IP data is exchanged over GATT. To exchange data, LE L2CAP Credit Mode is used. The PSM used for the channel is <TBD=0x1005(for now)> and is defined by the specification. The MTU mandated by the specification is 1280 bytes.

Note
Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.

Macro Definition Documentation

#define BLE_IPSP_RX_BUFFER_COUNT   4

Maximum number of receive buffers.

Maximum number of receive buffers to be used per IPSP channel. Each receive buffer is of size BLE_IPSP_RX_BUFFER_SIZE. This configuration has implications on the number of SDUs that can be received while an SDU is being consumed by the application (6lowpan/IP Stack). This configuration also has implications on RAM usage, in combination with BLE_IPSP_RX_BUFFER_SIZE. Therefore, make sure to tune these configuration options based on your application requirements and the permissible RAM usage for the module.

#define BLE_IPSP_RX_BUFFER_SIZE   1024

Maximum data size that can be received.

Maximum data size that can be received on the IPSP channel. Modify this values to intentionally set a receive size less than the MTU set on the channel.

Typedef Documentation

typedef uint32_t(* ble_ipsp_evt_handler_t)(ble_ipsp_handle_t *p_handle, ble_ipsp_evt_t *p_evt)

Profile event handler type.

Parameters
[in]p_handleIdentifies the connection and channel on which the event occurred.
[in]p_evtEvent and related parameters (if any).
Returns
Provision for the application to indicate if the event was successfully processed or not. Currently not used.

Enumeration Type Documentation

IPSP Event IDs.

Enumerator
BLE_IPSP_EVT_CHANNEL_CONNECTED 

Channel connection event.

BLE_IPSP_EVT_CHANNEL_DISCONNECTED 

Channel disconnection event.

BLE_IPSP_EVT_CHANNEL_DATA_RX 

Data received on channel event.

BLE_IPSP_EVT_CHANNEL_DATA_TX_COMPLETE 

Requested data transmission complete on channel event.

Function Documentation

uint32_t ble_ipsp_disconnect ( ble_ipsp_handle_t const *  p_handle)

Function for disconnecting IP transport.

Parameters
[in]p_handleIdentifies IPSP transport.
Return values
NRF_SUCCESSIf disconnecting was successful. Otherwise, an error code is returned.
void ble_ipsp_evt_handler ( ble_evt_t *  p_evt)

BLE event handler function.

Parameters
[in]p_evtBLE event to be handled.
Return values
NRF_SUCCESSIf handling the event was successful. Otherwise, an error code is returned.
uint32_t ble_ipsp_init ( const ble_ipsp_init_t p_init)

Function for initializing the Internet Protocol Support Profile.

Parameters
[in]p_initInformation needed to initialize the service.
Return values
NRF_SUCCESSIf initialization of the service was successful. Otherwise, an error code is returned.
uint32_t ble_ipsp_send ( ble_ipsp_handle_t const *  p_handle,
uint8_t const *  p_data,
uint16_t  data_len 
)

Function for sending IP data to peer.

Parameters
[in]p_handleInstance of the logical channel and peer for which the data is intended.
[in]p_dataPointer to memory containing the data to be transmitted. This memory must be resident and should therefore not be freed unless indicated by the BLE_IPSP_EVT_CHANNEL_DATA_TX_COMPLETE event.
[in]data_lenLength/size of data to be transferred.
Return values
NRF_SUCCESSIf sending data was successful. Otherwise, an error code is returned.