def sap_confirmation(self, resp): """Got a response from the ASE.""" if _debug: ModbusServiceAccessPoint._debug("sap_confirmation %r", resp) mpdu = MPDU() resp.encode(mpdu) if _debug: ModbusServiceAccessPoint._debug(" - mpdu: %r", mpdu) pdu = PDU() mpdu.encode(pdu) if _debug: ModbusServiceAccessPoint._debug(" - pdu: %r", pdu) # return the response to the device self.response(pdu)
def sap_indication(self, req): """Got a request from the ASE.""" if _debug: ModbusServiceAccessPoint._debug("sap_indication %r", req) mpdu = MPDU() req.encode(mpdu) if _debug: ModbusServiceAccessPoint._debug(" - mpdu: %r", mpdu) pdu = PDU() mpdu.encode(pdu) if _debug: ModbusServiceAccessPoint._debug(" - pdu: %r", pdu) # pass it along to the device self.request(pdu)
def indication(self, resp): """This is a response from the application.""" if _debug: ModbusServer._debug("indication %r", resp) # encode as a generic MPDU mpdu = MPDU() resp.encode(mpdu) if _debug: ModbusServer._debug(" - mpdu: %r", mpdu) # encode as a generic PDU pdu = PDU() mpdu.encode(pdu) if _debug: ModbusServer._debug(" - pdu: %r", pdu) # return the response to the device self.request(pdu)
def indication(self, req): """Got a request from the application.""" if _debug: ModbusClient._debug("indication %r", req) # encode it as a generic MPDU mpdu = MPDU() req.encode(mpdu) if _debug: ModbusClient._debug(" - mpdu: %r", mpdu) # encode it as a PDU pdu = PDU() mpdu.encode(pdu) if _debug: ModbusClient._debug(" - pdu: %r", pdu) # pass it along to the device self.request(pdu)