diff mbox series

[RFC,BlueZ,1/2] mesh: Add documentation for AttachFD

Message ID 20200616122745.25056-2-michal.lowas-rzechonek@silvair.com (mailing list archive)
State Rejected
Headers show
Series mesh: Deliver mesh packets over datagram socket | expand

Commit Message

Michał Lowas-Rzechonek June 16, 2020, 12:27 p.m. UTC
From: Przemysław Fierek <przemyslaw.fierek@silvair.com>

---
 doc/mesh-api.txt | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
index 6d905cf48..cd2ffd2a8 100644
--- a/doc/mesh-api.txt
+++ b/doc/mesh-api.txt
@@ -118,6 +118,46 @@  Methods:
 			org.bluez.mesh.Error.AlreadyExists,
 			org.bluez.mesh.Error.Failed
 
+    object node, array{byte, array{(uint16, dict)}} configuration, fd
+            AttachFD(object app_root, uint64 token)
+
+        This is an alternative version of the Attach() method. This method
+        acquires file descriptor for message reception.
+
+        Method behaviour and usage is similiar to the Attach() method.
+        The difference between those two method is that after call AttachFD()
+        all received messages will be passed via file descriptor,
+        instead of daemon calling MessageReceived() and
+        DevKeyMessageReceived() methods.
+
+
+        The data format used for the exchange:
+
+            Message types:
+                0 - Device Key Message
+                1 - Application Key Message
+
+            struct {
+                uint8_t element;
+                uint8_t src;
+
+                uint8_t type;
+                union {
+                    struct {
+                        uint8_t net_idx;
+                        bool remote;
+                    } dev; // only meaningful when type is 0
+
+                    struct {
+                        uint8_t app_idx;
+                        uint16_t dst;
+                        uint8_t label[16]; // only meaningful when dst is virtual
+                    } app; // only meaningful when type is 1
+                }
+
+                uint8_t data[];
+            };
+
 	void Leave(uint64 token)
 
 		This removes the configuration information about the mesh node