nRF5 IoT SDK  v0.9.0
 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   1280
 Maximum Transmit Unit on IPSP channel.
 
#define BLE_IPSP_RX_MPS   50
 Receive MPS used by IPSP.
 
#define BLE_IPSP_RX_BUFFER_SIZE   1280
 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_connect (const ble_ipsp_handle_t *p_handle)
 Function for requesting a channel creation for 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 BLE_IPSP_PSM and is defined by the specification. The MTU mandated by the specification is 1280 bytes.

Note
Attention! To maintain compliance with Nordic Semiconductor ASA's 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).

#define BLE_IPSP_RX_BUFFER_SIZE   1280

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_connect ( const ble_ipsp_handle_t p_handle)

Function for requesting a channel creation for the Internet Protocol Support Profile.

Channel creation for Internet Protocol Support Profile (IPSP) is requested using this API. Connection handle provided in p_handle parameter identifies the peer with which the IPSP channel is being requested. NRF_SUCCESS return value by the API is only indicative of request procedure having succeeded. Result of channel establishment is known when the BLE_IPSP_EVT_CHANNEL_CONNECTED event is notified. Therefore, the application must wait for BLE_IPSP_EVT_CHANNEL_CONNECTED event on successful return of this API.

Parameters
[in]p_handleIndicates the connection handle on which IPSP channel is to be created.
Return values
NRF_SUCCESSIf channel creation request was successful, else, an error code indicating reason for failure.
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, else, an error code indicating reason for failure.
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, else, an error code indicating reason for failure.
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, else, an error code indicating reason for failure.
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.
Note
This memory must be resident and should not be freed unless BLE_IPSP_EVT_CHANNEL_DATA_TX_COMPLETE event is notified.
Parameters
[in]data_lenLength/size of data to be transferred.
Return values
NRF_SUCCESSIf sending data was successful, else, an error code indicating reason for failure.