Skip to content

Version 2.0.0

Latest
Compare
Choose a tag to compare
@patricklaf patricklaf released this 03 Sep 14:41
b5d3c73

Many optimizations and rewrites have been made to reduce hardware requirements and provide support for low-end cards.

The library can be configured to use streams and vectors to overcome limitations of versions 1.x.x.

What's New

Migrate to version 2.0.0

Minor changes are required when migrating existing code to version 2.0.0 of the library.

This is mainly due to the change from C-like enum to C++ syntax.

  • All version constants like VERSION2C are now defined in struct Version.
    Replace by Version::V2C.
  • All error constants like NO_ERROR are now defined in struct Error.
    Replace by Error::NoError.
  • All trap constants like COLDSTART are now defined in struct Trap.
    Replace by Trap::ColdStart.
  • All type constants like TYPE_GETRESPONSE are now defined in class Type.
    Replace by Type::GetResponse.
  • Class PORT is replaced by struct Port. Port constant TRAP is renamed as Trap.
    Replace PORT::SNMP by Port::SNMP and PORT::TRAP by Port::Trap.
// Version 1.4.1
SNMP::Message *response = new SNMP::Message(SNMP::VERSION2C, "public", SNMP::TYPE_GETRESPONSE);
 
// Version 2.0.0
SNMP::Message *response = new SNMP::Message(SNMP::Version::V2C, "public", SNMP::Type::GetResponse);

The API changed for SNMP::begin(). The UDP parameter is now a reference and no more a pointer.

// Version 1.4.1
snmp.begin(&udp);
 
// Version 2.0.0
snmp.begin(udp);

All examples have been updated.

I've done a lot of testing for this new version but it's likely that I've missed some bugs. In that case, please create an issue.

Thanks for using this library.

Have fun!

Full Changelog: 1.4.1...2.0.0