TPM multicast client
Project description
tpm_multicast_client
Listens to the TPM multicast stream and unpack the status dictionary using Jeff Hagen's tpmdgram
code.
Installation
To install with pip
do
pip install sdss-tpm-multicast-client
To install from source do
poetry install
More information on developing with Poetry can be found here.
Usage
The library provides a single function, listen_to_multicast
, that creates a connection to the TPM broadcast, unpacks the datagram, and passes it to a callback function. A basic example
from pprint import pprint
from tpm_multicast_client import __version__, listen_to_multicast
def pprint_datagram(data: dict):
pprint(data)
async def main():
_, protocol = await listen_to_multicast(pprint_datagram)
await protocol.run_forever()
if __name__ == "__main__":
main()
The callback, pprint_datagram
in this case, can be a function or a coroutine. In the former case it will be called with loop.call_soon()
. In the latter the coroutine is scheduled as a task.
CLI
The library provides a simple CLI script tpm-multicast-client
that prints the output of the datagram to stdout. It's basically equivalent to the example above.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sdss_tpm_multicast_client-0.1.0b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e6d7453243a5c90b6323b1e63eb6e87cad91fa4976979553c12859109ff895 |
|
MD5 | 41975b6e71bc852fef86fade57d66224 |
|
BLAKE2b-256 | 3ada5faf69abac96ab00708de973cd4410411417c3b7fb403831b536006de4e5 |
Hashes for sdss_tpm_multicast_client-0.1.0b0-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a20215978fd2e676c075406b173a87a0bfd5bc2e4522791e4bd92a76d74928b1 |
|
MD5 | 79a518746fd67612459e300c68ab588d |
|
BLAKE2b-256 | 49e39fea3e9ddacca147fec30711bd5a06362e23c8b76907f19a90513d94d94a |