Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encode() overload is ambiguous #8

Open
wlp5s0 opened this issue Sep 29, 2023 · 0 comments
Open

encode() overload is ambiguous #8

wlp5s0 opened this issue Sep 29, 2023 · 0 comments

Comments

@wlp5s0
Copy link

wlp5s0 commented Sep 29, 2023

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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant