Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

[Legacy] Interface

喂你脚下有坑 edited this page May 27, 2019 · 1 revision

Server - Client

DB Related

URL: /interface/<task>

Data: Anything

Function: Redirect to DB's interface /user/<task>

Command

URL: /api/command

Data:

{
    "SID": "Security ID",
    "UID": "User ID",
    "HID": "Hardware ID",
    "CMD":"Command"
}

Function: Send command to Server

Query Info

URL: /api/hardware

Data:

{
    "SID": "Security ID",
    "UID": "User ID",
    "HID": "Hardware ID"
}

Function: Query Hardware's Info

Server - Intelligence Controller

Submit data to IC when A new user command came

{
    "sensors": [
        {
            "online": 0,
            "type": "???",
            "data": "offline",
            "last": 156789
        },
        {
            "online": 1,
            "type": "Camera",
            "data": "True",
            "last": 156789.3
        }
    ],
    "device": [{
        "online": 1,
        "type": "Light",
        "data": "True",
        "last": 156789.3
    }],
    "cmd": "Command",
    "authority": 0
}

Submit data to IC when sensors' data changed

{
    "sensors": [
        {
            "online": 0,
            "type": "???",
            "data": "offline",
            "last": 156789
        },
        {
            "online": 1,
            "type": "Camera",
            "data": "True",
            "last": 156789.3
        }
    ],
    "device": [{
        "online": 1,
        "type": "Light",
        "data": "True",
        "last": 156789.3
    }]
}