securefirmware

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

The diagnostics functional block contains OCPP 2.0 features than enable remote diagnostics of problems with a charging station.

Index

Constants

View Source
const ProfileName = "SecureFirmwareUpdate"
View Source
const SignedFirmwareStatusNotificationFeatureName = "SignedFirmwareStatusNotification"
View Source
const SignedUpdateFirmwareFeatureName = "SignedUpdateFirmware"

Variables

Functions

This section is empty.

Types

type CentralSystemHandler

type CentralSystemHandler interface {
	OnSignedFirmwareStatusNotification(chargingStationID string, request *SignedFirmwareStatusNotificationRequest) (response *SignedFirmwareStatusNotificationResponse, err error)
}

type ChargePointHandler

type ChargePointHandler interface {
	OnSignedUpdateFirmware(request *SignedUpdateFirmwareRequest) (response *SignedUpdateFirmwareResponse, err error)
}

Needs to be implemented by Charging stations for handling messages part of the OCPP 1.6j security extension.

type Firmware

type Firmware struct {
	Location           string          `json:"location" validate:"required,max=512,uri"`         // URI defining the origin of the firmware.
	RetrieveDateTime   *types.DateTime `json:"retrieveDateTime" validate:"required"`             // Date and time at which the firmware shall be retrieved.
	InstallDateTime    *types.DateTime `json:"installDateTime,omitempty" validate:"omitempty"`   // Date and time at which the firmware shall be installed.
	SigningCertificate string          `json:"signingCertificate,omitempty" validate:"max=5500"` // Certificate with which the firmware was signed. PEM encoded X.509 certificate.
	Signature          string          `json:"signature,omitempty" validate:"max=800"`           // Base64 encoded firmware signature.
}

Represents a copy of the firmware that can be loaded/updated on the Charging Station.

type FirmwareStatus

type FirmwareStatus string

Status reported in SignedFirmwareStatusNotificationRequest.

const (
	FirmwareStatusDownloaded                FirmwareStatus = "Downloaded"
	FirmwareStatusDownloadFailed            FirmwareStatus = "DownloadFailed"
	FirmwareStatusDownloading               FirmwareStatus = "Downloading"
	FirmwareStatusDownloadScheduled         FirmwareStatus = "DownloadScheduled"
	FirmwareStatusDownloadPaused            FirmwareStatus = "DownloadPaused"
	FirmwareStatusIdle                      FirmwareStatus = "Idle"
	FirmwareStatusInstallationFailed        FirmwareStatus = "InstallationFailed"
	FirmwareStatusInstalling                FirmwareStatus = "Installing"
	FirmwareStatusInstalled                 FirmwareStatus = "Installed"
	FirmwareStatusInstallRebooting          FirmwareStatus = "InstallRebooting"
	FirmwareStatusInstallScheduled          FirmwareStatus = "InstallScheduled"
	FirmwareStatusInstallVerificationFailed FirmwareStatus = "InstallVerificationFailed"
	FirmwareStatusInvalidSignature          FirmwareStatus = "InvalidSignature"
	FirmwareStatusSignatureVerified         FirmwareStatus = "SignatureVerified"
)

type SignedFirmwareStatusNotificationFeature

type SignedFirmwareStatusNotificationFeature struct{}

The Charging Station sends a notification to inform the CSMS about the progress of the downloading and installation of a firmware update. The Charging Station SHALL only send the status Idle after receipt of a TriggerMessage for a Firmware Status Notification, when it is not busy downloading/installing firmware. The FirmwareStatusNotification requests SHALL be sent to keep the CSMS updated with the status of the update process.

func (SignedFirmwareStatusNotificationFeature) GetFeatureName

func (SignedFirmwareStatusNotificationFeature) GetRequestType

func (SignedFirmwareStatusNotificationFeature) GetResponseType

type SignedFirmwareStatusNotificationRequest

type SignedFirmwareStatusNotificationRequest struct {
	Status    FirmwareStatus `json:"status" validate:"required,signedFirmwareStatus"`
	RequestID *int           `json:"requestId,omitempty" validate:"omitempty,gte=0"`
}

