Define message-summary dict keys as constants
[ric-plt/xapp-frame-py.git] / examples / rmr / send.py
index 270d893..4801649 100644 (file)
@@ -23,9 +23,9 @@ import sys
 from ricxappframe.rmr import rmr
 
 
-# Demonstrate NNG cleanup
+# Demonstrate RMR cleanup
 def signal_handler(sig, frame):
-    print("SIGINT received! Cleaning up rmr")
+    print("SIGINT received! Cleaning up RMR")
     rmr.rmr_close(mrc)
     print("Byeee")
     sys.exit(0)
@@ -58,7 +58,7 @@ while True:
         print("Waiting for return, will timeout after 2000ms")
         sbuf = rmr.rmr_torcv_msg(mrc, sbuf, 2000)
         summary = rmr.message_summary(sbuf)
-        if summary["message state"] == 12:
+        if summary[rmr.RMR_MS_MSG_STATE] == 12:
             print("Nothing received yet")
         else:
             print("Ack Message received!: {}".format(summary))