bcms 0.1.12

Bluetooth Client Manager Service for IoT device management
Documentation
@0x955ea5acce24dc79;

struct BCMSDeviceInfo {
    address     @0 :Text;
    name        @1 :Text;
    approved    @2 :Bool;
    paired      @3 :Bool;
    deviceClass @4 :UInt32;  # Bluetooth Class of Device
    appearance  @5 :UInt16;  # BLE Appearance value
    connected   @6 :Bool;    # Current connection state
}

enum BCMSWorkingMode {
    any        @0;
    approved @1;
}

struct DeviceInfo {
    address    @0 :Text;
    name       @1 :Text;
    connectionType @2 :Text;
}

struct IoTDataBatch {
    device @0 :DeviceInfo;
    data   @1 :List(Text);
}

struct DataTypeStats {
    dataType @0 :Text;
    count @1 :UInt32;
    lastTimestamp @2 :Int64;
}

struct DeviceStats {
    address @0 :Text;
    name @1 :Text;
    approved @2 :Bool;
    paired @3 :Bool;
    connectionType @4 :Text;
    lastSeen @5 :Int64;
    backendRegistered @6 :Bool;
    dataTypes @7 :List(DataTypeStats);
}

struct StatsResult {
    devices @0 :List(DeviceStats);
    totalDataPoints @1 :UInt32;
    errors @2 :List(Text);
}

interface BCMS {
    list     @0 (onlyApproved :Bool) -> (devices :List(BCMSDeviceInfo), errors :List(Text));
    approve  @1 (address :Text) -> (status :Bool, errors :List(Text));
    remove   @2 (address :Text) -> (status :Bool, errors :List(Text));
    mode     @3 () -> (mode :BCMSWorkingMode);
    setMode  @4 (mode :BCMSWorkingMode) -> (status: Bool, errors :List(Text));
    pair     @5 (address :Text) -> (status :Bool, errors :List(Text));
    unpair   @6 (address :Text) -> (status :Bool, errors :List(Text));
    isPaired @7 (address :Text) -> (status :Bool, errors :List(Text));
    submitData @8 (payload :IoTDataBatch) -> (status :Bool, errors :List(Text));
    stats      @9 () -> (result :StatsResult);
    connect    @10 (address :Text) -> (status :Bool, errors :List(Text));
    disconnect @11 (address :Text) -> (status :Bool, errors :List(Text));
}