Arduino-SNMP
Arduino-SNMP copied to clipboard
encode() overload is ambiguous
hi
file ArduinoSNMP.h, inside function: void prepare_trapv2(SNMP_VALUE *t_v)
//This line below causes error, millis() type doesn't have a definite type.
//This produces different candidates for one overloaded function call.
//t_v->encode(SNMP_SYNTAX_TIME_TICKS, millis()/10);
t_v->encode(SNMP_SYNTAX_TIME_TICKS, (const uint16_t)millis()/10);
It was giving me error while compiling in Arduino IDE 2.0 for RP2040.
What helped was adding (). This way the whole division result is uint16_t, not millis itself.
t_v->encode(SNMP_SYNTAX_TIME_TICKS, (const uint16_t) (millis()/10));