def __handle_handshake(self, obj): if obj.name == "UAVO_FlightTelemetryStats": # Handle the telemetry handshaking (DISCONNECTED, HANDSHAKE_REQ, HANDSHAKE_ACK, CONNECTED) = (0,1,2,3) if obj.Status == DISCONNECTED: # Request handshake print "Disconnected" send_obj = self.__make_handshake(HANDSHAKE_REQ) elif obj.Status == HANDSHAKE_ACK: # Say connected print "Handshake ackd" send_obj = self.__make_handshake(CONNECTED) elif obj.Status == CONNECTED: print "Connected" send_obj = self.__make_handshake(CONNECTED) self._send(uavtalk.send_object(send_obj))
def __handle_handshake(self, obj): if obj.name == "UAVO_FlightTelemetryStats": # Handle the telemetry handshaking (DISCONNECTED, HANDSHAKE_REQ, HANDSHAKE_ACK, CONNECTED) = (0, 1, 2, 3) if obj.Status == DISCONNECTED: # Request handshake print "Disconnected" send_obj = self.__make_handshake(HANDSHAKE_REQ) elif obj.Status == HANDSHAKE_ACK: # Say connected print "Handshake ackd" send_obj = self.__make_handshake(CONNECTED) elif obj.Status == CONNECTED: print "Connected" send_obj = self.__make_handshake(CONNECTED) self._send(uavtalk.send_object(send_obj))
def send_object(self, obj): self._send(uavtalk.send_object(obj))