|
USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
|
One DFU target == one alternate setting == one app-supplied linear byte store. More...
#include <classes/dfu.h>
Data Fields | |
| const char * | name |
iInterface name shown by dfu-util -l (e.g. | |
| void * | ctx |
| Backend context, passed to every callback below. | |
| int(* | write )(void *ctx, uint32_t off, const uint8_t *data, uint32_t len) |
| Store firmware bytes at a byte offset (DOWNLOAD). | |
| int(* | read )(void *ctx, uint32_t off, uint8_t *buf, uint32_t want) |
| Return firmware bytes at a byte offset (UPLOAD). | |
| void(* | begin )(void *ctx) |
| A fresh download is starting - discard any old image (optional). | |
| void(* | finish )(void *ctx) |
| Download complete - commit/flush the image (optional). | |
| uint32_t(* | size )(void *ctx) |
| Report bytes currently stored, for the log (optional). | |
One DFU target == one alternate setting == one app-supplied linear byte store.
The class calls these with byte offsets (a multiple of wTransferSize); ctx is passed back to each. begin/finish/size may be NULL.
| const char* dfu_target::name |
iInterface name shown by dfu-util -l (e.g.
"fw0")
| void* dfu_target::ctx |
Backend context, passed to every callback below.
| int(* dfu_target::write) (void *ctx, uint32_t off, const uint8_t *data, uint32_t len) |
Store firmware bytes at a byte offset (DOWNLOAD).
| ctx | the target's ctx pointer. |
| off | byte offset (a multiple of the DFU wTransferSize). |
| data | the bytes to store. |
| len | number of bytes in data. |
DFU_STATUS_* code reported to the host via GETSTATUS (any other non-zero is treated as DFU_STATUS_errWRITE). | int(* dfu_target::read) (void *ctx, uint32_t off, uint8_t *buf, uint32_t want) |
Return firmware bytes at a byte offset (UPLOAD).
| ctx | the target's ctx pointer. |
| off | byte offset (a multiple of the DFU wTransferSize). |
| buf | destination buffer. |
| want | maximum number of bytes to return. |
| void(* dfu_target::begin) (void *ctx) |
A fresh download is starting - discard any old image (optional).
| ctx | the target's ctx pointer. |
| void(* dfu_target::finish) (void *ctx) |
Download complete - commit/flush the image (optional).
| ctx | the target's ctx pointer. |
| uint32_t(* dfu_target::size) (void *ctx) |
Report bytes currently stored, for the log (optional).
| ctx | the target's ctx pointer. |