Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdss_tpm_multicast_client-0.1.0b1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distributions

sdss_tpm_multicast_client-0.1.0b1-cp312-cp312-manylinux_2_17_x86_64.whl (45.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (45.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp312-cp312-macosx_12_0_x86_64.whl (4.6 kB view hashes)

Uploaded CPython 3.12 macOS 12.0+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp311-cp311-manylinux_2_17_x86_64.whl (31.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (31.9 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp311-cp311-macosx_12_0_x86_64.whl (4.6 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp310-cp310-manylinux_2_17_x86_64.whl (18.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (18.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

sdss_tpm_multicast_client-0.1.0b1-cp310-cp310-macosx_12_0_x86_64.whl (4.6 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page