Loading...
 
(Cached)

GbbExt for SRCP


GbbExt version 0.1


GbbExt fo SRCP was created to transfer more information from GbbKolejka to GbbMobile using standard SRCP protocol: e.g. pictures and loc name

GbbExt for SRCP is implemented in:
- SRCP server embedded in GbbKolejka: server part
- GbbMobile: client part

GbbExt for SRCP is not implemented in GbbKolejka client part (to DDW server)


How to client can check if server has implemented GbbExt?

After establishing a connection Server send following information in welcome message:

GbbExt 1.0

where "1.0" it is current version of GbbExt.
For example full welcome string:

Welcome to GbbKolejka SRCP server; SRCP 0.8; ServerVer 1.0; GbbExt 1.0


How to switch on GbbExt on connection?


Client during hand shake should send to server:

SET PROTOCOL GBBEXT x.y

where x.y is maximum required GbbExt version.

If server doesn't implement GbbExt should returns 400 error. If server implements GbbExt returns:

201 OK PROTOCOL GBBEXT a.b

Where a.b is current used version of GbbExt, which can be less or equal to x.y.

Remark: x, a can have more than one digit. But y, b have always one digit.


How to receive loc name?

If GbbExt is switch on then after every "100 INFO 1 GL" in INFO channel server send following message:

150 INFO <bus> GL <address> NAME <name>

where: <name> is a lok name (can contain spaces, name is extending to end of line)


How to receive loc picture?

To receive loc picture client should send to server:

GET <bus> GL <address> PICTURE <width> <height>

where <width> and <height> is picture size required form server (integer numbers)


Server send following response if no picture is available:

150 INFO <bus> GL <address> NOPICTURE

Otherwise Server send following response with picture in .jpg binary format:

150 INFO <bus> GL <address> PICTURE <width> <height> <len> <list of hex bytes>

where: <width> and <height> is required size of picture

<len> - number of bytes in <list of hex bytes> (number of bytes, no characters)

<list of hex bytes> - is a list of bytes coded hex: every byte is represented by two characters (digits 0-9 and upper letters A-F). Between bytes there can be space (in GbbKolejka after every 16 bytes = 32 characters there is one space).


Example (fiction):

150 INFO 1 GL 3 PICTURE 150 50 32 00112233445566778899AABBCCDDEEFF 00112233445566778899AABBCCDDEEFF


Remarks


- This response is never send in INFO channel.
- In GbbKolejka this responce is send in one line (SRCP says than line must not exceed over a length of 1000 characters - this rule is break in this responce)

Created by admin. Last Modification: Saturday 26 November, 2011 22:46:44 CET by admin.