The field definition of the FirmwareStatusNotification request payload sent by the Charging Station to the CSMS.

func NewFirmwareStatusNotificationRequest

func NewFirmwareStatusNotificationRequest(status FirmwareStatus) *SignedFirmwareStatusNotificationRequest

Creates a new SignedFirmwareStatusNotificationRequest, containing all required fields. Optional fields may be set afterwards.

func (SignedFirmwareStatusNotificationRequest) GetFeatureName

type SignedFirmwareStatusNotificationResponse

type SignedFirmwareStatusNotificationResponse struct {
}

This field definition of the FirmwareStatusNotification response payload, sent by the CSMS to the Charging Station in response to a SignedFirmwareStatusNotificationRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewFirmwareStatusNotificationResponse

func NewFirmwareStatusNotificationResponse() *SignedFirmwareStatusNotificationResponse

Creates a new SignedFirmwareStatusNotificationResponse, which doesn't contain any required or optional fields.

func (SignedFirmwareStatusNotificationResponse) GetFeatureName

type SignedUpdateFirmwareFeature

type SignedUpdateFirmwareFeature struct{}

func (SignedUpdateFirmwareFeature) GetFeatureName

func (e SignedUpdateFirmwareFeature) GetFeatureName() string

func (SignedUpdateFirmwareFeature) GetRequestType

func (e SignedUpdateFirmwareFeature) GetRequestType() reflect.Type

func (SignedUpdateFirmwareFeature) GetResponseType

func (e SignedUpdateFirmwareFeature) GetResponseType() reflect.Type

type SignedUpdateFirmwareRequest

type SignedUpdateFirmwareRequest struct {
	Retries       *int     `json:"retries,omitempty" validate:"omitempty,gte=0"`       // This specifies how many times Charging Station must try to download the firmware before giving up. If this field is not present, it is left to Charging Station to decide how many times it wants to retry.
	RetryInterval *int     `json:"retryInterval,omitempty" validate:"omitempty,gte=0"` // The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charging Station to decide how long to wait between attempts.
	RequestID     int      `json:"requestId" validate:"gte=0"`                         // The Id of the request.
	Firmware      Firmware `json:"firmware" validate:"required"`                       // Specifies the firmware to be updated on the Charging Station.
}

The field definition of the LogStatusNotification request payload sent by a Charging Station to the CSMS.

func NewSignedUpdateFirmwareRequest

func NewSignedUpdateFirmwareRequest(requestId int, firmware Firmware) *SignedUpdateFirmwareRequest

Creates a new SignedUpdateFirmwareRequest, containing all required fields. There are no optional fields for this message.

func (SignedUpdateFirmwareRequest) GetFeatureName

func (r SignedUpdateFirmwareRequest) GetFeatureName() string

type SignedUpdateFirmwareResponse

type SignedUpdateFirmwareResponse struct {
	Status UpdateFirmwareStatus `json:"status" validate:"required,signedUpdateFirmwareStatus"`
}

This field definition of the LogStatusNotification response payload, sent by the CSMS to the Charging Station in response to a SignedUpdateFirmwareRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.

func NewSignedUpdateFirmwareResponse

func NewSignedUpdateFirmwareResponse(status UpdateFirmwareStatus) *SignedUpdateFirmwareResponse

Creates a new SignedUpdateFirmwareResponse, which doesn't contain any required or optional fields.

func (SignedUpdateFirmwareResponse) GetFeatureName

func (c SignedUpdateFirmwareResponse) GetFeatureName() string

type UpdateFirmwareStatus

type UpdateFirmwareStatus string

Indicates whether the Charging Station was able to accept the request.

const (
	UpdateFirmwareStatusAccepted           UpdateFirmwareStatus = "Accepted"
	UpdateFirmwareStatusRejected           UpdateFirmwareStatus = "Rejected"
	UpdateFirmwareStatusAcceptedCanceled   UpdateFirmwareStatus = "AcceptedCanceled"
	UpdateFirmwareStatusInvalidCertificate UpdateFirmwareStatus = "InvalidCertificate"
	UpdateFirmwareStatusRevokedCertificate UpdateFirmwareStatus = "RevokedCertificate"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL