spali / go-rscp

Go library to communicate with a E3DC system implementing the RSCP (Remote Storage Control Protocol)
https://github.com/spali/go-rscp
MIT License
27 stars 9 forks source link

Set BAT_INDEX as `uint16` in example code #64

Closed der-eismann closed 1 month ago

der-eismann commented 1 month ago

This just cost me around 30 minutes because I couldn't figure out why the example code wasn't working, I always got this:

ERRO[0000] message at index 0: expected *uint16 got int : value does not match data type

And then even when I tried to pass a *uint16 as requested, I got

ERRO[0000] message at index 0: expected *uint16 got *uint16 : value does not match data type

so maybe the error message could use some improvements as well.

But most important is to set the value as uint16 and the example will work.

codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 47.83%. Comparing base (5494bd8) to head (dbfc5e8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #64 +/- ## ======================================= Coverage 47.83% 47.83% ======================================= Files 28 28 Lines 1315 1315 ======================================= Hits 629 629 Misses 652 652 Partials 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

spali commented 1 month ago

Thanks for your contribution, I know, the errors are very generic... but thats because the code is very generic and I didn't had the time to implement the proper error handling in a more user friendly way.

der-eismann commented 1 month ago

No problem, I'm happy that there's actually a usable library! Thanks for creating and sharing it :slightly_smiling_face: