#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.
References _port.
◆ 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.
References _port, and _udp.
◆ 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 _onMessage, _udp, and 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.
References _onMessage.
◆ 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 _udp, SNMP::Message::build(), and SNMP::Message::getSize().
◆ Agent
◆ Manager
◆ _onMessage
| Event SNMP::SNMP::_onMessage = nullptr |
|
private |
◆ _port
◆ _udp
| UDP* SNMP::SNMP::_udp = nullptr |
|
private |
The documentation for this class was generated from the following file: