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

Fix Parser for ModuleIdentificationRequest of s7 Protocol #423

Merged
merged 5 commits into from
Apr 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update modules/siemens/s7.go
Co-authored-by: Phillip Stephens <phillip@cs.stanford.edu>
  • Loading branch information
developStorm and phillip-stephens authored Apr 17, 2024
commit 42946b8790af97e7ce95bc6389dde1d3771128cc
8 changes: 4 additions & 4 deletions modules/siemens/s7.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ func parseModuleIdentificationRequest(logStruct *S7Log, s7Packet *S7Packet) erro
return fmt.Errorf("failed parsing data record %d: %v", i, err)
}

switch {
case record.Index == S7_MODULE_ID_MODULE_INDEX:
switch record.Index {
case S7_MODULE_ID_MODULE_INDEX:
logStruct.ModuleId = record.MIFB
case record.Index == S7_MODULE_ID_HARDWARE_INDEX:
case S7_MODULE_ID_HARDWARE_INDEX:
logStruct.Hardware = getVersionNumber(record)
case record.Index == S7_MODULE_ID_FIRMWARE_INDEX:
case S7_MODULE_ID_FIRMWARE_INDEX:
logStruct.Firmware = getVersionNumber(record)
}

Expand Down
Loading