Correct practice when implementing a command protocol using bulk endpoints | Cypress Semiconductor
Correct practice when implementing a command protocol using bulk endpoints
We are in the process of upgrading the FX2 chip of our devices to FX3. We are implementing our custom command reply protocol using Bulk endpoints.
Bulk OUT endpoint is for command and Bulk IN endpoint is for command reply.
I have started implementation using BulkSrcSink example project.
Following is the way that I have implemented command handling.
- In the DMA Producer callback I am copying the DMA buffer to a global buffer.
- Then I fire an event to my command handler thread
- That thread takes the command from the global buffer and process it
- Then it commits the reply to the BulkSource channel.
Is this the correct approach? Or is there a better and an efficient approach?