API documentation and example

Post Reply
BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

API documentation and example

Post by BlackChart » 13.06.2015, 11:37

I'm trying to make a Windows Phone client, but my initial tests doesnt seem to work.

I can connect, and the example <xmlh><xml size="84" name="lc"/></xmlh><lc id="4711" V_raw="87" V_rawMax="100" cmd="velocity" throttleid="192.168.100.32"/> somewhat works.
The throttleid get set, but not velocity.

When I request a loco list (<xmlh><xml size=""22"" name=""model""/></xmlh><model cmd=""lclist""/>), the only response I see returned is:
<?xml version="1.0" encoding="UTF-8"?>
<xmlh>
<xml size="61"/>
</xmlh>

I think to documentation lacks examples.

Any ideas whats wrong?

rjversluis
Site Admin
Posts: 42377
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: API documentation and example

Post by rjversluis » 13.06.2015, 13:59

Hi BlackChart,

your messages lacks complete traces.

Code: Select all

<xmlh>
<xml size="61"/>
</xmlh>
Were are the 61 bytes with XML text?

Who needs a Windows Phone Client since there is Rocweb?

BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

Re: API documentation and example

Post by BlackChart » 13.06.2015, 15:14

I get no more data than what is shown here.

I'm not aware of rocweb.
And is it usable on a Windows Phone?

rjversluis
Site Admin
Posts: 42377
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: API documentation and example

Post by rjversluis » 13.06.2015, 15:23

BlackChart wrote:I get no more data than what is shown here.

I'm not aware of rocweb.
And is it usable on a Windows Phone?
Depends on the browser:
http://wiki.rocrail.net/doku.php?id=rocweb:rocweb-en

If you do not get more data you have a problem in your App implementation.

BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

Re: API documentation and example

Post by BlackChart » 13.06.2015, 15:32

rjversluis wrote:Depends on the browser:
http://wiki.rocrail.net/doku.php?id=rocweb:rocweb-en
Did a quick test.
Loco select dialog only reads Locomotives and doesn't show a list on the phone (works fine on a PC)
And track plan doesn't show either.

This is on Internet Explorer on Windows Phone 8.1

Regarding the app.
I connect to the server and then send

Code: Select all

<xmlh><xml size=""22"" name=""model""/></xmlh><model cmd=""lclist""/>
UTF8 encoded to the server and listen for, as a test, 65535 bytes but only get the XML headers back.
I've had wireshark running an listening to the server, and not even Wireshark recieves more than the headers.

Am I missing some initiation or anything?

rjversluis
Site Admin
Posts: 42377
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: API documentation and example

Post by rjversluis » 13.06.2015, 15:45

This is on Internet Explorer on Windows Phone 8.1
This browser is not part of the league; Try to install Edge.

In my other Apps, iOS, Android and Java, the loco list comes as part of the complete model. (plan)
However when you get a xmlh which pronounce more data you should get this more data.
Maybe you should attach a server trace with additional BYTE and DEBUG trace level activated which documents your lclist request.

Are you using a very old revision of the Rocrail server?

rjversluis
Site Admin
Posts: 42377
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: API documentation and example

Post by rjversluis » 13.06.2015, 15:49

Maybe you should checkout the eWicht implementation:
http://forum.rocrail.net/viewtopic.php?f=44&t=8314
It also uses the "lclist" request.

http://www.mobacon.de/eWicht/doxygen/index.html

BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

Re: API documentation and example

Post by BlackChart » 13.06.2015, 16:40

rjversluis wrote:This browser is not part of the league; Try to install Edge.
No Edge on Windows Phone 8.1 - Yet.
rjversluis wrote:Are you using a very old revision of the Rocrail server?
Used an older build until today. It's the newest stable Ubuntu release from the website.

BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

Re: API documentation and example

Post by BlackChart » 13.06.2015, 16:50

For some reason I can't activate Debug trace - it's greyed out.

BlackChart
Posts: 6
Joined: 22.11.2014, 23:12

Re: API documentation and example

Post by BlackChart » 13.06.2015, 17:05

Got it.
Found the command line switches to enable debug.

Attached is a trace.
What catches my eyes is these specific lines, after I request the loco list:

Code: Select all

20150613.180200.292 r9999D cmdr0870 OThread  0218 queue[infw08709384][192.168.1.228] items 0
20150613.180200.294 r9999D infw0870 OSocket  0649 0 bytes written to socket.
You do not have the required permissions to view the files attached to this post.

rjversluis
Site Admin
Posts: 42377
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: API documentation and example

Post by rjversluis » 15.06.2015, 11:42

You should read more lines:

Code: Select all

20150613.180200.292 r9999D cmdr0870 OClntCon 0530 ClntCon post lclist to infw08709384...
20150613.180200.292 r9999D cmdr0870 OMap     0101 findMapItem(): hashVal = 719, key = infw08709384
20150613.180200.292 r9999D cmdr0870 OThread  0218 queue[infw08709384][192.168.1.228] items 0
20150613.180200.294 r9999D infw0870 OSocket  0649 0 bytes written to socket.
20150613.180200.302 r9999I cmdr0870 OSocket  0687 Other side has closed connection.
20150613.180200.303 r9999D cmdr0870 OSocket  0688 errno=0, read=0
20150613.180200.303 r9999D cmdr0870 OClntCon 0240 __readSiHdr Socket errno=0
20150613.180200.303 r9999D cmdr0870 OMap     0101 findMapItem(): hashVal = 719, key = infw08709384
20150613.180200.303 r9999D cmdr0870 OThread  0218 queue[infw08709384][192.168.1.228] items 0
20150613.180200.303 r9999I cmdr0870 OClntCon 0363 Server ended.
20150613.180200.308 r9999D infw0870 OSocket  0303 socket closed.
20150613.180200.308 r9999I infw0870 OClntCon 0177 InfoService ended.
your client did disconnect...

Post Reply

Return to “Documentation”