Skip to main content

Device Ready

Description

The device_ready function performs its defined operation.

Function Signature:

def device_ready(ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int) -> StandardResult:

Parameters

  • ws_config (WebServiceConfig): Configuration for the web service connection.
  • device_serial (str): Device serial number.
  • agent_type (str): Agent type name.
  • agent_version (str): Agent version string.
  • agent_index (int): Agent index.
  • process_id (int): Process identifier.

Returns

  • StandardResult: A result object containing:
    • code: HTTP status code (200 for success, -1 for exceptions).
    • description: Response body or error message.

Example Usage

# Example usage
ws_config = WebServiceConfig(access_key="key", secret_key="secret", base_url="https://api.example.com/")
device_serial = "example"
agent_type = "example"
agent_version = "example"
agent_index = 1
process_id = 1
result = device_ready(ws_config, device_serial, agent_type, agent_version, agent_index, process_id)
print(result)

Behavior

  • Sends a signed request to the web service.
  • On success, returns the computed value or result object.

Error Handling

  • Exceptions set the result code to -1 and include an error message when implemented.