ocpp_v16

package
v1.3.1-0...-1f2ccf4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowOfflineTxForUnknownId        = Key("AllowOfflineTxForUnknownId")
	AuthorizationCacheEnabled         = Key("AuthorizationCacheEnabled")
	AuthorizeRemoteTxRequests         = Key("AuthorizeRemoteTxRequests")
	BlinkRepeat                       = Key("BlinkRepeat")
	ClockAlignedDataInterval          = Key("ClockAlignedDataInterval")
	ConnectionTimeOut                 = Key("ConnectionTimeOut")
	GetConfigurationMaxKeys           = Key("GetConfigurationMaxKeys")
	HeartbeatInterval                 = Key("HeartbeatInterval")
	LightIntensity                    = Key("LightIntensity")
	LocalAuthorizeOffline             = Key("LocalAuthorizeOffline")
	LocalPreAuthorize                 = Key("LocalPreAuthorize")
	MaxEnergyOnInvalidId              = Key("MaxEnergyOnInvalidId")
	MeterValuesAlignedData            = Key("MeterValuesAlignedData")
	MeterValuesAlignedDataMaxLength   = Key("MeterValuesAlignedDataMaxLength")
	MeterValuesSampledData            = Key("MeterValuesSampledData")
	MeterValuesSampledDataMaxLength   = Key("MeterValuesSampledDataMaxLength")
	MeterValueSampleInterval          = Key("MeterValueSampleInterval")
	MinimumStatusDuration             = Key("MinimumStatusDuration")
	NumberOfConnectors                = Key("NumberOfConnectors")
	ResetRetries                      = Key("ResetRetries")
	ConnectorPhaseRotation            = Key("ConnectorPhaseRotation")
	ConnectorPhaseRotationMaxLength   = Key("ConnectorPhaseRotationMaxLength")
	StopTransactionOnEVSideDisconnect = Key("StopTransactionOnEVSideDisconnect")
	StopTransactionOnInvalidId        = Key("StopTransactionOnInvalidId")
	StopTxnAlignedData                = Key("StopTxnAlignedData")
	StopTxnAlignedDataMaxLength       = Key("StopTxnAlignedDataMaxLength")
	StopTxnSampledData                = Key("StopTxnSampledData")
	StopTxnSampledDataMaxLength       = Key("StopTxnSampledDataMaxLength")
	SupportedFeatureProfiles          = Key("SupportedFeatureProfiles")
	SupportedFeatureProfilesMaxLength = Key("SupportedFeatureProfilesMaxLength")
	TransactionMessageAttempts        = Key("TransactionMessageAttempts")
	TransactionMessageRetryInterval   = Key("TransactionMessageRetryInterval")
	UnlockConnectorOnEVSideDisconnect = Key("UnlockConnectorOnEVSideDisconnect")
	WebSocketPingInterval             = Key("WebSocketPingInterval")

	LocalAuthListEnabled   = Key("LocalAuthListEnabled")
	LocalAuthListMaxLength = Key("LocalAuthListMaxLength")
	SendLocalListMaxLength = Key("SendLocalListMaxLength")

	ReserveConnectorZeroSupported = Key("ReserveConnectorZeroSupported")

	SupportedFileTransferProtocols = Key("SupportedFileTransferProtocols")

	ChargeProfileMaxStackLevel              = Key("ChargeProfileMaxStackLevel")
	ChargingScheduleAllowedChargingRateUnit = Key("ChargingScheduleAllowedChargingRateUnit")
	ChargingScheduleMaxPeriods              = Key("ChargingScheduleMaxPeriods")
	MaxChargingProfilesInstalled            = Key("MaxChargingProfilesInstalled")
	ConnectorSwitch3to1PhaseSupported       = Key("ConnectorSwitch3to1PhaseSupported")

	/* ----------------- ISO15118 keys ----------------------- */
	CentralContractValidationAllowed = Key("CentralContractValidationAllowed")
	CertificateSignedMaxChainSize    = Key("CertificateSignedMaxChainSize")
	CertSigningWaitMinimum           = Key("CertSigningWaitMinimum")
	CertSigningRepeatTimes           = Key("CertSigningRepeatTimes")
	CertificateStoreMaxLength        = Key("CertificateStoreMaxLength")
	ContractValidationOffline        = Key("ContractValidationOffline")
	ISO15118PnCEnabled               = Key("ISO15118PnCEnabled")

	/* ----------------- Security extension keys ----------------------- */
	AuthorizationData              = Key("AuthorizationData")
	AdditionalRootCertificateCheck = Key("AdditionalRootCertificateCheck")
	CpoName                        = Key("CpoName")
	SecurityProfile                = Key("SecurityProfile")
)

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
	ErrReadOnly    = errors.New("attribute is read-only")
)
View Source
var ErrKeyCannotBeEmpty = errors.New("key cannot be empty")

