HeartbeatB

Python pydantic class corresponding to json type `heartbeat.b`.

class gwatn.types.HeartbeatB(*, FromGNodeAlias, FromGNodeInstanceId, MyHex='0', YourLastHex, LastReceivedTimeUnixMs, SendTimeUnixMs, StartingOver, TypeName='heartbeat.b', Version='001')

.

Heartbeat for Scada-AtomicTNode DispatchContract, to send via RabbitMQ

Parameters:
  • FromGNodeAlias (str) –

  • FromGNodeInstanceId (str) –

  • MyHex (str) –

  • YourLastHex (str) –

  • LastReceivedTimeUnixMs (int) –

  • SendTimeUnixMs (int) –

  • StartingOver (bool) –

  • TypeName (Literal['heartbeat.b']) –

  • Version (str) –

FromGNodeAlias:
  • Description: My GNodeAlias

  • Format: LeftRightDot

FromGNodeInstanceId:
  • Description: My GNodeInstanceId

  • Format: UuidCanonicalTextual

MyHex:
  • Description: Hex character getting sent

  • Format: HexChar

YourLastHex:
  • Description: Last hex character received from heartbeat partner.

  • Format: HexChar

LastReceivedTimeUnixMs:
  • Description: Time YourLastHex was received on my clock

  • Format: ReasonableUnixTimeMs

SendTimeUnixMs:
  • Description: Time this message is made and sent on my clock

  • Format: ReasonableUnixTimeMs

StartingOver:
  • Description: True if the heartbeat initiator wants to start the volley over. (typically the AtomicTNode in an AtomicTNode / SCADA pair) wants to start the heartbeating volley over. The result is that its partner will not expect the initiator to know its last Hex.

class gwatn.types.heartbeat_b.check_is_uuid_canonical_textual(v)

UuidCanonicalTextual format: A string of hex words separated by hyphens of length 8-4-4-4-12.

Raises:

ValueError – if not UuidCanonicalTextual format

Parameters:

v (str) –

class gwatn.types.heartbeat_b.check_is_hex_char(v)

HexChar format: single-char string in ‘0123456789abcdefABCDEF’

Raises:

ValueError – if not HexChar format

Parameters:

v (str) –

class gwatn.types.heartbeat_b.check_is_left_right_dot(v)

LeftRightDot format: Lowercase alphanumeric words separated by periods, most significant word (on the left) starting with an alphabet character.

Raises:

ValueError – if not LeftRightDot format

Parameters:

v (str) –

class gwatn.types.heartbeat_b.check_is_reasonable_unix_time_ms(v)

ReasonableUnixTimeMs format: time in unix milliseconds between Jan 1 2000 and Jan 1 3000

Raises:

ValueError – if not ReasonableUnixTimeMs format

Parameters:

v (str) –

class gwatn.types.HeartbeatB_Maker(from_g_node_alias, from_g_node_instance_id, my_hex, your_last_hex, last_received_time_unix_ms, send_time_unix_ms, starting_over)
Parameters:
  • from_g_node_alias (str) –

  • from_g_node_instance_id (str) –

  • my_hex (str) –

  • your_last_hex (str) –

  • last_received_time_unix_ms (int) –

  • send_time_unix_ms (int) –

  • starting_over (bool) –

classmethod tuple_to_type(tuple)

Given a Python class object, returns the serialized JSON type object

Parameters:

tuple (HeartbeatB) –

Return type:

str

classmethod type_to_tuple(t)

Given a serialized JSON type object, returns the Python class object

Parameters:

t (str) –

Return type:

HeartbeatB