32 #ifndef __CDN_CLIENT_H__ 33 #define __CDN_CLIENT_H__ 39 #define MAX_DIR_FILES 4 40 #define MAX_CDN_FILE_NAME_SIZE 128 44 uint8_t OtaFileName[MAX_CDN_FILE_NAME_SIZE+1];
60 int32_t CurrDirFileIndex;
73 #define CDN_STATUS_OK (0L) 74 #define CDN_STATUS_ERROR_SL_SEND (-20201L) 75 #define CDN_STATUS_ERROR_SL_RECV_HDR_EAGAIN (-20202L) 76 #define CDN_STATUS_ERROR_PARSE_URL_NOT_FOUND (-20203L) 77 #define CDN_STATUS_ERROR_PARSE_DIR_NO_ARRAY (-20204L) 78 #define CDN_STATUS_ERROR_PARSE_DIR_NO_OBJECT (-20205L) 79 #define CDN_STATUS_ERROR_PARSE_DIR_NO_FILE_SIZE (-20206L) 80 #define CDN_STATUS_ERROR_PARSE_DIR_NO_FILE_NAME (-20207L) 82 int16_t CdnClient_Init(
CdnClient_t *pCdnClient, uint8_t *pNetBuf);
84 int16_t CdnClient_CloseServer(
CdnClient_t *pCdnClient);
85 int16_t CdnClient_ReqOtaDir(
CdnClient_t *pCdnClient, uint8_t *pVendorDir);
86 uint8_t *CdnClient_GetNextDirFile(
CdnClient_t *pCdnClient, int32_t *OtaFileSize);
87 int16_t CdnClient_ReqFileUrl(
CdnClient_t *pCdnClient, uint8_t *pOtaFileName, uint8_t *pFileUrlBuf, uint32_t FileUrlBufSize);
88 int16_t CdnClient_ConnectFileServer(
CdnClient_t *pCdnClient, uint8_t *pFileUrl, int32_t SecuredConnection);
89 int16_t CdnClient_ReqFileContent(
CdnClient_t *pCdnClient, uint8_t *pFileUrl);
90 int16_t CdnClient_CloseFileServer(
CdnClient_t *pCdnClient);
91 int16_t CdnClient_RecvSkipHdr(int16_t SockId, uint8_t *pRespBuf, int16_t RespBufSize);
92 int16_t CdnClient_RecvAppend(int16_t SockId, uint8_t *pRecvBuf, int16_t RecvBufSize, int16_t RecvLen, int16_t RecvOffset);