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

Not able to read timestamps from TimestampedFixedValue #44

Open
RoL0NL opened this issue Jan 1, 2022 · 1 comment
Open

Not able to read timestamps from TimestampedFixedValue #44

RoL0NL opened this issue Jan 1, 2022 · 1 comment

Comments

@RoL0NL
Copy link

RoL0NL commented Jan 1, 2022

Hi, thanks for this awesome library! Works great!

I have an issue accessing the timestamp corresponding to the gas_delivered value (TimestampedFixedValue type). The readme states that there is an additional timestamp() function which would return a timestamp string. The compiler however throws an error:

DSMR:376:65: error: no match for call to '(String) ()'
       mqttGasStruct["timestamp"] = data.gas_delivered.timestamp();
exit status 1
no match for call to '(String) ()'

I am not that familiar with the C++ template structures used, but I cannot find any function named timestamp() in fields.h. I can directly access gas_delivered.timestamp (the variable, not the function), but that is not how it is documented and it seems that this value is not updated after receiving new telegrams.

Am I doing something wrong? Unfortunately, the examples do not cover these TimestampedFixedValue timestamps.

@matthijskooijman
Copy link
Owner

but I cannot find any function named timestamp() in fields.h. I can directly access gas_delivered.timestamp (the variable, not the function), but that is not how it is documented

It seems the README was wrong, timestamp is indeed a field, not a method. I'll update the README in a minute.

and it seems that this value is not updated after receiving new telegrams.

Hm, that is weird. However, the examples use a local variable for storing new data, so then there would be no way for the old value to show up. Maybe you are re-using the "MyData" (or whatever you called it) variable and not clearing it (though I would expect you to get duplicate field errors the). See #17.

matthijskooijman added a commit that referenced this issue Jan 2, 2022
This incorrectly documented that that this was a method, which it is
not.

See #44
hvegh pushed a commit to hvegh/arduino-dsmr that referenced this issue Jan 12, 2024
This incorrectly documented that that this was a method, which it is
not.

See matthijskooijman#44
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

2 participants