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 882b2e1e3649dba95c6679e9e409607209fa5c26
3 changes: 2 additions & 1 deletion modules/siemens/s7.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ func parseModuleIDDataRecord(data []byte) (*moduleIDData, error) {

// Constructs the version number from a moduleIDData record.
func getVersionNumber(record *moduleIDData) string {
return fmt.Sprintf("V%d.%d", record.Ausbg1&0xFF, record.Ausbg2)
lastByteAusbg1 := record.Ausbg1 & 0xFF
return fmt.Sprintf("V%d.%d", lastByteAusbg1, record.Ausbg2)
}

func parseModuleIdentificationRequest(logStruct *S7Log, s7Packet *S7Packet) error {
Expand Down
Loading