Advanced Question (noob) How to commuicate with Orbiter by Orb::Connect ?

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
Hi !
In an ameliorated version of my [ame=http://www.orbithangar.com/searchid.php?ID=5830]Sim time tools[/ame], I want to get by Orb Connect the sim time and time acceleration. But I don't know how to send a command via OrbConnect. So the question is: How to commuicate with Orbiter by Orb::Connect ?

PS: I have used VB.NET for the sim time tools, but I wonder how to do the trick even in C++.
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
So, OrbConnect use sockets ? I know what is a socket, and I'll search how to connect to them in VB.NET.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
Connect to TCP port 37777. Send command followed by a newline character.

Orb::Connect will reply in the form <command>=<response> followed by a newline character.

The commands you need are ORB:SimTime and ORB:TimeAccel.

See the Orb::Connect manual for more information (it installs under Doc\OrbConnect).
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
Thanks kamaz,
I found how to send and recieve sockets. For a test I made a quick program, but there is no data returned ... The consoles "freezes" when it wants to read the returned socket ... Does the program works for you ?
 

Attachments

  • OrbConnectTest.zip
    5.1 KB · Views: 17

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
You do not send newline character after the command. If it's VB you are doing something like

SendToSocket( command )

and it should be

SendToSocket( command & Chr(10) & Chr(13) )

Also, next time please post the source code. Makes debugging much easier.
 
Top