PacketData#

class stixcore.tmtc.parser.PacketData[source]#

Bases: object

Generic class for organizing all parameters of the TM packet data.

Methods Summary

apply(nix, callback, args[, addnix])

Apply a processing method to a parameter.

get(nix[, aslist])

Get the parameter value for a given NIX name.

get_subpackets()

has_subpackets()

merge()

Merge sub structures

parameter_list_2_PacketData(parameters)

Convert the list nested parameters into a PacketData object.

set(nix, value)

Set the parameter vale by the NIX name.

Methods Documentation

apply(nix, callback, args, addnix=None)[source]#

Apply a processing method to a parameter.

Overids the value after processing or creates a new one.

Parameters:

nix (str) – The NIX name of the parameter.

callbackcallable

the callback to by applied to each data entry of the parameter.

argsany

will be passed on to the callback

addnixstr, optional

A NIX name where to override or create a new parameter. by default None

Returns:

‘int’ – How many times the callback was invoked?

get(nix, aslist=False)[source]#

Get the parameter value for a given NIX name.

Parameters:

nix (str) – The NIX name of the parameter.

Returns:

‘any’ – The found value.

get_subpackets()[source]#
has_subpackets()[source]#
merge()[source]#

Merge sub structures

classmethod parameter_list_2_PacketData(parameters)[source]#

Convert the list nested parameters into a PacketData object.

Unpacks/decodes the NIXD0159 counts from TM(21,6,20) by eliminating this repeater level.

Parameters:

parameters (list) – The parse result of the TM data block.

Returns:

PacketData – Generic data structure.

set(nix, value)[source]#

Set the parameter vale by the NIX name.

Parameters:
  • nix (str) – The NIX name of the parameter.

  • value ('any') – The new value.