From 4bde801d6aa0714c551d7f39e23083258ef590fe Mon Sep 17 00:00:00 2001 From: "john.sitarski" Date: Thu, 15 Jun 2023 16:37:08 +0930 Subject: [PATCH] add todos and initial route changes --- microservice.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/microservice.py b/microservice.py index dda1a89..7d130a1 100755 --- a/microservice.py +++ b/microservice.py @@ -18,7 +18,7 @@ swag = Swagger(app) radios = {} -@app.route("/report") +@app.route("/GetReport") def report(): """Get streams report from the RTSP relay. --- @@ -53,7 +53,6 @@ def radio_report(): return jsonify(devices) -@app.route("/radio//connect") def connect(radio): """Connect to a radio device, by driver name or serial number. --- @@ -87,7 +86,7 @@ def connect(radio): return "Radio device not found", 400 -@app.route("/radio//disconnect") +# TODO: reset might use this def disconnect(radio): """Disconnect from a radio device. --- @@ -112,8 +111,9 @@ def disconnect(radio): return _error_message_json("Radio not connected"), 400 -@app.route("/radio//configure/") -def configure(radio, frequency): +# TODO: add post parameters... +@app.route("ALEModem/Configure") +def configure(): """Tune the radio to a frequency. You must connect to the radio before attempting to configure it. The radio must be configured before streaming can be started. @@ -141,7 +141,7 @@ def configure(radio, frequency): return _error_message_json("Radio not connected"), 400 -@app.route("/radio//start") +@app.route("ALEModem/StartCall") def start_stream(radio): """Start the radio stream. Once the stream has been started, connect to the stream at: @@ -166,7 +166,7 @@ def start_stream(radio): return _error_message_json(e.message), 400 -@app.route("/radio//end") +@app.route("ALEModem/EndCall") def end_stream(radio): """Terminate the radio stream. --- @@ -186,11 +186,10 @@ def end_stream(radio): radios[radio].end_stream() return jsonify("message", "successfully ended radio stream"), 200 except Exception as e: - error_message = {"error_message": e.message} return _error_message_json(e.message), 400 -@app.route("/radio//info") +@app.route("/info") def radio_info(radio): """Get information about a radio. ---