Device Firmware Update (DFU) Middleware Library 5.1
Transport Management

General Description

DFU functions for the communication interface.

These communication functions have to be re-implemented in the user's code.

Functions

cy_en_dfu_status_t Cy_DFU_TransportRead (uint8_t buffer[], uint32_t size, uint32_t *count, uint32_t timeout)
 This function must be implemented in the user's code. More...
 
cy_en_dfu_status_t Cy_DFU_TransportWrite (uint8_t buffer[], uint32_t size, uint32_t *count, uint32_t timeout)
 This function must be implemented in the user's code. More...
 
void Cy_DFU_TransportReset (void)
 This function must be implemented in the user's code. More...
 
void Cy_DFU_TransportStart (cy_en_dfu_transport_t transport)
 This function must be implemented in the user's code. More...
 
void Cy_DFU_TransportStop (void)
 This function must be implemented in the user's code. More...
 

Function Documentation

◆ Cy_DFU_TransportRead()

cy_en_dfu_status_t Cy_DFU_TransportRead ( uint8_t  buffer[],
uint32_t  size,
uint32_t *  count,
uint32_t  timeout 
)

This function must be implemented in the user's code.

This function receives a command packet from the DFU Host via the communication channel. The function waits for a timeout until all bytes are received.

Parameters
bufferThe pointer to a buffer to store a received command.
sizeThe number of bytes to read.
countThe pointer to the variable that contains the number of received bytes.
timeoutThe time to wait before the function returns because of a timeout, in milliseconds.
Returns
The status of the transmit operation:
  • CY_DFU_SUCCESS - If successful.
  • CY_DFU_ERROR_TIMEOUT - If no data is received.
  • See cy_en_dfu_status_t.

◆ Cy_DFU_TransportWrite()

cy_en_dfu_status_t Cy_DFU_TransportWrite ( uint8_t  buffer[],
uint32_t  size,
uint32_t *  count,
uint32_t  timeout 
)

This function must be implemented in the user's code.

This function transmits a response packet to the DFU host via the communication channel. The function waits for a timeout until all bytes are sent.

Parameters
bufferThe pointer response packet buffer.
sizeThe number of bytes to transmit.
countThe pointer to the actual number of transmitted bytes.
timeoutThe time to wait before the function returns because of a timeout, in milliseconds
Returns
See cy_en_dfu_status_t. The status of the transmit operation:
  • CY_DFU_SUCCESS - If successful.
  • CY_DFU_ERROR_TIMEOUT - If no data is transmitted.

◆ Cy_DFU_TransportReset()

void Cy_DFU_TransportReset ( void  )

This function must be implemented in the user's code.


Resets the communication interface with clearing buffers, offsets, length, etc.

◆ Cy_DFU_TransportStart()

void Cy_DFU_TransportStart ( cy_en_dfu_transport_t  transport)

This function must be implemented in the user's code.


Starts the communication interface through which updating will be working.

Parameters
transportdefines transport interface to use. See cy_en_dfu_transport_t for available options

◆ Cy_DFU_TransportStop()

void Cy_DFU_TransportStop ( void  )

This function must be implemented in the user's code.


Stops the communication interface through which updating will be working.