Merge changes from topics "aae-watchdog-vhal-integration", "aae_new_vhal_healthcheck"
* changes:
New health check in VHAL
Add vehicle properties to integrate car watchdog
diff --git a/automotive/can/1.0/default/libnl++/Socket.cpp b/automotive/can/1.0/default/libnl++/Socket.cpp
index 08683ca..514d9bb 100644
--- a/automotive/can/1.0/default/libnl++/Socket.cpp
+++ b/automotive/can/1.0/default/libnl++/Socket.cpp
@@ -153,6 +153,10 @@
return sa.nl_pid;
}
+pollfd Socket::preparePoll(short events) {
+ return {mFd.get(), events, 0};
+}
+
Socket::receive_iterator::receive_iterator(Socket& socket, bool end)
: mSocket(socket), mIsEnd(end) {
if (!end) receive();
diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
index c69523d..8ea3575 100644
--- a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
+++ b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
@@ -23,6 +23,7 @@
#include <libnl++/MessageFactory.h>
#include <linux/netlink.h>
+#include <poll.h>
#include <optional>
#include <set>
@@ -174,6 +175,14 @@
std::optional<unsigned> getPid();
/**
+ * Creates a pollfd object for the socket.
+ *
+ * \param events Value for pollfd.events.
+ * \return A populated pollfd object.
+ */
+ pollfd preparePoll(short events = 0);
+
+ /**
* Live iterator continuously receiving messages from Netlink socket.
*
* Iteration ends when socket fails to receive a buffer.