mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-12 14:51:42 +01:00
83 lines
1.7 KiB
Cap'n Proto
83 lines
1.7 KiB
Cap'n Proto
@0xc0542f62613a5c5e
|
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
using import "utils.capnp".OID;
|
|
using import "utils.capnp".Map;
|
|
using import "utils.capnp".Fallible;
|
|
|
|
using ID = Data;
|
|
|
|
struct StateError
|
|
{
|
|
|
|
}
|
|
|
|
struct MeasureError
|
|
{
|
|
|
|
}
|
|
|
|
interface Action
|
|
{
|
|
do @0 ( Map(ID, Data) ) -> Fallible( ID, StateError );
|
|
}
|
|
|
|
|
|
interface Measure
|
|
{
|
|
get @0 ( List(ID) ) -> Fallible( Map(ID, Data), MeasureError );
|
|
set @1 ( Map(ID, Data) ) -> Fallible( Map(ID, Data), MeasureError );
|
|
}
|
|
|
|
struct FSM
|
|
{
|
|
oid @0 :OID;
|
|
name @1 :Text;
|
|
description @2 :Text;
|
|
states @3 :List(State);
|
|
}
|
|
|
|
struct State
|
|
{
|
|
id @0 :ID;
|
|
name @1 :Text;
|
|
description @2 :Text;
|
|
traits @3 :List(Trait);
|
|
measurements @4 :List(Measurement);
|
|
}
|
|
|
|
struct Trait
|
|
{
|
|
id @0 :ID;
|
|
name @1 :Text;
|
|
description @2 :Text;
|
|
currentstate @3 :ID;
|
|
nextstate @4 :ID;
|
|
}
|
|
|
|
struct Parameter
|
|
{
|
|
id @0 :ID;
|
|
name @1 :Text;
|
|
description @2 :Text;
|
|
}
|
|
|
|
struct Measurement
|
|
{
|
|
id @0 :ID;
|
|
name @1 :Text;
|
|
description @2 :Text;
|
|
state @3 :ID;
|
|
}
|
|
|
|
# Power
|
|
const power_s_off : State ( id = 0x"000", name = "off", description = "power is off", );
|
|
|
|
const power_m_consumption : Measurement ( id = 0x"000", name = "Power Consumption", description = "TODO", state = 0x"001" );
|
|
|
|
const power_t_turnon : Trait ( id = 0x"000", name = "turnon", description = "Turn Power to on", currentstate = 0x"000", nextstate = 0x"001" );
|
|
const power_t_turnoff : Trait ( id = 0x"001", name = "turnoff", description = "Turn Power to off", currentstate = 0x"001", nextstate = 0x"000" );
|
|
|
|
const power_fsm :FSM = ( oid = 0x"TODO", name = "power1", description = "TODO" ); |