Device Firmware Update (DFU) Middleware Library 6.2 6.2.100.2910
 
Loading...
Searching...
No Matches
Transport Management in Host mode

General Description

DFU functions for the communication interface in Host mode These communication functions have to be re-implemented in the user's code.

Functions

cy_en_dfu_status_t Cy_DFU_HostTransportRead (uint8_t buffer[], uint32_t size, uint32_t *count, uint32_t timeout)
 This function is intended for use with a companion device.
 
cy_en_dfu_status_t Cy_DFU_HostTransportWrite (uint8_t buffer[], uint32_t size, uint32_t *count, uint32_t timeout)
 This function is intended for use with a companion device.
 
void Cy_DFU_HostTransportReset (void)
 This function is intended for use with a companion device.
 
void Cy_DFU_HostTransportStart (cy_en_dfu_transport_t transport)
 This function is intended for use with a companion device.
 
void Cy_DFU_HostTransportStop (void)
 This function is intended for use with a companion device.
 

Function Documentation

◆ Cy_DFU_HostTransportRead()

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

This function is intended for use with a companion device.

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_HostTransportWrite()

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

This function is intended for use with a companion device.

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_HostTransportReset()

void Cy_DFU_HostTransportReset ( void )

This function is intended for use with a companion device.

This function must be implemented in the user's code.
Resets the communication interface with clearing buffers, offsets, length, etc.

◆ Cy_DFU_HostTransportStart()

void Cy_DFU_HostTransportStart ( cy_en_dfu_transport_t transport)

This function is intended for use with a companion device.

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_HostTransportStop()

void Cy_DFU_HostTransportStop ( void )

This function is intended for use with a companion device.

This function must be implemented in the user's code.
Stops the communication interface through which updating will be working.