Text for Web Sequence Diagrams and Class Diagrams for Demo Sensor
(see https://www.websequencediagrams.com/# or http://yuml.me/diagram/scruffy/class/draw)

1. Static class digram

// Class diagram for DemoSensor
[DemoSensor|+DemoSensor();+~DemoSensor();+Initialize();+Shutdown();+Ping();+GetEnumerationData();+PowerOff();+PowerOn();+boardID();+description();+enableState();+requestOffTime();+requestOnTime();+softwareVersion();+taskID();+SendCommand();+SampleNow();+SetSamplePending();+hardwareVersion();+sensorSampleInterval();+samplePending()|-AsynchCmd();-GPSSampleHandler();-PowerSensor();-OnSerialData();-OnSystemShutdown();-ReportTelemetryExample()|-connectionToGPSEvent;-connectionToSerialListener;-connectionToSystemShutdownEvent;-gpsEventName;-gpsEventType;-lat;-lon]broker->[IObjectBroker]
[IObjectBroker]^-[ObjectBroker]
[Logger]^-[StdOutLogger]
[DemoSensor]logger->[Logger]
[ISensorWithEvents_tie<DemoSensor>]->[DemoSensor]
[DemoSensorSettings]<>[EventTransceiverSettings]
[DemoSensorSettings]<>[PayloadManagerClientSettings]
[DemoSensorSettings]<>[SerialListenerSettings]
[DemoSensorSettings]<>[SerialPortSettings]
[EventTransceiver]->[EventTransceiverSettings]
[DemoSensor]-1>[DemoSensorSettings]
[DemoSensor]pmClient-0..1>[PayloadManagerClient]
[PayloadManagerClient]->[PayloadManagerClientSettings]
[ISerialPort]^-[SerialPort]
[SerialPort]->[SerialPortSettings]
[SerialListener]->[ISerialPort]
[SerialListener]uses-.->[SerialListenerSettings]
[DemoSensor]serialPort-0..1>[SerialPort]
[DemoSensor]serialListener-0..1>[SerialListener]
[EventTransceiver]^-[DemoSensor]
[ICommandableBase]^-[DemoSensor]

2. Startup

title DemoSensor Startup

main->settings: DemoSensorSettings()
main->settings: Load("DemoSensor-config.xml")
main->settings: GetServerName()
main->logger: StdOutSettings(serverName, 1, LT_DEBUG)
main->broker: ObjectBroker(true)
main->broker: Initialize(argc, argv)
main->demoSensor: DemoSensor(broker, settings, logger)
main->theSensor: ISensorWithEvents_tie(demoSensor)
main->broker: AdvertiseInstance(theServer, serverName)
note over broker: returns serverRef
main->settings: GetPayloadManagerClientSettings()
main->pmClient: PayloadManagerClient(pmClientSettings, broker, demoSensor)
note over pmClient: uses the EventTransceiver\nbase class of demoSensor
main->demoSensor: Initialize(serverRef, pmClient)
demoSensor->settings: GetSerialPortSettings()
demoSensor->settings(SerialPortSettings): CreatePort(logger)
settings(SerialPortSettings)->serialPort: SerialPort(portName,logger)
settings(SerialPortSettings)->serialPort: Open()
demoSensor->settings: GetSerialListenerSettings()
demoSensor->serialListener: SerialListener(serialPort,serialListenerSettings)
demoSensor->serialListener: Subscribe(boost::bind(&DemoSensor::OnSerialData, this, _1, _2))
demoSensor->serialListener: Initialize()
serialListener->serialListener thread: thread(*this)

note over serialListener thread: calls back on another thread
serialListener thread->serialListener: operator()
loop Background serial reading loop in SerialListener
   serialListener->serialPort: WaitForPortState(waitTime,\nreadable,writeable)
   serialListener->serialPort: ReadWithIntervalTimer(bytes,\nmaxRead,readTimeout)
   serialListener->demoSensor: OnSerialData(serialListener, data bytes) -- via boost event
   demoSensor->logger: Info << "Received data:" << endl << data.ToStringSplitView()
end

note over demoSensor: Creates event class factories and\nregisters with EventTransceiver,\nsubscribes to event callbacks\n(not shown)
demoSensor->demoSensor: Initialize(serverRef)

main->pmClient: Register(serverRef)
main->broker: ListenForRequests()






