def next_request(self): if _debug: PrairieDog._debug("next_request") # check to see if we're done if not self.point_queue: if _debug: PrairieDog._debug(" - done") # dump out the results for request, response in zip(point_list, self.response_values): print request, response # no longer busy self.is_busy = False return # get the next request addr, obj_type, obj_inst, prop_id = self.point_queue.popleft() # build a request self._request = ReadPropertyRequest( objectIdentifier=(obj_type, obj_inst), propertyIdentifier=prop_id, ) self._request.pduDestination = Address(addr) if _debug: PrairieDog._debug(" - request: %r", self._request) # forward it along BIPSimpleApplication.request(self, self._request)
def request(self, apdu): if _debug: SubscribeCOVApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): """Sniff for Who-Is requests going downstream.""" # save a copy of just the Who-Is request if isinstance(apdu, WhoIsRequest): self.who_is_request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): # if _debug: ReadPropertyApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: WhoIsIAmApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: BACnetAggregator._debug("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: ReadPropertyApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if self._debug: print("request %r", apdu) # save a copy of the request self._request = apdu # forward it along BIPSimpleApplication.request(self, apdu) if self._debug: print "ok"
def do_request(self, apdu, iocb): # assign an invoke identifier apdu.apduInvokeID = self.get_next_invoke_id(apdu.pduDestination) # build a key to reference the IOCB when the response comes back invoke_key = (apdu.pduDestination, apdu.apduInvokeID) # keep track of the request self.iocb[invoke_key] = iocb # forward it along, apduInvokeID set by stack BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: TestApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu # check for loopback if apdu.pduDestination == self.localAddress: if _debug: TestApplication._debug(" - loopback") apdu.pduSource = self.localAddress deferred(self.indication, apdu) else: BIPSimpleApplication.request(self, apdu)
def request(self, iocb): apdu = iocb.ioRequest # assign an invoke identifier apdu.apduInvokeID = self.get_next_invoke_id(apdu.pduDestination) # build a key to reference the IOCB when the response comes back invoke_key = (apdu.pduDestination, apdu.apduInvokeID) # keep track of the request self.iocb[invoke_key] = iocb BIPSimpleApplication.request(self, apdu)
def request(self, apdu, iocb): if _debug: WebServerApplication._debug("request %r", apdu) # assign an invoke identifier apdu.apduInvokeID = self.get_next_invoke_id(apdu.pduDestination) # build a key to reference the IOCB when the response comes back invoke_key = (apdu.pduDestination, apdu.apduInvokeID) if _debug: WebServerApplication._debug(" - invoke_key: %r", invoke_key) # keep track of the request self.iocb[invoke_key] = iocb # forward it along, apduInvokeID set by stack BIPSimpleApplication.request(self, apdu)
def request(self, iocb): apdu = iocb.ioRequest if isinstance(apdu, ConfirmedRequestSequence): # assign an invoke identifier apdu.apduInvokeID = self.get_next_invoke_id(apdu.pduDestination) # build a key to reference the IOCB when the response comes back invoke_key = (apdu.pduDestination, apdu.apduInvokeID) # keep track of the request self.iocb[invoke_key] = iocb try: BIPSimpleApplication.request(self, apdu) except StandardError as e: iocb.set_exception(e)
def request(self, apdu): """ Reset class variables to None for the present request Sends the apdu to the application request :param apdu: apdu """ if _debug: ScriptApplication._debug("request %r", apdu) # save a copy of the request self._request = apdu self.value = None self.error = None self.values = [] self.i_am_counter = defaultdict(int) self.who_is_counter = defaultdict(int) #self.ResponseQueue = Queue() # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): """ Reset class variables to None for the present request Sends the apdu to the application request :param apdu: apdu """ log_debug("request %r", apdu) # save a copy of the request self._request = apdu self.value = None self.error = None self.values = [] # Will store responses to IAm and Whois self.i_am_counter = defaultdict(int) self.who_is_counter = defaultdict(int) # forward it along BIPSimpleApplication.request(self, apdu)
def next_request(self): if _debug: ReadPointListApplication._debug("next_request") # check to see if we're done if not self.point_queue: if _debug: ReadPointListApplication._debug(" - done") stop() return # get the next request addr, obj_type, obj_inst, prop_id = self.point_queue.popleft() # build a request self._request = ReadPropertyRequest(objectIdentifier=(obj_type, obj_inst), propertyIdentifier=prop_id) self._request.pduDestination = Address(addr) if _debug: ReadPointListApplication._debug(" - request: %r", self._request) # forward it along BIPSimpleApplication.request(self, self._request)
def next_request(self): if _debug: ReadPointListApplication._debug("next_request") # check to see if we're done if not self.point_queue: if _debug: ReadPointListApplication._debug(" - done") stop() return # get the next request addr, obj_type, obj_inst, prop_id = self.point_queue.popleft() # build a request self._request = ReadPropertyRequest( objectIdentifier=(obj_type, obj_inst), propertyIdentifier=prop_id, ) self._request.pduDestination = Address(addr) if _debug: ReadPointListApplication._debug(" - request: %r", self._request) # forward it along BIPSimpleApplication.request(self, self._request)
def request(self, apdu): # print 'Passing along request...' self.__response_value = None BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: TestApplication._debug("request %r", apdu) # forward it along BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if _debug: SampleApplication._debug("request %r", apdu) BIPSimpleApplication.request(self, apdu)
def request(self, apdu): BIPSimpleApplication.request(self, apdu)
def request(self, apdu): #print 'Passing along request...' self.__response_value = None BIPSimpleApplication.request(self, apdu)
def request(self, apdu): if isinstance(apdu, WhoIsRequest): self.who_is_request = apdu BIPSimpleApplication.request(self, apdu)
def request(self, apdu, forwarded=False): if _debug: ModbusSimpleApplication._debug("[%s]request %r", self.localAddress, apdu) BIPSimpleApplication.request(self, apdu, forwarded=forwarded)