This is used, for example, in the simulated gamry device. It sends a "charge complete"
unsolicited message some seconds after being sent a command to "start charging".
The PR adds a unsolicited_reply() method so code like the following in the device
StreamInterface can accomplish this:
# function to send unsolicited message when charging complete
def charged(self):
self.handler.unsolicited_reply("STOPPED")
# Device commanded to start charging
def start_charging(self):
t = Timer(self.charging_time, self.charged)
t.start()
return "STARTED"
This is used, for example, in the simulated gamry device. It sends a "charge complete" unsolicited message some seconds after being sent a command to "start charging".
The PR adds a unsolicited_reply() method so code like the following in the device StreamInterface can accomplish this: