ISISComputingGroup / ISISComputingGroup/lewis

What is the correct way to send unsolicited replies based on events ?

Open
#297 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
24
Forks
19
PR merge metrics
No merged PRs in 30d

Description

My use case is to simulate a basic serial device over tcp that responds to commands but also sends unsolicited messages

The doc's strings and Readthedocs are great but I feel I am missing something

I am using a TCP Stream Based on Motor Example

I have successfully implemented Cmd's and get the correct responses

I would like to get an `unsolicited_reply()` from the `StreamHandler` when the following events happen

1. a new connection is made to the simulation interface with Telnet Host:Port (no data yet sent from Client) -> Generates a Welcome message
2. a periodic (Non Regular - random time interval) event happens in the simulated Device subclassing `StateMachineDevice` and sends an `unsolicited_reply` to the TCP client, ie simulating a state change through `lewis-control device ....`
3. a periodic (regular - fixed time interval) variant of 2.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.