Skip to content

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

@auphofBSF

Description

@auphofBSF

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions