-
Notifications
You must be signed in to change notification settings - Fork 70
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
ProcessHeader(string package) - Default revision #7
Comments
As I've seen, even when parsing revision equals to 0, it does change it to rev 1 when parsing the "body" of the package, like in
Can you provide an example of a package that is failing? |
Example package is in my comment it's MID 0015. I forgot to mention it's necessary to replace underscores (_) with spaces. In comment preview extra spaces were removed so I replaced them with underscores. |
I'm fixing it on mid 0015 override. By now, doing this it will help you out with this problem and I will also study the possibility to modify it to every mid. |
Already published on nuget gallery, please update it and close the issue once you check it solved! |
As far as I understand open protocol revision 0 doesn't exist. In this case it's about way to parse received message from controller and message with revision 0 is always necessary to parse based on revision 1 format. |
I found similar issue in MID 0061 (version 3.2.0)
I fixed it by modify Mid0061.CS like this protected override void ProcessDataFields(string package)
{
if (HeaderData.Revision == 0 || HeaderData.Revision == 1 || HeaderData.Revision == 999)
{
int revision = HeaderData.Revision > 0 ? HeaderData.Revision : 1;
ProcessDataFields(RevisionsByFields[revision], package);
}
else
(...) |
Offtopic but I don't want to open new issue for typo in enum file :) |
There are some weird controllers out there, usually the default revision is always 1, but they send empty sometimes. Also, for your code, better use |
About the enum, I'm going to change it. However it's may cause break changes. |
I'm not sure that was probably PF 3000 with controller sw version 10.5 SR4. I think problem was with tightening subscription (MID 0060). I subscribed to tighttening data with revision 0, by mistake :) |
Makes sense! Anyway, better handle it in the lib too. Oh, and you don't need to excuse for that, it was just a clue. Also, don't push yourself too much! |
- Added basic Mode support (MID 2600 - 2606), unfinished some Mids are only placeholders - Multispindle related fixes - Added revision 2 support to MID 0042 (disable tool) and MID 0043 (enable tool)
Please note that the specification says: |
Enhancement made at version 5.0.0, please check release notes: https://github.com/Rickedb/OpenProtocolInterpreter/releases/tag/5.0.0 |
Some messages from some controllers doesn't contains revision, for example MID 0015:
00420015____________0022017-10-03:14:12:30
In this case message parsing fails because MID revision parsed as 0 and DataField doesn't contains data for revision 0.
Possible fix is to change default revision to 1 (Mid.cs:100)
Revision = (package.Length >= 11 && !string.IsNullOrWhiteSpace(package.Substring(8, 3))) ? Convert.ToInt32(package.Substring(8, 3)) : 1,
The text was updated successfully, but these errors were encountered: