BLE_OTAPC_FragmentDist
C
uint16_t BLE_OTAPC_FragmentDist(uint16_t connHandle, uint16_t length, uint8_t *p_data);
Description
Distributes a fragmented firmware image to a server device for OTA DFU.
Note
The application should wait for the BLE_OTAPC_EVT_FRAGMENT_COMPL_IND event after the total length of sent fragmented images reaches the maximum size before sending the next set of fragments. If the remaining fragmented image is smaller than the maximum size, BLE_OTAPC_EVT_FRAGMENT_COMPL_IND will be triggered once the server receives the complete image.
Parameters
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection for image distribution. |
[in] length | Length of the fragment, must not exceed ATT_MTU - 3. |
[in] p_data | Pointer to the fragmented image data. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Distribution of the fragmented image started successfully. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | The provided connection handle is not valid. |
MBA_RES_BAD_STATE | The OTA profile is not in the correct state to perform this operation. |