Loading automotive/can/1.0/default/libnl++/Socket.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,10 @@ std::optional<unsigned> Socket::getPid() { 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(); Loading automotive/can/1.0/default/libnl++/include/libnl++/Socket.h +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <libnl++/MessageFactory.h> #include <linux/netlink.h> #include <poll.h> #include <optional> #include <set> Loading Loading @@ -173,6 +174,14 @@ class Socket { */ 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. * Loading Loading
automotive/can/1.0/default/libnl++/Socket.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,10 @@ std::optional<unsigned> Socket::getPid() { 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(); Loading
automotive/can/1.0/default/libnl++/include/libnl++/Socket.h +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <libnl++/MessageFactory.h> #include <linux/netlink.h> #include <poll.h> #include <optional> #include <set> Loading Loading @@ -173,6 +174,14 @@ class Socket { */ 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. * Loading