def _sendRequest(self, signal, request): ''' Sending a request under a certain signal Args: signal (str): stringrepresentation of the signal about to be emitted request (dict): dictionary that will be transmitted as a JSON-string''' UAV_Logger.log_debug("--> SIGNAL: " + signal + " | REQUEST: " + str(request)) self.socketIO.emit(signal, request)
def _sendRequest_requireCallback(self, signal, request, callbackFkt): ''' Sending a request under a certain signal Args: signal (str): the signal to emit request (dict): dictionary that will be transmitted as a JSON-string callbackFkt (type): the callbackfunktion executed on positive response ''' UAV_Logger.log_debug("--> SIGNAL: " + signal + " | REQUEST: " + str(request)) self.socketIO.emit(signal, request, callbackFkt)
def _receive(self, args): ''' First handling a received request, by parsing it''' request = Request(self.getModuleName()).parse(args) UAV_Logger.log_debug("<-- DATA: " + str(request)) return request
def onPySignal_acknowledged(self, *args): LOG.log_debug("received callback" + str(args[0]))