Expand description
A cache of the service descriptions (SCPDs) of devices, so that a run only fetches the device description.
The cache keeps one directory per device and firmware, named after its
UDN (or its serial number if it has no UDN) and a hash of its model and
firmware version. The file device.json in it names the device, its
model and its firmware version, as the device description states them;
the other files are the SCPDs as the device sent them. Since every
firmware has its own directory, a process that still runs with the old
firmware never writes into the directory of the new one, and a firmware
update never uses old action lists. The directories of other firmware
versions of the device are removed when a new one is created. Devices
whose description has no firmware version, like some FRITZ!Repeaters, are
not cached.
A file that cannot be read or parsed counts as missing, and the SCPD is fetched again. The descriptions need no login and hold no secrets; nothing else goes into the cache.
Besides the files, the cache keeps the parsed SCPDs in memory, for processes that run long, like the MCP server.
Structs§
- Cache
- The cache of the service descriptions in a directory.
- Device
- A device as its description names it, the key of its cache.
- Entry
- The cached descriptions of one device.
Constants§
- ENV_
CACHE_ DIR - The environment variable for another cache directory.
Functions§
- default_
dir - The cache directory: the one of
ENV_CACHE_DIR, else the one of the platform (seecrate::dirs::cache).Noneif neither is known.