Skip to main content

Package for a gRPC client connecting to ORiN3 Remote Engine / ORiN3 Provider.

Project description

Overview

This package is a gRPC client that implements the interfaces of ORiN3 Remote Engine and ORiN3 Provider.
It allows user applications to call various functions of ORiN3 Remote Engine and ORiN3 Provider.

How to use

A sample is shown below to explain how to use it. This sample does the following:

  • Communicates with ORiN3 Remote Engine and starts ORiN3 Provider (Mock).
  • Communicates with ORiN3 Provider (Mock) and sets values ​​to ORiN3 variables.
import asyncio
from orin3_provider_client.v1.client_creator import ClientCreator
from orin3_provider_client.v1.common import ORiN3ValueType
from orin3_remote_engine_client.v1.remote_engine_client import ProtocolType, ProviderEndpoint, RemoteEngineClient, TelemetryOption, LogLevel

async def debug_main():
    # Connect to Remote Engine
    async with RemoteEngineClient("127.0.0.1", 7103) as remote_engine:

        # Launch a Mock Provider
        provider_endpoints = [ProviderEndpoint(ProtocolType.HTTP, "127.0.0.1", 0)]
        telemetry_endpoints = []
        telemetry_attributes = {}
        telemetry_option = TelemetryOption(telemetry_attributes, True, telemetry_endpoints)
        extensions = {}
        result = await remote_engine.wakeup_provider_async(
            id="643D12C8-DCFC-476C-AA15-E8CA004F48E8",
            version="1.0.85",
            thread_safe_mode=True,
            endpoints=provider_endpoints,
            log_level=LogLevel.INFORMATION,
            telemetry_option=telemetry_option,
            extension=extensions)

        provider_information = result.provider_information
        endpoints = provider_information.endpoints
        endpoint = endpoints[0]

        async with await ClientCreator.attach_root_object_async(endpoint.ip_address, endpoint.port) as root_object:
            # TODO: Add processing from here on down if necessary.

            # Create a controller
            controller_name = "GeneralPurposeController"
            controller_type = "ORiN3.Provider.ORiNConsortium.Mock.O3Object.Controller.GeneralPurposeController, ORiN3.Provider.ORiNConsortium.Mock"
            controller_option = '{"@Version":"1.0.85"}'
            controller = await ClientCreator.create_controller_async(root_object, controller_name, controller_type, controller_option)
            await controller.connect_async()

            # Create a variable
            variable_name = "Int32Variable"
            variable_type = "ORiN3.Provider.ORiNConsortium.Mock.O3Object.Variable.Int32Variable, ORiN3.Provider.ORiNConsortium.Mock"
            variable_option = '{"@Version":"1.0.85"}'
            variable = await ClientCreator.create_variable_async(controller, variable_name, variable_type, variable_option, ORiN3ValueType.ORIN3_INT32)

            # SetValue/GetValue
            await variable.set_value_async(100)
            value = await variable.get_value_async()
            print(value)

            # Shutdown Provider
            await root_object.shutdown_async()

if __name__ == '__main__':
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    asyncio.run(debug_main())

Reference

The original proto file is stored in the following location:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orin3_message_client-1.0.232-py3-none-any.whl (95.4 kB view details)

Uploaded Python 3

File details

Details for the file orin3_message_client-1.0.232-py3-none-any.whl.

File metadata

File hashes

Hashes for orin3_message_client-1.0.232-py3-none-any.whl
Algorithm Hash digest
SHA256 6835f696c5b4e70fdf284d9cca57d2242ce579e3c46d97d6180109bf2ee631da
MD5 2a24081c1810511a3b647e1e4d8aed43
BLAKE2b-256 a37c368827ab26475e1dea62952b6507a3b9738b8f94850a6121478d2e433c0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page