-
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
13 changed files
with
111 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Autogenerated file. | ||
from .client import DeviceScriptConditionClient # 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,30 @@ | ||
# Autogenerated file. Do not edit. | ||
from jacdac.bus import Bus, Client, EventHandlerFn, UnsubscribeFn | ||
from .constants import * | ||
|
||
|
||
|
||
class DeviceScriptConditionClient(Client): | ||
""" | ||
Conditions are synthetic services used to synchronize threads of executions of a DeviceScript VM. | ||
Implements a client for the `DeviceScript Condition <https://microsoft.github.io/jacdac-docs/services/devicescriptcondition>`_ service. | ||
""" | ||
|
||
def __init__(self, bus: Bus, role: str) -> None: | ||
super().__init__(bus, JD_SERVICE_CLASS_DEVICE_SCRIPT_CONDITION, JD_DEVICE_SCRIPT_CONDITION_PACK_FORMATS, role) | ||
|
||
|
||
def on_signalled(self, handler: EventHandlerFn) -> UnsubscribeFn: | ||
""" | ||
Triggered by `signal` command. | ||
""" | ||
return self.on_event(JD_DEVICE_SCRIPT_CONDITION_EV_SIGNALLED, handler) | ||
|
||
|
||
def signal(self, ) -> None: | ||
""" | ||
Triggers a `signalled` event. | ||
""" | ||
self.send_cmd_packed(JD_DEVICE_SCRIPT_CONDITION_CMD_SIGNAL, ) | ||
|
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,9 @@ | ||
# Autogenerated constants for DeviceScript Condition service | ||
from jacdac.constants import * | ||
from jacdac.system.constants import * | ||
JD_SERVICE_CLASS_DEVICE_SCRIPT_CONDITION = const(0x1196796d) | ||
JD_DEVICE_SCRIPT_CONDITION_CMD_SIGNAL = const(0x80) | ||
JD_DEVICE_SCRIPT_CONDITION_EV_SIGNALLED = const(JD_EV_CHANGE) | ||
JD_DEVICE_SCRIPT_CONDITION_PACK_FORMATS = { | ||
|
||
} |
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 DeviceScriptManagerClient # 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
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,34 @@ | ||
# 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_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_EV_PROGRAM_PANIC: "u32 u32" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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