Internet Protocol Support Profile.
More...
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.
#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.
Profile event handler type.
- Parameters
-
[in] | p_handle | Identifies the connection and channel on which the event occurred. |
[in] | p_evt | Event and related parameters (if any). |
- Returns
- Provision for the application to indicate if the event was successfully processed or not. Currently not used.
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 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_handle | Indicates the connection handle on which IPSP channel is to be created. |
- Return values
-
NRF_SUCCESS | If channel creation request was successful, else, an error code indicating reason for failure. |
Function for disconnecting IP transport.
- Parameters
-
[in] | p_handle | Identifies IPSP transport. |
- Return values
-
NRF_SUCCESS | If 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_evt | BLE event to be handled. |
- Return values
-
NRF_SUCCESS | If handling the event was successful, else, an error code indicating reason for failure. |
Function for initializing the Internet Protocol Support Profile.
- Parameters
-
[in] | p_init | Information needed to initialize the service. |
- Return values
-
NRF_SUCCESS | If 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_handle | Instance of the logical channel and peer for which the data is intended. |
[in] | p_data | Pointer 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_len | Length/size of data to be transferred. |
- Return values
-
NRF_SUCCESS | If sending data was successful, else, an error code indicating reason for failure. |