-
Notifications
You must be signed in to change notification settings - Fork 1
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
Decode of the Toggle command doesn't look right #2
Comments
You found a bug alright. Thank you. I order to make the decode function, I copied & pasted the generate function and reverse engineered it. I never quite fixed that |
I also never made a way to distinguish between |
Actually, now that I look back at the UPB PDF, toggle cannot accept a |
BTW, you can test it with |
Nice, thank you! Btw, do you have a link to that UPB PDF? |
At the bottom of the README there is a link called "Tech Specs." That has the UPB protocol PDF, the PIM PDF, and the command wizard. Also, when you are done with the C# implementation and if decide the to open source it, it would be nice if you could drop a link to it here. I would like to watch it, as your bugs and UPB protocol inconsistencies (like the one you brought up) could apply to my code too. Also note that your work will be a derivative of mine. I am using the Apache license, which has a few minor rules about attribution and changes. See the redistribution section from here: http://www.apache.org/licenses/LICENSE-2.0 Good luck! It's nice to know that someone is using my work.
|
Ah, thanks.. That's fine, but I haven't copied your code, I was just looking at it to learn how you interpreted different parts of the protocol (like the variable toggle parameters). I guess I misspoke about "porting it", I meant I'm writing a C# port for the UPB protocol. |
FYI here's my implementation of the UPB protocol in C#: https://github.com/iostorm/iostorm/blob/master/CorePlugins/UpbPim.cs |
Cool! You should remove line 95. That was the error uncovered in this issue. Level cannot be used with the toggle command. |
Thanks for the feedback, I left that part as-is in my code because I wanted to see if I had misinterpreted the specification compared to your implementation. A recommendation on your code, you have byte1-4 and then "fullbytes". The byte 1-4 are actually "half bytes", called nibbles. You may want to update your code to make it more clear. I also recommend bit-wise operations instead of the large if-statements in your decode function, makes for more robust code. |
I checked the decode function and it seems that it will put both Level and ToggleCount from the same part of the string, and also the check for ToggleRate seems wrong. I don't have a way to actually test it, but I was create a C# implementation of the UPB spec, and it looked inconsistent.
The text was updated successfully, but these errors were encountered: