Skip to content

Commit

Permalink
feat(plc4go/bacnetip): update with improved debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Sep 4, 2024
1 parent 5412078 commit b871bc7
Show file tree
Hide file tree
Showing 114 changed files with 5,950 additions and 419 deletions.
13 changes: 5 additions & 8 deletions plc4go/internal/bacnetip/bacgopes/app_Application.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ApplicationRequirements interface {
ApplicationServiceElementRequirements
}

//go:generate plc4xGenerator -type=Application -prefix=app_
type Application struct {
ApplicationServiceElementContract
Collector
Expand All @@ -41,12 +42,12 @@ type Application struct {
localDevice *LocalDeviceObject
deviceInfoCache *DeviceInfoCache
controllers map[string]any
helpers map[string]func(pdu PDU) error
helpers map[string]func(pdu PDU) error `ignore:"true"`

_startupDisabled bool

// pass through args
argAseID *int
argAseID *int `ignore:"true"`

log zerolog.Logger
}
Expand All @@ -59,8 +60,8 @@ func NewApplication(localLog zerolog.Logger, localDevice *LocalDeviceObject, opt
opt(a)
}
localLog.Debug().
Interface("localDevice", localDevice).
Interface("deviceInfoCache", a.deviceInfoCache).
Stringer("localDevice", localDevice).
Stringer("deviceInfoCache", a.deviceInfoCache).
Interface("aseID", a.argAseID).
Msg("NewApplication")
var err error
Expand Down Expand Up @@ -124,10 +125,6 @@ func (a *Application) GetDeviceInfoCache() *DeviceInfoCache {
return a.deviceInfoCache
}

func (a *Application) String() string {
return fmt.Sprintf("Application(TBD...)") // TODO: fill some info here
}

// AddObject adds an object to the local collection
func (a *Application) AddObject(obj *LocalDeviceObject) error {
a.log.Debug().Stringer("obj", obj).Msg("AddObject")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ import (
readWriteModel "github.com/apache/plc4x/plc4go/protocols/bacnetip/readwrite/model"
)

//go:generate plc4xGenerator -type=ApplicationIOController -prefix=app_
type ApplicationIOController struct {
*IOController
*Application

queueByAddress map[string]*SieveQueue

// pass through args
argDeviceInfoCache *DeviceInfoCache
argAseID *int
argDeviceInfoCache *DeviceInfoCache `ignore:"true"`
argAseID *int `ignore:"true"`

log zerolog.Logger
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

164 changes: 164 additions & 0 deletions plc4go/internal/bacnetip/bacgopes/app_Application_plc4xgen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ type BIPNetworkApplication struct {
mux *UDPMultiplexer

// passThroughArgs
argBBMDAddress *Address
argBBMDTTL *int
argEID *int
argBBMDAddress *Address `ignore:"true"`
argBBMDTTL *int `ignore:"true"`
argEID *int `ignore:"true"`

log zerolog.Logger
}
Expand Down
16 changes: 8 additions & 8 deletions plc4go/internal/bacnetip/bacgopes/app_BIPSimpleApplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ type BIPSimpleApplication struct {
*WhoIsIAmServices
*ReadWritePropertyServices

localAddress Address
asap *ApplicationServiceAccessPoint
smap *StateMachineAccessPoint
nsap *NetworkServiceAccessPoint
nse *NetworkServiceElement
bip *BIPSimple
annexj *AnnexJCodec
mux *UDPMultiplexer
localAddress Address `stringer:"true"`
asap *ApplicationServiceAccessPoint `stringer:"true"`
smap *StateMachineAccessPoint `stringer:"true"`
nsap *NetworkServiceAccessPoint `stringer:"true"`
nse *NetworkServiceElement `stringer:"true"`
bip *BIPSimple `stringer:"true"`
annexj *AnnexJCodec `stringer:"true"`
mux *UDPMultiplexer `stringer:"true"`

log zerolog.Logger
}
Expand Down
Loading

0 comments on commit b871bc7

Please sign in to comment.