示例#1
0
    private async void StartTest()
    {
        if (ubiiNode == null)
        {
            Debug.LogError("UbiiClient not found!");
            return;
        }

        await ubiiNode.WaitForConnection();

        CreateUbiiSpecs();

        Ubii.Services.ServiceReply deviceRegistrationReply = await ubiiNode.RegisterDevice(ubiiDevice);

        if (deviceRegistrationReply.Device != null)
        {
            ubiiDevice = deviceRegistrationReply.Device;
        }

        this.subToken = await ubiiNode.SubscribeTopic(topicTestPublishSubscribe,
                                                      (Ubii.TopicData.TopicDataRecord record) =>
        {
            testPosition.Set((float)record.Vector3.X, (float)record.Vector3.Y, (float)record.Vector3.Z);
        });

        testRunning = true;
    }
示例#2
0
    public async void RunTest()
    {
        Debug.Log("TestProcessingModulesFrequency started ...");

        Ubii.Services.ServiceReply reply = await ubiiNode.CallService(new Ubii.Services.ServiceRequest
        {
            Topic   = UbiiConstants.Instance.DEFAULT_TOPICS.SERVICES.SESSION_RUNTIME_START,
            Session = ubiiSession
        });

        //Debug.Log("TestProcessingModules.RunTest() - reply to start session: " + reply);
        if (reply.Session != null)
        {
            ubiiSession = reply.Session;
        }

        await Task.Delay(5000);

        reply = await ubiiNode.CallService(new Ubii.Services.ServiceRequest
        {
            Topic   = UbiiConstants.Instance.DEFAULT_TOPICS.SERVICES.SESSION_RUNTIME_STOP,
            Session = ubiiSession
        });

        //Debug.Log("TestProcessingModules.RunTest() - reply to stop session: " + reply);

        if (testFailure)
        {
            Debug.LogError("TestProcessingModulesFrequency FAILURE");
        }
        else
        {
            Debug.Log("TestProcessingModulesFrequency SUCCESS");
        }
    }
示例#3
0
    async private void RunTestStartStopSession()
    {
        bool success = false;

        Ubii.Services.ServiceReply replyStart = await ubiiNode.CallService(
            new Ubii.Services.ServiceRequest {
            Topic = ubiiConstants.DEFAULT_TOPICS.SERVICES.SESSION_RUNTIME_START, Session = this.sessionSpecs
        }
            );

        if (replyStart.Session != null)
        {
            this.sessionSpecs = replyStart.Session;

            await Task.Delay(1000);

            Ubii.Services.ServiceReply replyStop = await ubiiNode.CallService(
                new Ubii.Services.ServiceRequest {
                Topic = ubiiConstants.DEFAULT_TOPICS.SERVICES.SESSION_RUNTIME_STOP, Session = this.sessionSpecs
            }
                );

            if (replyStop.Success != null)
            {
                Debug.Log("RunTestStartStopSession SUCCESS!");
            }
            else
            {
                Debug.LogError("RunTestStartStopSession FAILURE! Could not stop session.");
            }
        }
        else
        {
            Debug.LogError("RunTestStartStopSession FAILURE! Could not start session.");
        }
    }