@@ -360,21 +360,26 @@ def decode(self, data):
360
360
pass
361
361
362
362
def execute (self , context = None ):
363
- ''' Run a read exeception status request against the store
363
+ ''' Run a report slave id request against the store
364
364
365
365
:returns: The populated response
366
366
'''
367
- information = DeviceInformationFactory .get (_MCB )
368
- identifier = "-" .join (information .values ()).encode ()
369
- identifier = identifier or b'Pymodbus'
370
- return ReportSlaveIdResponse (identifier )
367
+ reportSlaveIdData = None
368
+ if context :
369
+ reportSlaveIdData = context .reportSlaveIdData
370
+ if not reportSlaveIdData :
371
+ information = DeviceInformationFactory .get (_MCB )
372
+ identifier = "-" .join (information .values ()).encode ()
373
+ identifier = identifier or b'Pymodbus'
374
+ reportSlaveIdData = identifier
375
+ return ReportSlaveIdResponse (reportSlaveIdData )
371
376
372
377
def __str__ (self ):
373
378
''' Builds a representation of the request
374
379
375
380
:returns: The string representation of the request
376
381
'''
377
- return "ResportSlaveIdRequest (%d)" % self .function_code
382
+ return "ReportSlaveIdRequest (%d)" % self .function_code
378
383
379
384
380
385
class ReportSlaveIdResponse (ModbusResponse ):
@@ -430,7 +435,7 @@ def __str__(self):
430
435
:returns: The string representation of the response
431
436
'''
432
437
arguments = (self .function_code , self .identifier , self .status )
433
- return "ResportSlaveIdResponse (%s, %s, %s)" % arguments
438
+ return "ReportSlaveIdResponse (%s, %s, %s)" % arguments
434
439
435
440
#---------------------------------------------------------------------------#
436
441
# TODO Make these only work on serial
0 commit comments