libgs_ops.scheduling.Communication¶
-
class
libgs_ops.scheduling.
Communication
(cmd, retries=3, wait=True)[source]¶ This class holds the message (fully encoded) that is sent to the satellite.
It is just a convenience class that wraps and populates a dictionary properly for use by the other classes in this module.
It can be constructed with either a HEX string or a bytearray and will automatically compute the other. After construction it will be a dictionary with the following fields:
- hexstr: Hex representation of byte stream
- barray:
bytearray
represenation of bytestream - retries: Number of retries
- wait: Whether to wait for reply
Parameters: - cmd (basestring or bytearray) – Command string (fully encoded) to send to satellite.
- retries (int) – Number of times the command should be retried in case of failure
- wait (bool) – Whether the ground station should wait for a reply from the satellite or not.
Methods
to_dict
()Convert the class to a serialisable python dictionary format (gets rid of the bytearray entry). Inherited from base class
clear
(() -> None. Remove all items from D.)copy
(() -> a shallow copy of D)fromkeys
(…)v defaults to None. get
((k[,d]) -> D[k] if k in D, …)has_key
((k) -> True if D has a key k, else False)items
(() -> list of D’s (key, value) pairs, …)iteritems
(() -> an iterator over the (key, …)iterkeys
(() -> an iterator over the keys of D)itervalues
(…)keys
(() -> list of D’s keys)pop
((k[,d]) -> v, …)If key is not found, d is returned if given, otherwise KeyError is raised popitem
(() -> (k, v), …)2-tuple; but raise KeyError if D is empty. setdefault
((k[,d]) -> D.get(k,d), …)update
(([E, …)If E present and has a .keys() method, does: for k in E: D[k] = E[k] values
(() -> list of D’s values)viewitems
(…)viewkeys
(…)viewvalues
(…)