Skip to content

Commit

Permalink
add required field on GetInstalledCertificateIdsRequest constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dwibudut authored and lorenzodonini committed Sep 22, 2024
1 parent 6a6b9be commit a452e79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ocpp1.6/central_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ func (cs *centralSystem) SignedUpdateFirmware(clientId string, callback func(*se
return cs.SendRequestAsync(clientId, request, genericCallback)
}

func (cs *centralSystem) GetInstalledCertificateIds(clientId string, callback func(*certificates.GetInstalledCertificateIdsResponse, error), props ...func(request *certificates.GetInstalledCertificateIdsRequest)) error {
request := certificates.NewGetInstalledCertificateIdsRequest()
func (cs *centralSystem) GetInstalledCertificateIds(clientId string, callback func(*certificates.GetInstalledCertificateIdsResponse, error), certificateType types.CertificateUse, props ...func(request *certificates.GetInstalledCertificateIdsRequest)) error {
request := certificates.NewGetInstalledCertificateIdsRequest(certificateType)
for _, fn := range props {
fn(request)
}
Expand Down
4 changes: 2 additions & 2 deletions ocpp1.6/certificates/get_installed_certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func (c GetInstalledCertificateIdsResponse) GetFeatureName() string {
}

// Creates a new GetInstalledCertificateIdsRequest, containing all required fields. There are no optional fields for this message.
func NewGetInstalledCertificateIdsRequest() *GetInstalledCertificateIdsRequest {
return &GetInstalledCertificateIdsRequest{}
func NewGetInstalledCertificateIdsRequest(certificateType types.CertificateUse) *GetInstalledCertificateIdsRequest {
return &GetInstalledCertificateIdsRequest{CertificateType: certificateType}
}

// Creates a new NewGetInstalledCertificateIdsResponse, containing all required fields. Additional optional fields may be set afterwards.
Expand Down
3 changes: 2 additions & 1 deletion ocpp1.6/v16.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,14 @@ type CentralSystem interface {
ClearChargingProfile(clientId string, callback func(*smartcharging.ClearChargingProfileConfirmation, error), props ...func(request *smartcharging.ClearChargingProfileRequest)) error
// Queries a charge point to the composite smart charging schedules and rules for a specified time interval.
GetCompositeSchedule(clientId string, callback func(*smartcharging.GetCompositeScheduleConfirmation, error), connectorId int, duration int, props ...func(request *smartcharging.GetCompositeScheduleRequest)) error

TriggerMessageExtended(clientId string, callback func(*extendedtriggermessage.ExtendedTriggerMessageResponse, error), requestedMessage extendedtriggermessage.ExtendedTriggerMessageType, props ...func(request *extendedtriggermessage.ExtendedTriggerMessageRequest)) error

CertificateSigned(clientId string, callback func(*security.CertificateSignedResponse, error), csr string, props ...func(request *security.CertificateSignedRequest)) error

InstallCertificate(clientId string, callback func(*certificates.InstallCertificateResponse, error), certificateType types.CertificateUse, certificate string, props ...func(request *certificates.InstallCertificateRequest)) error

GetInstalledCertificateIds(clientId string, callback func(*certificates.GetInstalledCertificateIdsResponse, error), props ...func(request *certificates.GetInstalledCertificateIdsRequest)) error
GetInstalledCertificateIds(clientId string, callback func(*certificates.GetInstalledCertificateIdsResponse, error), certificateType types.CertificateUse, props ...func(request *certificates.GetInstalledCertificateIdsRequest)) error

DeleteCertificate(clientId string, callback func(*certificates.DeleteCertificateResponse, error), certificateHashData types.CertificateHashData, props ...func(request *certificates.DeleteCertificateRequest)) error

Expand Down
1 change: 1 addition & 0 deletions ocppj/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func (s *Server) SendError(clientID string, requestId string, errorCode ocpp.Err
return ocpp.NewError(GenericError, err.Error(), requestId)
}
log.Debugf("sent CALL ERROR [%s] for %s", callError.UniqueId, clientID)
log.Debugf("sent JSON message to %s: %s", clientID, string(jsonMessage))
return nil
}

Expand Down

0 comments on commit a452e79

Please sign in to comment.