PacketData#
- class stixcore.tmtc.parser.PacketData[source]#
Bases:
objectGeneric 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.
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.
- callback
callable the callback to by applied to each data entry of the parameter.
- args
any will be passed on to the callback
- addnix
str, 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.
- 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.