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

ParameterDescription
[in] connHandleHandle of the connection for image distribution.
[in] lengthLength of the fragment, must not exceed ATT_MTU - 3.
[in] p_dataPointer to the fragmented image data.

Return values

Return valueDescription
MBA_RES_SUCCESSDistribution of the fragmented image started successfully.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAThe provided connection handle is not valid.
MBA_RES_BAD_STATEThe OTA profile is not in the correct state to perform this operation.