Skip to content

Tpm2 defs

tpm2_defs

This module contains utility classes to help interpret definitions from the Tpm20.h header file.

CommandCode

Class representing a command code.

Allows alternativing between command codes and command strings.

get_code staticmethod

get_code(cc_string: str) -> Optional[int]

Returns associated command code.

Parameters:

Name Type Description Default
cc_string str

command string

required

get_string staticmethod

get_string(cc_code: int) -> Optional[str]

Returns associated command string.

Parameters:

Name Type Description Default
cc_code int

command code

required

ResponseCode

Class representing a Response code.

Allows alternativing between response codes and response strings.

get_simple_string staticmethod

get_simple_string(rc_code: int) -> Optional[str]

Returns associated response string.

Parameters:

Name Type Description Default
rc_code int

response code

required

parse_code staticmethod

parse_code(rc_code: int) -> tuple

Returns a Tuple representing the parsed response code.