Skip to content

Commit

Permalink
feat(plc4go): upgrade to golang 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Mar 21, 2023
1 parent cabc35d commit e3030a4
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
</execution>
</executions>
<configuration>
<goVersion>1.16</goVersion>
<goVersion>1.19</goVersion>
<packages>
<!-- We want to format every package here so we don't get dirty commits -->
<package>./internal/...</package>
Expand Down
4 changes: 2 additions & 2 deletions plc4go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

module github.com/apache/plc4x/plc4go

go 1.18
go 1.19

require (
github.com/IBM/netaddr v1.5.0
Expand All @@ -42,6 +42,7 @@ require (
github.com/subchen/go-xmldom v1.1.2
github.com/viney-shih/go-lock v1.1.2
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
golang.org/x/sync v0.1.0
golang.org/x/tools v0.7.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down Expand Up @@ -69,7 +70,6 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
Expand Down
12 changes: 8 additions & 4 deletions plc4go/internal/bacnetip/ApplicationModule.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ func (d *DeviceInfoCache) GetDeviceInfo(key DeviceInfoCacheKey) (DeviceInfo, boo
}

// UpdateDeviceInfo The application has updated one or more fields in the device information record and the cache needs
// to be updated to reflect the changes. If this is a cached version of a persistent record then this is the
// opportunity to update the database.
//
// to be updated to reflect the changes. If this is a cached version of a persistent record then this is the
// opportunity to update the database.
func (d *DeviceInfoCache) UpdateDeviceInfo(deviceInfo DeviceInfo) {
log.Debug().Msgf("UpdateDeviceInfo %#v", deviceInfo)

Expand Down Expand Up @@ -171,7 +172,8 @@ func (d *DeviceInfoCache) UpdateDeviceInfo(deviceInfo DeviceInfo) {
}

// Acquire Return the known information about the device and mark the record as being used by a segmentation state
// machine.
//
// machine.
func (d *DeviceInfoCache) Acquire(key DeviceInfoCacheKey) (DeviceInfo, bool) {
log.Debug().Msgf("Acquire %#v", key)

Expand Down Expand Up @@ -347,7 +349,9 @@ func (a *Application) IterObjects() []*LocalDeviceObject {
}

// GetServicesSupported returns a ServicesSupported bit string based in introspection, look for helper methods that
// match confirmed and unconfirmed services.
//
// match confirmed and unconfirmed services.
//
// TODO: match that with readWriteModel.BACnetServicesSupported
func (a *Application) GetServicesSupported() []string {
servicesSupported := make([]string, 0, len(a.helpers))
Expand Down
4 changes: 2 additions & 2 deletions plc4go/internal/bacnetip/BACnetVirtualLinkLayerService.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ func (b *BIPForeign) Confirmation(pdu _PDU) error {

// register starts the foreign device registration process with the given BBMD.
//
// Registration will be renewed periodically according to the ttl value
// until explicitly stopped by a call to `unregister`.
// Registration will be renewed periodically according to the ttl value
// until explicitly stopped by a call to `unregister`.
func (b *BIPForeign) register(addr Address, ttl int) error {
// a little error checking
if ttl <= 0 {
Expand Down
13 changes: 8 additions & 5 deletions plc4go/internal/bacnetip/IOCBModule.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ func (i *IOCB) Trigger() {
}

// Complete Called to complete a transaction, usually when ProcessIO has shipped the IOCB off to some other thread or
// function.
//
// function.
func (i *IOCB) Complete(apdu _PDU) error {
log.Debug().Msgf("Complete(%d)\n%s", i.ioID, apdu)

Expand Down Expand Up @@ -346,7 +347,8 @@ func NewIOQueue(name string) *IOQueue {
}

// Put an IOCB to a queue. This is usually called by the function that filters requests and passes them out to the
// correct processing thread.
//
// correct processing thread.
func (i *IOQueue) Put(iocb _IOCB) error {
log.Debug().Msgf("Put %s", iocb)

Expand Down Expand Up @@ -408,7 +410,8 @@ func (i *IOQueue) Get(block bool, delay *time.Duration) (_IOCB, error) {
}

// Remove a control block from the queue, called if the request
// is canceled/aborted
//
// is canceled/aborted
func (i *IOQueue) Remove(iocb _IOCB) error {
for _, item := range i.queue {
if iocb == item.value {
Expand All @@ -423,7 +426,7 @@ func (i *IOQueue) Remove(iocb _IOCB) error {
return nil
}

//Abort all the control blocks in the queue
// Abort all the control blocks in the queue
func (i *IOQueue) Abort(err error) {
for _, item := range i.queue {
item.value.clearQueue()
Expand Down Expand Up @@ -657,7 +660,7 @@ func (i *IOQController) ProcessIO(_IOCB) error {
panic("IOController must implement ProcessIO()")
}

//ActiveIO Called by a handler to notify the controller that a request is being processed
// ActiveIO Called by a handler to notify the controller that a request is being processed
func (i *IOQController) ActiveIO(iocb _IOCB) error {
log.Debug().Msgf("ActiveIO %v", iocb)

Expand Down
25 changes: 13 additions & 12 deletions plc4go/internal/bacnetip/NetworkService.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,23 @@ func NewNetworkServiceAccessPoint(routerInfoCache *RouterInfoCache, sapID *int,
return n, nil
}

/* bind creates a network adapter object and bind.
/*
bind creates a network adapter object and bind.
bind(s, None, None)
Called for simple applications, local network unknown, no specific
address, APDUs sent upstream
bind(s, None, None)
Called for simple applications, local network unknown, no specific
address, APDUs sent upstream
bind(s, net, None)
Called for routers, bind to the network, (optionally?) drop APDUs
bind(s, net, None)
Called for routers, bind to the network, (optionally?) drop APDUs
bind(s, None, address)
Called for applications or routers, bind to the network (to be
discovered), send up APDUs with a metching address
bind(s, None, address)
Called for applications or routers, bind to the network (to be
discovered), send up APDUs with a metching address
bind(s, net, address)
Called for applications or routers, bind to the network, send up
APDUs with a metching address.
bind(s, net, address)
Called for applications or routers, bind to the network, send up
APDUs with a metching address.
*/
func (n *NetworkServiceAccessPoint) bind(server _Server, net *uint16, address *Address) error {
log.Debug().Msgf("bind %v net=%v address=%v", server, net, address)
Expand Down
1 change: 1 addition & 0 deletions plc4go/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
</packages>
<sources>${project.basedir}</sources>
<verbose>true</verbose>
<goVersion>1.19</goVersion>
</configuration>
</plugin>

Expand Down
48 changes: 40 additions & 8 deletions plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go

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

26 changes: 21 additions & 5 deletions plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go

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

Loading

0 comments on commit e3030a4

Please sign in to comment.