Functions

func DefaultCoreConfiguration

func DefaultCoreConfiguration() []core.ConfigurationKey

func DefaultFirmwareConfiguration

func DefaultFirmwareConfiguration() []core.ConfigurationKey

func DefaultLocalAuthConfiguration

func DefaultLocalAuthConfiguration() []core.ConfigurationKey

func DefaultSmartChargingConfiguration

func DefaultSmartChargingConfiguration() []core.ConfigurationKey

Types

type Config

type Config struct {
	Version int                     `fig:"version" default:"1"`
	Keys    []core.ConfigurationKey `fig:"keys"`
}

func DefaultConfigurationFromProfiles

func DefaultConfigurationFromProfiles(profiles ...string) (*Config, error)

func NewEmptyConfiguration

func NewEmptyConfiguration() Config

func (*Config) GetConfig

func (config *Config) GetConfig() []core.ConfigurationKey

GetConfig Get the configuration

func (*Config) GetConfigurationValue

func (config *Config) GetConfigurationValue(key string) (*string, error)

GetConfigurationValue Get the value of specified configuration variable in String format.

func (*Config) GetVersion

func (config *Config) GetVersion() int

GetVersion Get the current version

func (*Config) SetVersion

func (config *Config) SetVersion(version int)

SetVersion Set the current version

func (*Config) UpdateKey

func (config *Config) UpdateKey(key string, value *string) error

UpdateKey Update the configuration variable in the configuration if it is not readonly.

func (*Config) UpdateKeyReadability

func (config *Config) UpdateKeyReadability(key string, readable bool) error

UpdateKeyReadability updates whether the key is updatable or not.

func (*Config) Validate

func (config *Config) Validate(mandatoryKeys []Key) error

Validate validates the configuration - check if all mandatory keys are present.

type Key

type Key string

func GetMandatoryKeysForProfile

func GetMandatoryKeysForProfile(profiles ...string) []Key

func (Key) String

func (k Key) String() string

type KeyValidator

type KeyValidator func(Key Key, value *string) bool

type Manager

type Manager interface {
	SetMandatoryKeys(mandatoryKeys []Key) error
	GetMandatoryKeys() []Key
	RegisterCustomKeyValidator(KeyValidator)
	ValidateKey(key Key, value *string) error
	UpdateKey(key Key, value *string) error
	OnUpdateKey(key Key, handler OnUpdateHandler) error
	GetConfigurationValue(key Key) (*string, error)
	SetConfiguration(configuration Config) error
	GetConfiguration() ([]core.ConfigurationKey, error)
}

type ManagerV16

type ManagerV16 struct {
	// contains filtered or unexported fields
}

func NewV16ConfigurationManager

func NewV16ConfigurationManager(defaultConfiguration Config, profiles ...string) (*ManagerV16, error)

func (*ManagerV16) GetConfiguration

func (m *ManagerV16) GetConfiguration() ([]core.ConfigurationKey, error)

GetConfiguration returns the full current configuration

func (*ManagerV16) GetConfigurationValue

func (m *ManagerV16) GetConfigurationValue(key Key) (*string, error)

GetConfigurationValue returns the value of a specific key

func (*ManagerV16) GetMandatoryKeys

func (m *ManagerV16) GetMandatoryKeys() []Key

GetMandatoryKeys returns the mandatory keys for the configuration

func (*ManagerV16) OnUpdateKey

func (m *ManagerV16) OnUpdateKey(key Key, handler OnUpdateHandler) error

OnUpdateKey registers a function to call after a specific key has been updated.

func (*ManagerV16) RegisterCustomKeyValidator

func (m *ManagerV16) RegisterCustomKeyValidator(validator KeyValidator)

RegisterCustomKeyValidator registers a custom key validator

func (*ManagerV16) SetConfiguration

func (m *ManagerV16) SetConfiguration(configuration Config) error

SetConfiguration validates the provided and overwrites the current configuration

func (*ManagerV16) SetMandatoryKeys

func (m *ManagerV16) SetMandatoryKeys(mandatoryKeys []Key) error

SetMandatoryKeys sets the mandatory keys for the configuration

func (*ManagerV16) UpdateKey

func (m *ManagerV16) UpdateKey(key Key, value *string) error

UpdateKey updates the value of a specific key

func (*ManagerV16) ValidateKey

func (m *ManagerV16) ValidateKey(key Key, value *string) error

ValidateKey validates a specific key by checking if there is a custom validator registered

type OnUpdateHandler

type OnUpdateHandler func(value *string) error

Jump to

Keyboard shortcuts

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