Functions | |
| def | _to_json_compatible_object_impl (obj) |
| def | _to_yaml_impl (obj, indent_level=0, parent=None, name=None, uavcan_type=None) |
| def | to_json_compatible_object (obj) |
| def | to_yaml (obj) |
| def | value_to_constant_name (struct, field_name, keep_literal=False) |
Variables | |
| blue | |
| certificate_of_authenticity | |
| getset = pyuavcan_v0.protocol.param.GetSet.Response() | |
| green | |
| info = pyuavcan_v0.protocol.GetNodeInfo.Response(name='legion') | |
| lcmd = pyuavcan_v0.equipment.indication.SingleLightCommand(light_id=123) | |
| lights = pyuavcan_v0.equipment.indication.LightsCommand() | |
| node = pyuavcan_v0.make_node('vcan0', node_id=42) | |
| red | |
|
private |
Definition at line 21 of file introspect.py.
|
private |
Definition at line 114 of file introspect.py.
| def pyuavcan_v0.introspect.to_json_compatible_object | ( | obj | ) |
This function returns a representation of a UAVCAN structure (message, request, or response), or
a DSDL entity (array or primitive), or a UAVCAN transfer, as a structure easily able to be
transformed into json or json-like serialization
Args:
obj: Object to convert.
Returns: structure which can easily be transformed into a json-like serialization
Definition at line 77 of file introspect.py.
| def pyuavcan_v0.introspect.to_yaml | ( | obj | ) |
This function returns correct YAML representation of a UAVCAN structure (message, request, or response), or
a DSDL entity (array or primitive), or a UAVCAN transfer, with comments for human benefit.
Args:
obj: Object to convert.
Returns: Unicode string containing YAML representation of the object.
Definition at line 203 of file introspect.py.
| def pyuavcan_v0.introspect.value_to_constant_name | ( | struct, | |
| field_name, | |||
keep_literal = False |
|||
| ) |
This function accepts a UAVCAN struct (message, request, or response), and a field name; and returns
the name of constant or bit mask that match the value. If no match could be established, the literal
value will be returned as is.
Args:
struct: UAVCAN struct to work with
field_name: Name of the field to work with
keep_literal: Whether to include the input integer value in the output string
Returns: Name of the constant or flags if match could be detected, otherwise integer as is.
Definition at line 236 of file introspect.py.
| pyuavcan_v0.introspect.blue |
Definition at line 341 of file introspect.py.
| pyuavcan_v0.introspect.certificate_of_authenticity |
Definition at line 334 of file introspect.py.
| pyuavcan_v0.introspect.getset = pyuavcan_v0.protocol.param.GetSet.Response() |
Definition at line 350 of file introspect.py.
| pyuavcan_v0.introspect.green |
Definition at line 340 of file introspect.py.
| pyuavcan_v0.introspect.info = pyuavcan_v0.protocol.GetNodeInfo.Response(name='legion') |
Definition at line 333 of file introspect.py.
| pyuavcan_v0.introspect.lcmd = pyuavcan_v0.equipment.indication.SingleLightCommand(light_id=123) |
Definition at line 338 of file introspect.py.
| pyuavcan_v0.introspect.lights = pyuavcan_v0.equipment.indication.LightsCommand() |
Definition at line 337 of file introspect.py.
| pyuavcan_v0.introspect.node = pyuavcan_v0.make_node('vcan0', node_id=42) |
Definition at line 398 of file introspect.py.
| pyuavcan_v0.introspect.red |
Definition at line 339 of file introspect.py.