@@ -21,17 +21,16 @@ (use format typed-records) ;; RADT => purpose of json format?? (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) +(declare (uses rmtmod)) +(import (prefix rmtmod rmtmod:)) + (include "common_records.scm") (include "db_records.scm") -;; (declare (uses rmtmod)) - -;; (import rmtmod) - ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; generate entries for ~/.megatestrc with the following @@ -75,17 +74,23 @@ (set! *rmt-query-last-rest-time* now) (set! *rmt-query-last-call-time* now)) (else ;; sufficient rests have occurred, just record the last query time (set! *rmt-query-last-call-time* now))))) +(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) + (if (equal? (configf:lookup *configdat* "setup" "newapi") "yes") + (rmtmod:send-receive cmd rid params attemptnum: 1 area-dat: #f) + (rmt:send-receive-orig cmd rid params attemptnum: 1 area-dat: #f))) + ;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname)) ;; -(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected +(define (rmt:send-receive-orig cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected #;(common:telemetry-log (conc "rmt:"(->string cmd)) payload: `((rid . ,rid) (params . ,params))) + (if (not (equal? (configf:lookup *configdat* "setup" "query-rest") "no")) (rmt:query-rest cmd rid params)) (if (> attemptnum 2) (debug:print 0 *default-log-port* "INFO: attemptnum in rmt:send-receive is " attemptnum))