BLE_OTAPC_FragmentDist

C

uint16_t BLE_OTAPC_FragmentDist(uint16_t connHandle, uint16_t length, uint8_t *p_data);

Description

Distribute fragmented firmware image to Server device for OTA DFU operation.

Application shall wait the BLE_OTAPC_EVT_FRAGMENT_COMPL_IND after the total length of sent fragmented images reaches to max fragmented image size before distributing the next fragmented images. If the length of remaining fragmented image is less than max fragmented image size, BLE_OTAPC_EVT_FRAGMENT_COMPL_IND will be generated once the complete image is received by server.

Parameters

ParameterDescription
[in] connHandleHandle of the connection to do fragmented image distribution.
[in] lengthThe length of fragment. It should not exceed ATT_MTU - 3.
[in] p_dataThe fragmented image data.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts fragmented image distribution.
MBA_RES_OOMNo available memory.
MBA_RES_INVALID_PARAInvalid parameters. - Connection handle is not valid. - The length is exceed ATT_MTU - 3. - The total length of sent fragmented images + length exceeds max fragmented image size.
MBA_RES_BAD_STATEOTA profile server has not allowed to perform firmware update proceudre yet.