OTA_SERVICE_Transport_ackResp

C

bool OTA_SERVICE_Transport_ackResp(void)

Summary

Send acknowledgment after every frame.

Description

This function is responsible for sending an acknowledgement signal to RNBD after each frame is received.

Precondition

This function is designed to send an acknowledgment upon the successful reading of the data frame. Therefore, it is imperative that the data read function is executed prior to this.

Parameters

None

Returns

Upon sending an acknowledgment to RNBD, the response message is being read. If a successful response is received, this function will return true; otherwise, it will return zero.

Example

static char OTAA2_ACK[9] = {'O', 'T', 'A', 'A', ',', '0', '2', '\r', '\n'};
static char OTAA_RESP[10] = {'A', 'O', 'K', '\r', '\n', 'D', 'F', 'U', '>', ' '}; 
bool OTA_SERVICE_Transport_ackResp(void) {
    bool ret = true;
    (void)OTA_SERVICE_Transport_MsgSend(NULL, OTAA2_ACK, sizeof (OTAA2_ACK));
    if (OTA_SERVICE_Transport_RspRecv(NULL, OTAA_RESP, sizeof (OTAA_RESP)) != sizeof (OTAA_RESP)) {

        return false;
    }
    return ret;
}

Remarks

None.