MCPcopy Create free account
hub / github.com/bitcraze/crazyflie-lib-python / Console

Class Console

cflib/crazyflie/console.py:38–61  ·  view source on GitHub ↗

Crazyflie console is used to receive characters printed using printf from the firmware.

Source from the content-addressed store, hash-verified

36
37
38class Console:
39 """
40 Crazyflie console is used to receive characters printed using printf
41 from the firmware.
42 """
43
44 def __init__(self, crazyflie):
45 """
46 Initialize the console and register it to receive data from the copter.
47 """
48
49 self.receivedChar = Caller()
50
51 self.cf = crazyflie
52 self.cf.add_port_callback(CRTPPort.CONSOLE, self.incoming)
53
54 def incoming(self, packet):
55 """
56 Callback for data received from the copter.
57 """
58 # This might be done prettier ;-)
59 console_text = packet.data.decode('UTF-8')
60
61 self.receivedChar.call(console_text)

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected