1.1.9.12 WDRV_WINC_FILE_CTX

Struct type

Summary

Structure for file transfer data context.

Description

Maintains state information about a file transfer.

Remarks

None.

typedef struct
{
    /* Flag indicating if structure is in use. */
    bool inUse;

    /* Flag indicating if the transfer is closing. */
    bool close;

    /* File type of file being transfered. */
    WDRV_WINC_FILE_TYPE type;

    /* Transfer handle returned by FS=LOAD operation. */
    uint16_t tsfrHandle;

    /* Command request handle of FS=LOAD, only valid until transfer
    handle is returned. */
    WINC_CMD_REQ_HANDLE cmdReqHandle;

    /* Pointer to transfer status callback. */
    WDRV_WINC_FILE_STATUS_CALLBACK pfFileStatusCb;

    /* User supplied context value passed to callback. */
    uintptr_t fileStatusCbCtx;

    /* Size of the file being transferred. */
    size_t fileSize;

    /* Union of operation specified data. */
    union
    {
        /* FS=LOAD operation. */
        struct
        {
            /* Last known block number. */
            uint16_t blockNum;

            /* Pointer to user supplied data buffer. */
            const uint8_t *pData;

            /* Length of data in user supplied data buffer. */
            size_t lenData;

            /* Length of data in the internal buffer. */
            uint8_t bufLen;

            /* Internal buffer to build up data for next transfer. */
            uint8_t buffer[WDRV_WINC_FILE_LOAD_BUF_SZ];
        } load;
    }op;
} WDRV_WINC_FILE_CTX;