Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BootNotificationResponse status reject when charging station #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions device-service/ocpphandlers/BootNotificationHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ func BootNotificationHandler(request_json []byte, messageId string, deviceId str
litter.Dump(req)
}

resp_status := BootNotificationResponse.RegistrationStatusEnumType_1_Accepted
station, err_get := db.GetChargingStation(deviceId)
if err_get != nil {
log.Error("Failed to get charging station from db. error: ", err_get)
}

station.LastBoot = time.Now().Format(time.RFC3339)
resp_status = BootNotificationResponse.RegistrationStatusEnumType_1_Rejected
} else {
station.LastBoot = time.Now().Format(time.RFC3339)

err_update := db.UpdateChargingStation(deviceId, station)
if err_update != nil {
log.Error("Failed to update charging station. error: ", err_update)
err_update := db.UpdateChargingStation(deviceId, station)
if err_update != nil {
log.Error("Failed to update charging station. error: ", err_update)
}
}

resp := BootNotificationResponse.BootNotificationResponseJson{
CurrentTime: "",
Interval: 60,
Status: BootNotificationResponse.RegistrationStatusEnumType_1_Accepted,
Status: resp_status,
}

qm := QueuedMessage.QueuedMessage{
Expand Down