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 <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.
#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.
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 disconnecting IP transport.
- Parameters
-
[in] | p_handle | Identifies IPSP transport. |
- Return values
-
NRF_SUCCESS | If 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_evt | BLE event to be handled. |
- Return values
-
NRF_SUCCESS | If handling the event was successful. Otherwise, an error code is returned. |
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. 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_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. 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_len | Length/size of data to be transferred. |
- Return values
-
NRF_SUCCESS | If sending data was successful. Otherwise, an error code is returned. |