Skip to content

Commit

Permalink
Ocpp: don't hijack empty transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 30, 2024
1 parent 4de3259 commit 0417d78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion charger/ocpp/connector_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func (conn *Connector) OnMeterValues(request *core.MeterValuesRequest) (*core.Me
conn.mu.Lock()
defer conn.mu.Unlock()

if request.TransactionId != nil && conn.txnId == 0 && conn.status != nil &&
if request.TransactionId != nil && *request.TransactionId > 0 &&
conn.txnId == 0 && conn.status != nil &&
(conn.status.Status == core.ChargePointStatusCharging ||
conn.status.Status == core.ChargePointStatusSuspendedEV ||
conn.status.Status == core.ChargePointStatusSuspendedEVSE) {
Expand Down

0 comments on commit 0417d78

Please sign in to comment.