You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/07/13 11:20:47 UTC
[plc4x] branch develop updated: fix(plc4go/plc4xpcapanalyzer): fixed log option and added parsing for missing types
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new f2c567483 fix(plc4go/plc4xpcapanalyzer): fixed log option and added parsing for missing types
f2c567483 is described below
commit f2c5674837eeac49529586e4f91d938fe1c90e06
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Jul 13 13:20:39 2022 +0200
fix(plc4go/plc4xpcapanalyzer): fixed log option and added parsing for missing types
---
plc4go/tools/plc4xpcapanalyzer/cmd/root.go | 2 +-
.../plc4xpcapanalyzer/internal/cbusanalyzer/analyzer.go | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/plc4go/tools/plc4xpcapanalyzer/cmd/root.go b/plc4go/tools/plc4xpcapanalyzer/cmd/root.go
index dddde4b9b..8486c9903 100644
--- a/plc4go/tools/plc4xpcapanalyzer/cmd/root.go
+++ b/plc4go/tools/plc4xpcapanalyzer/cmd/root.go
@@ -55,7 +55,7 @@ func init() {
rootCmd.PersistentFlags().StringVar(&config.RootConfigInstance.CfgFile, "config", "", "config file (default is $HOME/.plc4xpcapanalyzer.yaml)")
rootCmd.PersistentFlags().StringVar(&config.RootConfigInstance.LogType, "log-type", "text", "define how the log will be evaluated")
- rootCmd.PersistentFlags().StringVar(&config.RootConfigInstance.LogLevel, "log-level", "off", "define the log Level")
+ rootCmd.PersistentFlags().StringVar(&config.RootConfigInstance.LogLevel, "log-level", "error", "define the log Level")
rootCmd.PersistentFlags().CountVarP(&config.RootConfigInstance.Verbosity, "verbose", "v", "counted verbosity")
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
diff --git a/plc4go/tools/plc4xpcapanalyzer/internal/cbusanalyzer/analyzer.go b/plc4go/tools/plc4xpcapanalyzer/internal/cbusanalyzer/analyzer.go
index 3cd8dd9fd..0c7cdc855 100644
--- a/plc4go/tools/plc4xpcapanalyzer/internal/cbusanalyzer/analyzer.go
+++ b/plc4go/tools/plc4xpcapanalyzer/internal/cbusanalyzer/analyzer.go
@@ -146,6 +146,12 @@ func (a *Analyzer) PrettyPrint(message interface{}) {
// TODO: add recursion
case model.ReplyOrConfirmationReplyExactly:
switch reply := reply.GetReply().(type) {
+ case model.ReplyExtendedFormatStatusReplyExactly:
+ // We print this a second time as the first print contains only the hex part
+ fmt.Printf("%v\n", reply.GetReply())
+ case model.ReplyStandardFormatStatusReplyExactly:
+ // We print this a second time as the first print contains only the hex part
+ fmt.Printf("%v\n", reply.GetReply())
case model.ReplyCALReplyExactly:
// We print this a second time as the first print contains only the hex part
fmt.Printf("%v\n", reply.GetCalReply())
@@ -156,6 +162,12 @@ func (a *Analyzer) PrettyPrint(message interface{}) {
}
case model.ReplyOrConfirmationReplyExactly:
switch reply := reply.GetReply().(type) {
+ case model.ReplyExtendedFormatStatusReplyExactly:
+ // We print this a second time as the first print contains only the hex part
+ fmt.Printf("%v\n", reply.GetReply())
+ case model.ReplyStandardFormatStatusReplyExactly:
+ // We print this a second time as the first print contains only the hex part
+ fmt.Printf("%v\n", reply.GetReply())
case model.ReplyCALReplyExactly:
// We print this a second time as the first print contains only the hex part
fmt.Printf("%v\n", reply.GetCalReply())