Skip to content

v0.1.25

Latest

Choose a tag to compare

@QuiteYellow QuiteYellow released this 13 Nov 20:28
37a2035

Added

DtlsCoapSession.get() has two new keyword-only arguments for the two Block2 reassembly caps: max_payload_bytes and max_blocks. Each sets its cap for that one call. Both default to None, which keeps the caps every other read gets: MAX_BLOCK2_PAYLOAD_BYTES assembled bytes and MAX_BLOCKS blocks, with a subclass override of MAX_BLOCKS still applied. They are meant for a large read the caller asked for, such as a file from /file/transfer/vs/0; polling keeps the defaults. Any value other than a positive int raises TypeError or ValueError before anything is sent.

The two caps are independent, and either one ends the transfer. MAX_BLOCKS assumes the 1024-byte blocks this client requests, so when a server negotiates smaller blocks, max_blocks is usually the cap reached first.

timeout is one deadline for the whole transfer. Every block waits for the session rate limit, five requests a second by default, so a large max_blocks needs a longer timeout.

Thanks @mbillow, who wrote it (#131) for the file transfers on mbillow/localthings#659. The tests use a fake device; no transfer over the default caps has been measured on an appliance here.

Bridge demo

These ship in the repository; the package on PyPI carries the library alone. Read-only washer and TP1X fridge descriptors, an env file that can live outside the checkout, and a container log capped at 3 × 10 MB, from @dalbrekt (#127). The washer's renamed discovery topics are cleared, and the sample descriptors are no longer called frozen (#130).

Notes

1394 tests pass on 3.11 through 3.14 and on 3.11 at this package's dependency floor.

From PRs #126, #127, #128, #130, #131 and #133.