Esempio n. 1
0
    def execute(self, context=None):
        ''' Run a read exeception status request against the store

        :returns: The populated response
        '''
        information = DeviceInformationFactory.get(_MCB)
        identifier = "-".join(information.values()).encode()
        identifier = identifier or b'Pymodbus'
        return ReportSlaveIdResponse(identifier)
Esempio n. 2
0
    def execute(self, context):
        ''' Run a read exeception status request against the store

        :param context: The datastore to request from
        :returns: The populated response
        '''
        if not (0x00 <= self.object_id <= 0xff):
            return self.doException(merror.IllegalValue)
        if not (0x00 <= self.read_code <= 0x04):
            return self.doException(merror.IllegalValue)

        information = DeviceInformationFactory.get(_MCB,
            self.read_code, self.object_id)
        return ReadDeviceInformationResponse(self.read_code, information)
Esempio n. 3
0
    def execute(self, context):
        ''' Run a read exeception status request against the store

        :param context: The datastore to request from
        :returns: The populated response
        '''
        if not (0x00 <= self.object_id <= 0xff):
            return self.doException(merror.IllegalValue)
        if not (0x00 <= self.read_code <= 0x04):
            return self.doException(merror.IllegalValue)

        information = DeviceInformationFactory.get(_MCB,
            self.read_code, self.object_id)
        return ReadDeviceInformationResponse(self.read_code, information)
Esempio n. 4
0
    def execute(self, context=None):
        ''' Run a report slave id request against the store

        :returns: The populated response
        '''
        reportSlaveIdData = None
        if context:
            reportSlaveIdData = getattr(context, 'reportSlaveIdData', None)
        if not reportSlaveIdData:
            information = DeviceInformationFactory.get(_MCB)
            identifier = "-".join(information.values()).encode()
            identifier = identifier or b'Pymodbus'
            reportSlaveIdData = identifier
        return ReportSlaveIdResponse(reportSlaveIdData)