Skip to content

Commit 683c50f

Browse files
committed
update Docs
1 parent 12ce176 commit 683c50f

File tree

3 files changed

+201
-145
lines changed

3 files changed

+201
-145
lines changed

Docs/Project Timeline.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ https://github.com/ideepcoder/Rtd_Ws_AB_plugin/blob/main/Samples/Client/Python/c
2525
https://github.com/ideepcoder/Rtd_Ws_AB_plugin/blob/main/Samples/Client/Python/vendor_class_wrapper.py
2626
##### 20250128 - Added Python utility script to Validate RTD Json
2727
https://github.com/ideepcoder/Rtd_Ws_AB_plugin/blob/main/Utility%20Scripts/Python/json_validator.py
28-
28+
##### 20250201 - Added Ping and AFL status function
29+
https://github.com/ideepcoder/Rtd_Ws_AB_plugin/blob/main/Docs/WSRTD%20Doc.md#AFL-access-functions

Docs/WSRTD Doc.md

+36-3
Original file line numberDiff line numberDiff line change
@@ -240,34 +240,51 @@ This is a special automatic backfill request command that is sent to the server
240240
```sh
241241
{"cmd":"bfsym","arg":"y SYM1 3"}
242242
```
243+
243244
##### c) ALL symbol backfill
244245
{"cmd":"bfall","arg":"x"}
245246
```sh
246247
{"cmd":"bfall","arg":"x"}
247248
```
248249
For ALL Symbol backfill, client application should still send individual Json-hist messages for each symbol.
250+
249251
##### d) ADD symbol to SUBSCRIBE rtd
250252
{"cmd":"addsym","arg":"SYMBOL_NAME"}
251253
```sh
252254
{"cmd":"addsym","arg":"SYM10"}
253255
```
256+
254257
##### e) REMOVE symbol OR UNSUBSCRIBE rtd
255258
{"cmd":"remsym","arg":"SYMBOL_NAME"}
256259
```sh
257260
{"cmd":"remsym","arg":"SYM6"}
258261
```
259262
263+
##### f) CLIENT-APP connected request ping
264+
{"cmd":"cping","arg":""}
265+
```sh
266+
{"cmd":"cping","arg":""}
267+
```
268+
Get state if any Client-App is connected to the relay. Also, a ping-alive packet that wsrtd is connected to Relay server.
269+
260270
261271
#### 3.2) Response CMD "to WS_RTD" Plug-in from Server
262272
263-
##### a) General acknowledgement reponse
273+
##### a) General acknowledgement response
264274
{"cmd":"CMD_SENT","code":int_code,"arg":"response string"}
265275
Mandatory code field
266276
```sh
267277
{"cmd":"remsym","code":200,"arg":"SYM6 unsubscribed ok"} /* sucess example*/
268278
{"cmd":"addsym","code":400,"arg":"XYZ9 subscribe error, invalid"} /* failure example*/
269279
```
270280
281+
##### b) Ping acknowledgement response
282+
Mandatory code field
283+
```sh
284+
{"cmd":"cping","code":200,"arg":"Vendor Connected"} /* Client running & connected to remote*/
285+
{"cmd":"cping","code":400,"arg":"Vendor Disconnected"} /* Client running but remote source is disconnected*/
286+
```
287+
271288
272289
#### 3.3) Request CMD "to WS_RTD" Plug-in "from" Server
273290
Mandatory code=300
@@ -305,12 +322,13 @@ returns {"ack":"dbgetbase","code":200,"arg"="60"}
305322
{"cmd":"dbstatus","code":300,"arg":""}
306323
"arg" field required, can set empty
307324
returns a STRING with Format as ( convert to INT )
308-
Current_Sym_Count, Max_Sym_Limit, Max_Size_Sym_Quotes, Refresh_Interval, Base_Interval
325+
Current_Sym_Count, Max_Sym_Limit, Max_Size_Sym_Quotes, Refresh_Interval, Base_Interval, DB_Name
309326
```sh
310327
{"cmd":"dbstatus","code":300,"arg":"DB Status requested at 14:56:00"}
311-
returns {"ack":"dbstatus","code":200,"arg"="500 1000 200 300 60"}
328+
returns {"ack":"dbstatus","code":200,"arg"="500 1000 200 300 60 Db_Test"}
312329
```
313330
331+
314332
### 4) ACK format in json message
315333
Plug-in will respond with **Acknowledgement TO Server** for all code=300 Server-side REQUESTS with json-ACK "ack" with server-request, "arg" with description and "code" which is integer
316334
Code values for OK=200, and OTHER/BAD=400
@@ -487,6 +505,21 @@ The status color will change to 🟢 from $${\color{ForestGreen}Dark \space
487505
Kindly use DebugView to check if settings change requires an AB to be restarted or Plugin to be reconnect. Scroll up to Configure section and read the details.
488506
489507
508+
## AFL access functions
509+
### using GetExtraData()
510+
https://www.amibroker.com/guide/afl/getextradata.html
511+
512+
#### 1) "IsRtdConn"
513+
if Data plugin websocket is connected, 1 else 0
514+
515+
#### 2) "ClientAppStatus"
516+
if Client App websocket is connected, Client App should implement "cping" cmd
517+
```sh
518+
0 = client-app not running
519+
200 = running
520+
400 = running but remote disconnected
521+
-1 = ping sent, awaiting reply
522+
```
490523
491524
<here>
492525

0 commit comments

Comments
 (0)