-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
747 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Autogenerated file. | ||
from .client import CloudAdapterClient # type: ignore | ||
from .constants import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
# Autogenerated constants for Cloud Adapter service | ||
from enum import IntEnum | ||
from jacdac.constants import * | ||
from jacdac.system.constants import * | ||
JD_SERVICE_CLASS_CLOUD_ADAPTER = const(0x14606e9c) | ||
|
||
|
||
class CloudAdapterCommandStatus(IntEnum): | ||
OK = const(0xc8) | ||
NOT_FOUND = const(0x194) | ||
BUSY = const(0x1ad) | ||
|
||
|
||
JD_CLOUD_ADAPTER_CMD_UPLOAD = const(0x80) | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_BIN = const(0x81) | ||
JD_CLOUD_ADAPTER_CMD_ACK_CLOUD_COMMAND = const(0x83) | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_JSON = const(0x80) | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_BINARY = const(0x81) | ||
JD_CLOUD_ADAPTER_REG_CONNECTED = const(0x180) | ||
JD_CLOUD_ADAPTER_REG_CONNECTION_NAME = const(0x181) | ||
JD_CLOUD_ADAPTER_EV_CLOUD_COMMAND = const(0x81) | ||
JD_CLOUD_ADAPTER_EV_ON_JSON = const(0x80) | ||
JD_CLOUD_ADAPTER_EV_ON_BINARY = const(0x81) | ||
JD_CLOUD_ADAPTER_EV_CHANGE = const(JD_EV_CHANGE) | ||
JD_CLOUD_ADAPTER_PACK_FORMATS = { | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD: "z r: f64", | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_BIN: "b", | ||
JD_CLOUD_ADAPTER_CMD_ACK_CLOUD_COMMAND: "u32 u32 r: f64", | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_JSON: "z s", | ||
JD_CLOUD_ADAPTER_CMD_UPLOAD_BINARY: "z b", | ||
JD_CLOUD_ADAPTER_REG_CONNECTED: "u8", | ||
JD_CLOUD_ADAPTER_REG_CONNECTION_NAME: "s", | ||
JD_CLOUD_ADAPTER_EV_CLOUD_COMMAND: "u32 z r: f64" | ||
JD_CLOUD_ADAPTER_EV_ON_JSON: "z s", | ||
JD_CLOUD_ADAPTER_EV_ON_BINARY: "z b" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Autogenerated file. | ||
from .client import CloudConfigurationClient # type: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Autogenerated file. Do not edit. | ||
from jacdac.bus import Bus, Client, EventHandlerFn, UnsubscribeFn | ||
from .constants import * | ||
from typing import Optional | ||
|
||
|
||
class CloudConfigurationClient(Client): | ||
""" | ||
Connection and diagnostics information about the cloud connection. | ||
Implements a client for the `Cloud Configuration <https://microsoft.github.io/jacdac-docs/services/cloudconfiguration>`_ service. | ||
""" | ||
|
||
def __init__(self, bus: Bus, role: str) -> None: | ||
super().__init__(bus, JD_SERVICE_CLASS_CLOUD_CONFIGURATION, JD_CLOUD_CONFIGURATION_PACK_FORMATS, role) | ||
|
||
|
||
@property | ||
def server_name(self) -> Optional[str]: | ||
""" | ||
(Optional) Something like `my-iot-hub.azure-devices.net` if available., | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_SERVER_NAME).value() | ||
|
||
@property | ||
def cloud_device_id(self) -> Optional[str]: | ||
""" | ||
(Optional) Device identifier for the device in the cloud if available., | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_CLOUD_DEVICE_ID).value() | ||
|
||
@property | ||
def cloud_type(self) -> Optional[str]: | ||
""" | ||
(Optional) Cloud provider identifier., | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_CLOUD_TYPE).value() | ||
|
||
@property | ||
def connection_status(self) -> Optional[CloudConfigurationConnectionStatus]: | ||
""" | ||
Indicates the status of connection. A message beyond the [0..3] range represents an HTTP error code., | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_CONNECTION_STATUS).value() | ||
|
||
@property | ||
def push_period(self) -> Optional[int]: | ||
""" | ||
How often to push data to the cloud., _: ms | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_PUSH_PERIOD).value() | ||
|
||
@push_period.setter | ||
def push_period(self, value: int) -> None: | ||
self.register(JD_CLOUD_CONFIGURATION_REG_PUSH_PERIOD).set_values(value) | ||
|
||
|
||
@property | ||
def push_watchdog_period(self) -> Optional[int]: | ||
""" | ||
If no message is published within given period, the device resets. | ||
This can be due to connectivity problems or due to the device having nothing to publish. | ||
Forced to be at least `2 * flush_period`. | ||
Set to `0` to disable (default)., _: ms | ||
""" | ||
return self.register(JD_CLOUD_CONFIGURATION_REG_PUSH_WATCHDOG_PERIOD).value() | ||
|
||
@push_watchdog_period.setter | ||
def push_watchdog_period(self, value: int) -> None: | ||
self.register(JD_CLOUD_CONFIGURATION_REG_PUSH_WATCHDOG_PERIOD).set_values(value) | ||
|
||
|
||
def on_connection_status_change(self, handler: EventHandlerFn) -> UnsubscribeFn: | ||
""" | ||
Raised when the connection status changes | ||
""" | ||
return self.on_event(JD_CLOUD_CONFIGURATION_EV_CONNECTION_STATUS_CHANGE, handler) | ||
|
||
def on_message_sent(self, handler: EventHandlerFn) -> UnsubscribeFn: | ||
""" | ||
Raised when a message has been sent to the hub. | ||
""" | ||
return self.on_event(JD_CLOUD_CONFIGURATION_EV_MESSAGE_SENT, handler) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Autogenerated constants for Cloud Configuration service | ||
from enum import IntEnum | ||
from jacdac.constants import * | ||
from jacdac.system.constants import * | ||
JD_SERVICE_CLASS_CLOUD_CONFIGURATION = const(0x1462eefc) | ||
|
||
|
||
class CloudConfigurationConnectionStatus(IntEnum): | ||
CONNECTED = const(0x1) | ||
DISCONNECTED = const(0x2) | ||
CONNECTING = const(0x3) | ||
DISCONNECTING = const(0x4) | ||
|
||
|
||
JD_CLOUD_CONFIGURATION_REG_SERVER_NAME = const(0x180) | ||
JD_CLOUD_CONFIGURATION_REG_CLOUD_DEVICE_ID = const(0x181) | ||
JD_CLOUD_CONFIGURATION_REG_CLOUD_TYPE = const(0x183) | ||
JD_CLOUD_CONFIGURATION_REG_CONNECTION_STATUS = const(0x182) | ||
JD_CLOUD_CONFIGURATION_REG_PUSH_PERIOD = const(0x80) | ||
JD_CLOUD_CONFIGURATION_REG_PUSH_WATCHDOG_PERIOD = const(0x81) | ||
JD_CLOUD_CONFIGURATION_CMD_CONNECT = const(0x81) | ||
JD_CLOUD_CONFIGURATION_CMD_DISCONNECT = const(0x82) | ||
JD_CLOUD_CONFIGURATION_CMD_SET_CONNECTION_STRING = const(0x86) | ||
JD_CLOUD_CONFIGURATION_EV_CONNECTION_STATUS_CHANGE = const(JD_EV_CHANGE) | ||
JD_CLOUD_CONFIGURATION_EV_MESSAGE_SENT = const(0x80) | ||
JD_CLOUD_CONFIGURATION_PACK_FORMATS = { | ||
JD_CLOUD_CONFIGURATION_REG_SERVER_NAME: "s", | ||
JD_CLOUD_CONFIGURATION_REG_CLOUD_DEVICE_ID: "s", | ||
JD_CLOUD_CONFIGURATION_REG_CLOUD_TYPE: "s", | ||
JD_CLOUD_CONFIGURATION_REG_CONNECTION_STATUS: "u16", | ||
JD_CLOUD_CONFIGURATION_REG_PUSH_PERIOD: "u32", | ||
JD_CLOUD_CONFIGURATION_REG_PUSH_WATCHDOG_PERIOD: "u32", | ||
JD_CLOUD_CONFIGURATION_CMD_SET_CONNECTION_STRING: "s", | ||
JD_CLOUD_CONFIGURATION_EV_CONNECTION_STATUS_CHANGE: "u16" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Autogenerated file. | ||
from .client import DeviceScriptConditionClient # type: ignore | ||
from .constants import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
# Autogenerated constants for DeviceScript Manager service | ||
from enum import IntEnum | ||
from jacdac.constants import * | ||
from jacdac.system.constants import * | ||
JD_SERVICE_CLASS_DEVICE_SCRIPT_MANAGER = const(0x1134ea2b) | ||
|
||
|
||
class DeviceScriptManagerMessageFlags(IntEnum): | ||
TO_BE_CONTINUED = const(0x1) | ||
|
||
|
||
JD_DEVICE_SCRIPT_MANAGER_CMD_DEPLOY_BYTECODE = const(0x80) | ||
JD_DEVICE_SCRIPT_MANAGER_CMD_READ_BYTECODE = const(0x81) | ||
JD_DEVICE_SCRIPT_MANAGER_CMD_LOG_MESSAGE = const(0x82) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_RUNNING = const(0x80) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_AUTOSTART = const(0x81) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_LOGGING = const(0x82) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_SIZE = const(0x180) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_HASH = const(0x181) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_SHA256 = const(0x182) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_RUNTIME_VERSION = const(0x183) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_NAME = const(0x184) | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_VERSION = const(0x185) | ||
JD_DEVICE_SCRIPT_MANAGER_EV_PROGRAM_PANIC = const(0x80) | ||
JD_DEVICE_SCRIPT_MANAGER_EV_PROGRAM_CHANGE = const(JD_EV_CHANGE) | ||
JD_DEVICE_SCRIPT_MANAGER_PACK_FORMATS = { | ||
JD_DEVICE_SCRIPT_MANAGER_CMD_DEPLOY_BYTECODE: "u32", | ||
JD_DEVICE_SCRIPT_MANAGER_CMD_READ_BYTECODE: "b[12]", | ||
JD_DEVICE_SCRIPT_MANAGER_CMD_LOG_MESSAGE: "u8 u8 s", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_RUNNING: "u8", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_AUTOSTART: "u8", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_LOGGING: "u8", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_SIZE: "u32", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_HASH: "u32", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_SHA256: "b[32]", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_RUNTIME_VERSION: "u16 u8 u8", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_NAME: "s", | ||
JD_DEVICE_SCRIPT_MANAGER_REG_PROGRAM_VERSION: "s", | ||
JD_DEVICE_SCRIPT_MANAGER_EV_PROGRAM_PANIC: "u32 u32" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Autogenerated file. | ||
from .constants import * |
Oops, something went wrong.