Documentation ¶
Overview ¶
The diagnostics functional block contains OCPP 2.0 features than enable remote diagnostics of problems with a charging station.
Index ¶
- Constants
- Variables
- type CSMSHandler
- type ChargingStationHandler
- type ClearMonitoringResult
- type ClearMonitoringStatus
- type ClearVariableMonitoringFeature
- type ClearVariableMonitoringRequest
- type ClearVariableMonitoringResponse
- type CustomerInformationFeature
- type CustomerInformationRequest
- type CustomerInformationResponse
- type CustomerInformationStatus
- type GetLogFeature
- type GetLogRequest
- type GetLogResponse
- type GetMonitoringReportFeature
- type GetMonitoringReportRequest
- type GetMonitoringReportResponse
- type LogParameters
- type LogStatus
- type LogType
- type MonitoringCriteriaType
Constants ¶
const ( LogTypeDiagnostics LogType = "DiagnosticsLog" // This contains the field definition of a diagnostics log file LogTypeSecurity LogType = "SecurityLog" // Sent by the CSMS to the Charging Station to request that the Charging Station uploads the security log LogStatusAccepted LogStatus = "Accepted" // Accepted this log upload. This does not mean the log file is uploaded is successfully, the Charging Station will now start the log file upload. LogStatusRejected LogStatus = "Rejected" // Log update request rejected. LogStatusAcceptedCanceled LogStatus = "AcceptedCanceled" // Accepted this log upload, but in doing this has canceled an ongoing log file upload. )
const ClearVariableMonitoringFeatureName = "ClearVariableMonitoring"
const CustomerInformationFeatureName = "CustomerInformation"
const GetLogFeatureName = "GetLog"
const GetMonitoringReportFeatureName = "GetMonitoringReport"
const ProfileName = "diagnostics"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, ClearVariableMonitoringFeature{}, CustomerInformationFeature{}, GetLogFeature{}, GetMonitoringReportFeature{}, )
Functions ¶
This section is empty.
Types ¶
type CSMSHandler ¶
type CSMSHandler interface { }
Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Diagnostics profile.
type ChargingStationHandler ¶
type ChargingStationHandler interface { // OnClearVariableMonitoring is called on a charging station whenever a ClearVariableMonitoringRequest is received from the CSMS. OnClearVariableMonitoring(request *ClearVariableMonitoringRequest) (confirmation *ClearVariableMonitoringResponse, err error) // OnCustomerInformation is called on a charging station whenever a CustomerInformationRequest is received from the CSMS. OnCustomerInformation(request *CustomerInformationRequest) (confirmation *CustomerInformationResponse, err error) // OnGetLog is called on a charging station whenever a GetLogRequest is received from the CSMS. OnGetLog(request *GetLogRequest) (confirmation *GetLogResponse, err error) // OnGetMonitoringReport is called on a charging station whenever a GetMonitoringReportRequest is received from the CSMS. OnGetMonitoringReport(request *GetMonitoringReportRequest) (confirmation *GetMonitoringReportResponse, err error) }
Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Diagnostics profile.
type ClearMonitoringResult ¶
type ClearMonitoringResult struct { ID int `json:"id" validate:"required,gte=0"` Status ClearMonitoringStatus `json:"status" validate:"required,clearMonitoringStatus"` }
type ClearMonitoringStatus ¶
type ClearMonitoringStatus string
Status contained inside a ClearMonitoringResult struct.
const ( ClearMonitoringStatusAccepted ClearMonitoringStatus = "Accepted" ClearMonitoringStatusRejected ClearMonitoringStatus = "Rejected" ClearMonitoringStatusNotFound ClearMonitoringStatus = "NotFound" )
type ClearVariableMonitoringFeature ¶
type ClearVariableMonitoringFeature struct{}
The CSMS asks the Charging Station to clear a display message that has been configured in the Charging Station to be cleared/removed. The Charging station checks for a message with the requested ID and removes it. The Charging station then responds with a ClearVariableMonitoringResponse. The response payload indicates whether the Charging Station was able to remove the message from display or not.
func (ClearVariableMonitoringFeature) GetFeatureName ¶
func (f ClearVariableMonitoringFeature) GetFeatureName() string
func (ClearVariableMonitoringFeature) GetRequestType ¶
func (f ClearVariableMonitoringFeature) GetRequestType() reflect.Type
func (ClearVariableMonitoringFeature) GetResponseType ¶
func (f ClearVariableMonitoringFeature) GetResponseType() reflect.Type
type ClearVariableMonitoringRequest ¶
type ClearVariableMonitoringRequest struct {
ID []int `json:"id" validate:"required,min=1,dive,gte=0"` // List of the monitors to be cleared, identified by their Id.
}
The field definition of the ClearVariableMonitoring request payload sent by the CSMS to the Charging Station.
func NewClearVariableMonitoringRequest ¶
func NewClearVariableMonitoringRequest(id []int) *ClearVariableMonitoringRequest
Creates a new ClearVariableMonitoringRequest, containing all required fields. There are no optional fields for this message.
func (ClearVariableMonitoringRequest) GetFeatureName ¶
func (r ClearVariableMonitoringRequest) GetFeatureName() string
type ClearVariableMonitoringResponse ¶
type ClearVariableMonitoringResponse struct {
ClearMonitoringResult []ClearMonitoringResult `json:"clearMonitoringResult" validate:"required,min=1,dive"` // List of result statuses per monitor.
}
This field definition of the ClearVariableMonitoring response payload, sent by the Charging Station to the CSMS in response to a ClearVariableMonitoringRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewClearVariableMonitoringResponse ¶
func NewClearVariableMonitoringResponse(result []ClearMonitoringResult) *ClearVariableMonitoringResponse
Creates a new ClearVariableMonitoringResponse, containing all required fields. There are no optional fields for this message.
func (ClearVariableMonitoringResponse) GetFeatureName ¶
func (c ClearVariableMonitoringResponse) GetFeatureName() string
type CustomerInformationFeature ¶
type CustomerInformationFeature struct{}
CSMS can request a Charging Station to clear its Authorization Cache. The CSMS SHALL send a CustomerInformationRequest payload for clearing the Charging Station’s Authorization Cache. Upon receipt of a CustomerInformationRequest, the Charging Station SHALL respond with a CustomerInformationResponse payload. The response payload SHALL indicate whether the Charging Station was able to clear its Authorization Cache.
func (CustomerInformationFeature) GetFeatureName ¶
func (f CustomerInformationFeature) GetFeatureName() string
func (CustomerInformationFeature) GetRequestType ¶
func (f CustomerInformationFeature) GetRequestType() reflect.Type
func (CustomerInformationFeature) GetResponseType ¶
func (f CustomerInformationFeature) GetResponseType() reflect.Type
type CustomerInformationRequest ¶
type CustomerInformationRequest struct { RequestID int `json:"requestId" validate:"gte=0"` Report bool `json:"report"` Clear bool `json:"clear"` CustomerIdentifier string `json:"customerIdentifier,omitempty" validate:"max=64"` IdToken *types.IdToken `json:"idToken,omitempty" validate:"omitempty,dive"` CustomerCertificate *types.CertificateHashData `json:"customerCertificate,omitempty" validate:"omitempty,dive"` }
The field definition of the CustomerInformation request payload sent by the CSMS to the Charging Station.
func NewCustomerInformationRequest ¶
func NewCustomerInformationRequest(requestId int, report bool, clear bool) *CustomerInformationRequest
Creates a new CustomerInformationRequest, containing all required fields. Additional optional fields may be set afterwards.
func (CustomerInformationRequest) GetFeatureName ¶
func (r CustomerInformationRequest) GetFeatureName() string
type CustomerInformationResponse ¶
type CustomerInformationResponse struct {
Status CustomerInformationStatus `json:"status" validate:"required,customerInformationStatus"`
}
This field definition of the CustomerInformation response payload, sent by the Charging Station to the CSMS in response to a CustomerInformationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewCustomerInformationResponse ¶
func NewCustomerInformationResponse(status CustomerInformationStatus) *CustomerInformationResponse
Creates a new CustomerInformationResponse, containing all required fields. There are no optional fields for this message.
func (CustomerInformationResponse) GetFeatureName ¶
func (c CustomerInformationResponse) GetFeatureName() string
type CustomerInformationStatus ¶
type CustomerInformationStatus string
Status returned in response to CustomerInformationRequest.
const ( CustomerInformationStatusAccepted CustomerInformationStatus = "Accepted" CustomerInformationStatusRejected CustomerInformationStatus = "Rejected" CustomerInformationStatusInvalid CustomerInformationStatus = "Invalid" )
type GetLogFeature ¶
type GetLogFeature struct{}
The CSO may trigger the CSMS to request a report from a Charging Station. The CSMS shall then request a Charging Station to send a predefined report as defined in ReportBase. The Charging Station responds with GetLogResponse. The result will be returned asynchronously in one or more NotifyReportRequest messages (one for each report part).
func (GetLogFeature) GetFeatureName ¶
func (f GetLogFeature) GetFeatureName() string
func (GetLogFeature) GetRequestType ¶
func (f GetLogFeature) GetRequestType() reflect.Type
func (GetLogFeature) GetResponseType ¶
func (f GetLogFeature) GetResponseType() reflect.Type
type GetLogRequest ¶
type GetLogRequest struct { LogType LogType `json:"logType" validate:"required,logType"` RequestID int `json:"requestId" validate:"gte=0"` Retries *int `json:"retries,omitempty" validate:"omitempty,gte=0"` RetryInterval *int `json:"retryInterval,omitempty" validate:"omitempty,gte=0"` Log LogParameters `json:"log" validate:"required"` }
The field definition of the GetLog request payload sent by the CSMS to the Charging Station.
func NewGetLogRequest ¶
func NewGetLogRequest(logType LogType, requestID int, logParameters LogParameters) *GetLogRequest
Creates a new GetLogRequest, containing all required fields. Optional fields may be set afterwards.
func (GetLogRequest) GetFeatureName ¶
func (r GetLogRequest) GetFeatureName() string
type GetLogResponse ¶
type GetLogResponse struct { Status LogStatus `json:"status" validate:"required,logStatus"` // This field indicates whether the Charging Station was able to accept the request. Filename string `json:"filename,omitempty" validate:"omitempty,max=256"` // This contains the name of the log file that will be uploaded. This field is not present when no logging information is available. }
This field definition of the GetLog response payload, sent by the Charging Station to the CSMS in response to a GetLogRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewGetLogResponse ¶
func NewGetLogResponse(status LogStatus) *GetLogResponse
Creates a new GetLogResponse, containing all required fields. Optional fields may be set afterwards.
func (GetLogResponse) GetFeatureName ¶
func (c GetLogResponse) GetFeatureName() string
type GetMonitoringReportFeature ¶
type GetMonitoringReportFeature struct{}
A CSMS can request the Charging Station to send a report about configured monitoring settings per component and variable. Optionally, this list can be filtered on monitoringCriteria and componentVariables. The CSMS sends a GetMonitoringReportRequest to the Charging Station. The Charging Station then responds with a GetMonitoringReportResponse. Asynchronously, the Charging Station will then send a NotifyMonitoringReportRequest to the CSMS for each report part.
func (GetMonitoringReportFeature) GetFeatureName ¶
func (f GetMonitoringReportFeature) GetFeatureName() string
func (GetMonitoringReportFeature) GetRequestType ¶
func (f GetMonitoringReportFeature) GetRequestType() reflect.Type
func (GetMonitoringReportFeature) GetResponseType ¶
func (f GetMonitoringReportFeature) GetResponseType() reflect.Type
type GetMonitoringReportRequest ¶
type GetMonitoringReportRequest struct { RequestID *int `json:"requestId,omitempty" validate:"omitempty,gte=0"` // The Id of the request. MonitoringCriteria []MonitoringCriteriaType `json:"monitoringCriteria,omitempty" validate:"omitempty,max=3,dive,monitoringCriteria"` // This field contains criteria for components for which a monitoring report is requested. ComponentVariable []types.ComponentVariable `json:"componentVariable,omitempty" validate:"omitempty,dive"` // This field specifies the components and variables for which a monitoring report is requested. }
The field definition of the GetMonitoringReport request payload sent by the CSMS to the Charging Station.
func NewGetMonitoringReportRequest ¶
func NewGetMonitoringReportRequest() *GetMonitoringReportRequest
Creates a new GetMonitoringReportRequest. All fields are optional and may be set afterwards.
func (GetMonitoringReportRequest) GetFeatureName ¶
func (r GetMonitoringReportRequest) GetFeatureName() string
type GetMonitoringReportResponse ¶
type GetMonitoringReportResponse struct {
Status types.GenericDeviceModelStatus `json:"status" validate:"required,genericDeviceModelStatus"` // This field indicates whether the Charging Station was able to accept the request.
}
This field definition of the GetMonitoringReport response payload, sent by the Charging Station to the CSMS in response to a GetMonitoringReportRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewGetMonitoringReportResponse ¶
func NewGetMonitoringReportResponse(status types.GenericDeviceModelStatus) *GetMonitoringReportResponse
Creates a new GetMonitoringReportResponse, containing all required fields. There are no optional fields for this message.
func (GetMonitoringReportResponse) GetFeatureName ¶
func (c GetMonitoringReportResponse) GetFeatureName() string
type LogParameters ¶
type LogParameters struct { RemoteLocation string `json:"remoteLocation" validate:"required,max=512,url"` OldestTimestamp *types.DateTime `json:"oldestTimestamp,omitempty" validate:"omitempty"` LatestTimestamp *types.DateTime `json:"latestTimestamp,omitempty" validate:"omitempty"` }
LogParameters specifies the requested log and the location to which the log should be sent. It is used in GetLogRequest.
type LogStatus ¶
type LogStatus string
LogStatus represents the status returned by a Charging Station in a GetLogResponse.
type LogType ¶
type LogType string
LogType represents the type of log file that the Charging Station should send. It is used in GetLogRequest.
type MonitoringCriteriaType ¶
type MonitoringCriteriaType string
Monitoring criteria contained in GetMonitoringReportRequest.
const ( MonitoringCriteriaThresholdMonitoring MonitoringCriteriaType = "ThresholdMonitoring" MonitoringCriteriaDeltaMonitoring MonitoringCriteriaType = "DeltaMonitoring" MonitoringCriteriaPeriodicMonitoring MonitoringCriteriaType = "PeriodicMonitoring" )