FakeDfuTransport
In-memory DfuTransport for testing DFU flows without BLE hardware.
Queue responses with enqueueResponse before the code-under-test calls sendCommand. After the DFU completes, inspect getCommandLog and getDataLog to verify the commands and data packets that were sent.
Usage
val transport = FakeDfuTransport(mtu = 64)
// Queue the expected DFU responses...
transport.enqueueResponse(selectResponse)
transport.enqueueResponse(createResponse)
// ...then run the protocol under testContent copied to clipboard
Parameters
mtu
simulated maximum write payload size
Properties
Functions
Link copied to clipboard
Emit a notification as if it came from the DFU Control Point characteristic.
Link copied to clipboard
Queue a response that will be returned by the next sendCommand call.
Link copied to clipboard
Snapshot of all commands sent via sendCommand, in order.
Link copied to clipboard
Snapshot of all data packets sent via sendData, in order.
Link copied to clipboard
Write a command to the DFU Control Point and wait for the response notification.