summaryrefslogtreecommitdiffstats
path: root/sdbusplus/message.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-05-12 13:27:50 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-05-15 12:41:28 -0400
commit61f57a4a0f8898487ca4a19a173bc6c1520d6486 (patch)
tree69f5dc5a66a7090ba7c6f621aa925d3f3dcd29cb /sdbusplus/message.hpp
parentda25f34244f68ff00d3e4c5ee945b160e7c4b307 (diff)
downloadsdbusplus-61f57a4a0f8898487ca4a19a173bc6c1520d6486.tar.gz
sdbusplus-61f57a4a0f8898487ca4a19a173bc6c1520d6486.zip
message: Add wrappers for sd_bus_get_xxx
At the moment only signal arguments are accessible in signal messages. Key information such as the path of the object emitting the signal are in the message headers, so provide access to those as well. Change-Id: I25bc18c21cd4c3d66cad4cf38235469d5092d364 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'sdbusplus/message.hpp')
-rw-r--r--sdbusplus/message.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/sdbusplus/message.hpp b/sdbusplus/message.hpp
index 8c9414e..21d3eb3 100644
--- a/sdbusplus/message.hpp
+++ b/sdbusplus/message.hpp
@@ -109,6 +109,51 @@ struct message
return sd_bus_message_get_signature(_msg.get(), true);
}
+ /** @brief Get the path of a message.
+ *
+ * @return A [weak] pointer to the path of the message.
+ */
+ const char* get_path()
+ {
+ return sd_bus_message_get_path(_msg.get());
+ }
+
+ /** @brief Get the interface of a message.
+ *
+ * @return A [weak] pointer to the interface of the message.
+ */
+ const char* get_interface()
+ {
+ return sd_bus_message_get_interface(_msg.get());
+ }
+
+ /** @brief Get the member of a message.
+ *
+ * @return A [weak] pointer to the member of the message.
+ */
+ const char* get_member()
+ {
+ return sd_bus_message_get_member(_msg.get());
+ }
+
+ /** @brief Get the destination of a message.
+ *
+ * @return A [weak] pointer to the destination of the message.
+ */
+ const char* get_destination()
+ {
+ return sd_bus_message_get_destination(_msg.get());
+ }
+
+ /** @brief Get the sender of a message.
+ *
+ * @return A [weak] pointer to the sender of the message.
+ */
+ const char* get_sender()
+ {
+ return sd_bus_message_get_sender(_msg.get());
+ }
+
/** @brief Check if message is a method error.
*
* @return True - if message is a method error.
OpenPOWER on IntegriCloud