Page 1 of 1

how to check the client is connected

Posted: Tue Feb 21, 2017 3:46 am
by andrea_
Hi,

how can I check if the client is connected to Motive?

HostPresent in the ServerDescriptor only works during the initialisation.
After I initialised the client, if I turn off the data streaming from motive, HostPreset is still true, however when I turn the streaming back on, my client cannot receive the data anymore.

Re: how to check the client is connected

Posted: Tue Feb 21, 2017 12:29 pm
by steven.andrews
Hello andrea_,

If you are trying to determine if a client is connected to Motive, this is indicated in the status bar at the bottom of Motive.
http://wiki.optitrack.com/index.php?title=Status_Bar

The NET status indicates whether or not Motive is streaming, and if a client is connected.
NET: Color indication of the streaming status.

Dark: Streaming is disabled. To enable it, check the broadcast streaming data on the Data Streaming pane.
Yellow: Streaming is enabled but the client application is not connected.
Green: Motive is connected to a NatNet client application and is streaming the tracking data.
If you hover over the indicator it may yield some additional information.

I hope this helps with your question. If you require any further assistance with this, please feel free to open a Support ticket with is at help.naturalpoint.com

Best,
Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer

Re: how to check the client is connected

Posted: Thu Feb 23, 2017 7:37 am
by andrea_
I'm trying to check from the client side if it's still connected with the host(Motive) not vice versa.

Re: how to check the client is connected

Posted: Thu Feb 23, 2017 11:09 am
by steven.andrews
Hi andrea_,

Thank you for the clarification.

The Sample Client application contains a little test that can be used to verify you are receiving data.

Code: Select all

    // send/receive test request
    printf("[SampleClient] Sending Test Request\n");
    void* response;
    int nBytes;
    iResult = theClient->SendMessageAndWait("TestRequest", &response, &nBytes);
    if (iResult == ErrorCode_OK)
    {
        printf("[SampleClient] Received: %s", (char*)response);
    }
I hope this helps.

Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer

Re: how to check the client is connected

Posted: Sat Feb 25, 2017 11:58 am
by andrea_
ok so the only way is to send a message and wait for the response.

can you clarify the message type?
I can see you send a "TestResponse", but I can't find any reference to it, instead I found a NAT_PING definition in the NatNetType.h and I'm not sure if I can use these IDs in the request or that's something else. Is there a list of valid message types?

thanks
Andrea

Re: how to check the client is connected

Posted: Mon Feb 27, 2017 3:35 pm
by steven.andrews
Hi andrea_,

A list of supported remote commands and controls (string), along with the corresponding returns, are documented in the user guide.
http://wiki.optitrack.com/index.php?tit ... 2FRequests

I hope this helps,
Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer