Skip to content

Commit

Permalink
Do not send initial requests in EVSOC
Browse files Browse the repository at this point in the history
The requests are currently doubled as EVCEM sends the same and EVSOC requires EVCEM anyway.

Once the SPINE stack can handle non answered pending identical requests, simply comment this code out and add it later again, once SPINE has this ability.
  • Loading branch information
DerAndereAndi committed Aug 27, 2024
1 parent 19e3831 commit 330aad8
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions usecases/cem/evsoc/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package evsoc
import (
"github.com/enbility/eebus-go/features/client"
internal "github.com/enbility/eebus-go/usecases/internal"
"github.com/enbility/ship-go/logging"
spineapi "github.com/enbility/spine-go/api"
"github.com/enbility/spine-go/model"
"github.com/enbility/spine-go/util"
Expand Down Expand Up @@ -38,21 +37,25 @@ func (e *EVSOC) HandleEvent(payload spineapi.EventPayload) {
// an EV was connected
func (e *EVSOC) evConnected(entity spineapi.EntityRemoteInterface) {
// initialise features, e.g. subscriptions, descriptions
if evMeasurement, err := client.NewMeasurement(e.LocalEntity, entity); err == nil {
if _, err := evMeasurement.Subscribe(); err != nil {
logging.Log().Debug(err)
}
// TODO: Don't do these requests for now, only add it once SPINE supports handling filtering identical pending subscription requests
// Also: these are covered by EVCEM anyway, which is required
/*
if evMeasurement, err := client.NewMeasurement(e.LocalEntity, entity); err == nil {
if _, err := evMeasurement.Subscribe(); err != nil {
logging.Log().Debug(err)
}
// get measurement descriptions
if _, err := evMeasurement.RequestDescriptions(nil, nil); err != nil {
logging.Log().Debug(err)
}
// get measurement descriptions
if _, err := evMeasurement.RequestDescriptions(nil, nil); err != nil {
logging.Log().Debug(err)
}
// get measurement constraints
if _, err := evMeasurement.RequestConstraints(nil, nil); err != nil {
logging.Log().Debug(err)
// get measurement constraints
if _, err := evMeasurement.RequestConstraints(nil, nil); err != nil {
logging.Log().Debug(err)
}
}
}
*/
}

// the measurement data of an EV was updated
Expand Down

0 comments on commit 330aad8

Please sign in to comment.