Communication Profile

This page details the communication between ActiveSense and its Backend-Services.

sequenceDiagram
    autonumber
    participant ActiveSense
    participant Backend-Services
    link Backend-Services: URL @ https://android.cs.hs-rm.de/

    ActiveSense->>Backend-Services: WebSocket Connection
    Backend-Services-->>ActiveSense: Connection Established

    Note over ActiveSense,Backend-Services: Connection Open



        Backend-Services->>ActiveSense: {"type": "getData", "action": "start", "hertz": <value>}
        Note over ActiveSense: Start Transmission

        loop Every 1 second
            ActiveSense->>Backend-Services: WatchModel (Motion Data)
            ActiveSense->>Backend-Services: PPGModel (PPG Data)
        end

        loop Every 5 minutes
            ActiveSense->>Backend-Services: BatteryModel (Battery Data)
        end

        Backend-Services->>ActiveSense: {"type": "getData", "action": "stop"}
        Note over ActiveSense: Stop Transmission


    Note over ActiveSense,Backend-Services: Connection remains open. The transmission cycle can <br>repeat multiple times without closing the connection.

    ActiveSense ->> Backend-Services: WebSocket Close
    Backend-Services -->> ActiveSense: Connection Closed

All messages ActiveSense sends to it's Backend-Services are to be found in the Reference docs inside the de.hsrm.activesense.model package.