[PATCH 01/10] ratp: define message type flags

Aleksander Morgado aleksander at aleksander.es
Fri Feb 2 03:14:33 PST 2018


Split message types in 3 different groups:

  * Requests: messages generated by one RATP endpoint and sent to the
    the other endpoint to be processed.

  * Responses: messages generated by the RATP endpoint as a result of
    having received and processed a specific request message.

  * Indications: messages generated by one RATP endpoint for which
    there is no need to generate an explicit response message.

These message types are identified by new command flags.

Signed-off-by: Aleksander Morgado <aleksander at aleksander.es>
---
 common/ratp.c              | 4 ++++
 scripts/remote/messages.py | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/common/ratp.c b/common/ratp.c
index 80863f81f..a1fa6fd5f 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -41,6 +41,10 @@
 #define BB_RATP_TYPE_FS			8
 #define BB_RATP_TYPE_FS_RETURN		9
 
+#define BB_RATP_FLAG_NONE		0
+#define BB_RATP_FLAG_RESPONSE		(1 << 0) /* Packet is a response */
+#define BB_RATP_FLAG_INDICATION		(1 << 1) /* Packet is an indication */
+
 struct ratp_bb {
 	uint16_t type;
 	uint16_t flags;
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py
index 8e8495b12..7a597bc9d 100644
--- a/scripts/remote/messages.py
+++ b/scripts/remote/messages.py
@@ -5,6 +5,11 @@ from __future__ import absolute_import, division, print_function
 
 import struct
 
+class BBFlag(object):
+    none = 0
+    response = 1 << 0
+    indication = 1 << 1
+
 
 class BBType(object):
     command = 1
-- 
2.15.1




More information about the barebox mailing list