Ocpp: align meterUpdated variable naming (#3937)
This commit is contained in:
parent
4ed65cc3d0
commit
747181e00b
3 changed files with 12 additions and 12 deletions
|
|
@ -60,11 +60,11 @@ type CP struct {
|
|||
boot *core.BootNotificationRequest
|
||||
status *core.StatusNotificationRequest
|
||||
|
||||
meterSupported bool
|
||||
measureDoneCh chan struct{}
|
||||
latestMeterValueTimestamp time.Time
|
||||
measureands map[string]types.SampledValue
|
||||
meterTrickerRunning bool
|
||||
meterSupported bool
|
||||
meterUpdated time.Time
|
||||
measureDoneCh chan struct{}
|
||||
measureands map[string]types.SampledValue
|
||||
meterTrickerRunning bool
|
||||
|
||||
supportedNumberOfConnectors int
|
||||
smartChargingCapabilities smartChargingProfile
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ func getSampleKey(s types.SampledValue) string {
|
|||
func (cp *CP) setMeterValues(request *core.MeterValuesRequest) {
|
||||
for _, meterValue := range request.MeterValue {
|
||||
// ignore old meter value requests
|
||||
if meterValue.Timestamp.Time.After(cp.latestMeterValueTimestamp) {
|
||||
if meterValue.Timestamp.Time.After(cp.meterUpdated) {
|
||||
for _, sample := range meterValue.SampledValue {
|
||||
cp.measureands[getSampleKey(sample)] = sample
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ type CS struct {
|
|||
|
||||
func (cs *CS) Register(id string, meterSupported bool) *CP {
|
||||
cp := &CP{
|
||||
id: id,
|
||||
log: util.NewLogger("ocpp-cp"),
|
||||
latestMeterValueTimestamp: time.Now(),
|
||||
measureands: make(map[string]types.SampledValue),
|
||||
meterSupported: meterSupported,
|
||||
id: id,
|
||||
log: util.NewLogger("ocpp-cp"),
|
||||
meterUpdated: time.Now(),
|
||||
measureands: make(map[string]types.SampledValue),
|
||||
meterSupported: meterSupported,
|
||||
}
|
||||
|
||||
cp.initialized = sync.NewCond(&cp.mu)
|
||||
|
|
@ -58,7 +58,7 @@ func (cs *CS) NewChargePoint(chargePoint ocpp16.ChargePointConnection) {
|
|||
if _, err := cs.chargepointByID(chargePoint.ID()); err != nil {
|
||||
cs.log.WARN.Println(err)
|
||||
|
||||
cs.log.INFO.Printf("new chargepoint with ID (%s) detected, atempting to remap", chargePoint.ID())
|
||||
cs.log.INFO.Printf("new chargepoint with ID (%s) detected, attempting to remap", chargePoint.ID())
|
||||
if unknownIDCP, ok := cs.cps[""]; ok && unknownIDCP != nil {
|
||||
cs.mu.Lock()
|
||||
unknownIDCP.id = chargePoint.ID()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue