#include <src/SNMP.h>
|
bool | begin (UDP &udp) |
| Initializes network.
|
|
void | loop () |
| Network read operation.
|
|
bool | send (Message *message, const IPAddress ip, const uint16_t port) |
| Network write operation.
|
|
void | onMessage (Event event) |
| Sets on message event user handler.
|
|
|
using | Event = void (*)(const Message*, const IPAddress, const uint16_t) |
| On message event user handler type.
|
|
|
| SNMP (const uint16_t port) |
| Creates an SNMP object.
|
|
Definition at line 32 of file SNMP.h.
◆ Event
On message event user handler type.
The sketch must define an event handler function to process incoming message.
Example
}
void onMessage(Event event)
Sets on message event user handler.
- Parameters
-
message | SNMP message to process. |
remote | IP address of the sender. |
port | UDP port of the sender. |
Definition at line 50 of file SNMP.h.
◆ SNMP()
SNMP::SNMP::SNMP |
( |
const uint16_t | port | ) |
|
|
inlineprivate |
Creates an SNMP object.
- Parameters
-
Definition at line 137 of file SNMP.h.
◆ begin()
bool SNMP::SNMP::begin |
( |
UDP & | udp | ) |
|
|
inline |
Initializes network.
- Parameters
-
- Returns
- 1 if success, 0 if failure.
Definition at line 59 of file SNMP.h.
◆ loop()
void SNMP::SNMP::loop |
( |
| ) |
|
|
inline |
Network read operation.
Read incoming packet, parses as an SNMP message an calls user message handler.
- Warning
- This function must be called frequently from the sketch loop() function.
Definition at line 72 of file SNMP.h.
References SNMP::Message::parse().
◆ onMessage()
void SNMP::SNMP::onMessage |
( |
Event | event | ) |
|
|
inline |
Sets on message event user handler.
- Parameters
-
Definition at line 127 of file SNMP.h.
◆ send()
bool SNMP::SNMP::send |
( |
Message * | message, |
|
|
const IPAddress | ip, |
|
|
const uint16_t | port ) |
|
inline |
Network write operation.
Builds message and write outgoing packet.
- Parameters
-
message | SNMP message to send. |
ip | IP address to send to. |
port | UDP port to send to |
- Returns
- 1 if success, 0 if failure.
Definition at line 106 of file SNMP.h.
References SNMP::Message::build(), and SNMP::Message::getSize().
◆ Agent
◆ Manager
◆ _onMessage
Event SNMP::SNMP::_onMessage = nullptr |
|
private |
On message event user handler.
Definition at line 146 of file SNMP.h.
◆ _port
UDP port .
Definition at line 142 of file SNMP.h.
◆ _udp
UDP* SNMP::SNMP::_udp = nullptr |
|
private |
UDP client.
Definition at line 144 of file SNMP.h.
The documentation for this class was generated from the following file: