v16

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v16 defines the OCPP 1.6 messages plugyard exchanges with a CSMS.

Index

Constants

View Source
const (
	ActionBootNotification   = "BootNotification"
	ActionHeartbeat          = "Heartbeat"
	ActionStatusNotification = "StatusNotification"
)

Actions.

View Source
const (
	RegistrationAccepted = "Accepted"
	RegistrationPending  = "Pending"
	RegistrationRejected = "Rejected"
)

Registration status values in a BootNotification answer.

View Source
const (
	StatusAvailable     = "Available"
	StatusPreparing     = "Preparing"
	StatusCharging      = "Charging"
	StatusSuspendedEVSE = "SuspendedEVSE"
	StatusSuspendedEV   = "SuspendedEV"
	StatusFinishing     = "Finishing"
	StatusReserved      = "Reserved"
	StatusUnavailable   = "Unavailable"
	StatusFaulted       = "Faulted"
)

Connector status values.

View Source
const (
	ActionAuthorize        = "Authorize"
	ActionStartTransaction = "StartTransaction"
	ActionStopTransaction  = "StopTransaction"
	ActionMeterValues      = "MeterValues"
)

Actions of a transaction.

View Source
const (
	ReasonLocal          = "Local"
	ReasonEVDisconnected = "EVDisconnected"
	ReasonRemote         = "Remote"
	ReasonDeAuthorized   = "DeAuthorized"
	ReasonPowerLoss      = "PowerLoss"
	ReasonOther          = "Other"
)

Reasons for stopping a transaction.

View Source
const (
	MeasurandEnergy = "Energy.Active.Import.Register"
	MeasurandPower  = "Power.Active.Import"
	MeasurandSoC    = "SoC"
)

Measurands plugyard can report.

View Source
const (
	ContextSamplePeriodic   = "Sample.Periodic"
	ContextTransactionBegin = "Transaction.Begin"
	ContextTransactionEnd   = "Transaction.End"
)

Reading contexts.

View Source
const (
	ReasonHardReset     = "HardReset"
	ReasonSoftReset     = "SoftReset"
	ReasonReboot        = "Reboot"
	ReasonUnlockCommand = "UnlockCommand"
)

More reasons for stopping a transaction.

View Source
const (
	ActionRemoteStartTransaction = "RemoteStartTransaction"
	ActionRemoteStopTransaction  = "RemoteStopTransaction"
	ActionReset                  = "Reset"
	ActionGetConfiguration       = "GetConfiguration"
	ActionChangeConfiguration    = "ChangeConfiguration"
	ActionChangeAvailability     = "ChangeAvailability"
	ActionUnlockConnector        = "UnlockConnector"
	ActionClearCache             = "ClearCache"
	ActionDataTransfer           = "DataTransfer"
	ActionTriggerMessage         = "TriggerMessage"
)

Actions the CSMS starts.

View Source
const (
	ActionUpdateFirmware                = "UpdateFirmware"
	ActionGetDiagnostics                = "GetDiagnostics"
	ActionFirmwareStatusNotification    = "FirmwareStatusNotification"
	ActionDiagnosticsStatusNotification = "DiagnosticsStatusNotification"
)

Actions of the Firmware Management profile.

View Source
const (
	FirmwareIdle               = "Idle"
	FirmwareDownloading        = "Downloading"
	FirmwareDownloaded         = "Downloaded"
	FirmwareDownloadFailed     = "DownloadFailed"
	FirmwareInstalling         = "Installing"
	FirmwareInstalled          = "Installed"
	FirmwareInstallationFailed = "InstallationFailed"

	DiagnosticsIdle         = "Idle"
	DiagnosticsUploading    = "Uploading"
	DiagnosticsUploaded     = "Uploaded"
	DiagnosticsUploadFailed = "UploadFailed"
)

Statuses of a firmware update and of a diagnostics upload. Idle is used by both, and only in answer to a TriggerMessage.

View Source
const (
	StatusAccepted       = "Accepted"
	StatusRejected       = "Rejected"
	StatusScheduled      = "Scheduled"
	StatusNotSupported   = "NotSupported"
	StatusNotImplemented = "NotImplemented"
	StatusRebootRequired = "RebootRequired"
	StatusUnlocked       = "Unlocked"
	StatusUnknownVendor  = "UnknownVendorId"
)

Answer statuses.

View Source
const (
	ResetHard = "Hard"
	ResetSoft = "Soft"

	AvailabilityOperative   = "Operative"
	AvailabilityInoperative = "Inoperative"
)

Reset types and availability types.

View Source
const (
	ActionSetChargingProfile   = "SetChargingProfile"
	ActionClearChargingProfile = "ClearChargingProfile"
	ActionGetCompositeSchedule = "GetCompositeSchedule"
)

Actions of the Smart Charging profile.

View Source
const (
	MeasurandPowerOffered   = "Power.Offered"
	MeasurandCurrentOffered = "Current.Offered"
)

More measurands plugyard can report: what a connector offers the EV.

View Source
const (
	PurposeChargePointMax = "ChargePointMaxProfile"
	PurposeTxDefault      = "TxDefaultProfile"
	PurposeTx             = "TxProfile"

	KindAbsolute  = "Absolute"
	KindRecurring = "Recurring"
	KindRelative  = "Relative"

	RecurrencyDaily  = "Daily"
	RecurrencyWeekly = "Weekly"

	UnitAmps  = "A"
	UnitWatts = "W"
)

Charging profile purposes, kinds, recurrency kinds and rate units.

View Source
const AuthorizationAccepted = "Accepted"

AuthorizationAccepted is the idTagInfo status of a tag that may charge.

View Source
const ContextTrigger = "Trigger"

ContextTrigger is the reading context of a meter value the CSMS asked for.

View Source
const ErrorCodeNoError = "NoError"

ErrorCodeNoError is the error code of a connector that has no fault.

View Source
const StatusUnknown = "Unknown"

StatusUnknown answers a ClearChargingProfile that matched no profile.

View Source
const Subprotocol = "ocpp1.6"

Subprotocol is the WebSocket subprotocol name of OCPP 1.6J.

Variables

View Source
var ErrorCodes = []string{
	"ConnectorLockFailure", "EVCommunicationError", "GroundFailure", "HighTemperature",
	"InternalError", "LocalListConflict", "OtherError", "OverCurrentFailure",
	"OverVoltage", "PowerMeterFailure", "PowerSwitchFailure", "ReaderFailure",
	"ResetFailure", "UnderVoltage", "WeakSignal",
}

ErrorCodes are the fault codes a StatusNotification can carry, besides NoError.

Measurands lists every measurand plugyard can report.

View Source
var UnsupportedActions = []string{
	"GetLocalListVersion", "SendLocalList",
	"ReserveNow", "CancelReservation",
}

UnsupportedActions belong to the feature profiles plugyard does not implement: Local Auth List Management and Reservation.

Functions

This section is empty.

Types

type AuthorizeRequest

type AuthorizeRequest struct {
	IDTag string `json:"idTag"`
}

type AuthorizeResponse

type AuthorizeResponse struct {
	IDTagInfo IDTagInfo `json:"idTagInfo"`
}

type BootNotificationRequest

type BootNotificationRequest struct {
	ChargePointVendor string `json:"chargePointVendor"`
	ChargePointModel  string `json:"chargePointModel"`
	FirmwareVersion   string `json:"firmwareVersion,omitempty"`
}

type BootNotificationResponse

type BootNotificationResponse struct {
	Status      string `json:"status"`
	CurrentTime Time   `json:"currentTime"`
	Interval    int    `json:"interval"`
}

type ChangeAvailabilityRequest

type ChangeAvailabilityRequest struct {
	ConnectorID int    `json:"connectorId"`
	Type        string `json:"type"`
}

type ChangeConfigurationRequest

type ChangeConfigurationRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ChargingProfile

type ChargingProfile struct {
	ChargingProfileID      int              `json:"chargingProfileId"`
	TransactionID          *int             `json:"transactionId,omitempty"`
	StackLevel             int              `json:"stackLevel"`
	ChargingProfilePurpose string           `json:"chargingProfilePurpose"`
	ChargingProfileKind    string           `json:"chargingProfileKind"`
	RecurrencyKind         string           `json:"recurrencyKind,omitempty"`
	ValidFrom              *Time            `json:"validFrom,omitempty"`
	ValidTo                *Time            `json:"validTo,omitempty"`
	ChargingSchedule       ChargingSchedule `json:"chargingSchedule"`
}

type ChargingSchedule

type ChargingSchedule struct {
	// Duration is the length of the schedule in seconds.
	Duration               *int                     `json:"duration,omitempty"`
	StartSchedule          *Time                    `json:"startSchedule,omitempty"`
	ChargingRateUnit       string                   `json:"chargingRateUnit"`
	ChargingSchedulePeriod []ChargingSchedulePeriod `json:"chargingSchedulePeriod"`
	MinChargingRate        *float64                 `json:"minChargingRate,omitempty"`
}

type ChargingSchedulePeriod

type ChargingSchedulePeriod struct {
	// StartPeriod is the start of the period, in seconds from the start of
	// the schedule.
	StartPeriod  int     `json:"startPeriod"`
	Limit        float64 `json:"limit"`
	NumberPhases *int    `json:"numberPhases,omitempty"`
}

type ClearChargingProfileRequest

type ClearChargingProfileRequest struct {
	ID                     *int   `json:"id,omitempty"`
	ConnectorID            *int   `json:"connectorId,omitempty"`
	ChargingProfilePurpose string `json:"chargingProfilePurpose,omitempty"`
	StackLevel             *int   `json:"stackLevel,omitempty"`
}

type DataTransferRequest

type DataTransferRequest struct {
	VendorID  string `json:"vendorId"`
	MessageID string `json:"messageId,omitempty"`
	Data      string `json:"data,omitempty"`
}

type DataTransferResponse

type DataTransferResponse struct {
	Status string `json:"status"`
	Data   string `json:"data,omitempty"`
}

type GetCompositeScheduleRequest

type GetCompositeScheduleRequest struct {
	ConnectorID      int    `json:"connectorId"`
	Duration         int    `json:"duration"`
	ChargingRateUnit string `json:"chargingRateUnit,omitempty"`
}

type GetCompositeScheduleResponse

type GetCompositeScheduleResponse struct {
	Status           string            `json:"status"`
	ConnectorID      *int              `json:"connectorId,omitempty"`
	ScheduleStart    *Time             `json:"scheduleStart,omitempty"`
	ChargingSchedule *ChargingSchedule `json:"chargingSchedule,omitempty"`
}

type GetConfigurationRequest

type GetConfigurationRequest struct {
	Key []string `json:"key,omitempty"`
}

type GetConfigurationResponse

type GetConfigurationResponse struct {
	ConfigurationKey []KeyValue `json:"configurationKey,omitempty"`
	UnknownKey       []string   `json:"unknownKey,omitempty"`
}

type GetDiagnosticsRequest added in v0.1.2

type GetDiagnosticsRequest struct {
	Location      string `json:"location"`
	Retries       *int   `json:"retries,omitempty"`
	RetryInterval *int   `json:"retryInterval,omitempty"`
	StartTime     *Time  `json:"startTime,omitempty"`
	StopTime      *Time  `json:"stopTime,omitempty"`
}

type GetDiagnosticsResponse added in v0.1.2

type GetDiagnosticsResponse struct {
	// FileName is empty when the charger has no diagnostics to send.
	FileName string `json:"fileName,omitempty"`
}

type HeartbeatRequest

type HeartbeatRequest struct{}

type HeartbeatResponse

type HeartbeatResponse struct {
	CurrentTime Time `json:"currentTime"`
}

type IDTagInfo

type IDTagInfo struct {
	Status      string `json:"status"`
	ParentIDTag string `json:"parentIdTag,omitempty"`
	ExpiryDate  *Time  `json:"expiryDate,omitempty"`
}

type KeyValue

type KeyValue struct {
	Key      string `json:"key"`
	Readonly bool   `json:"readonly"`
	Value    string `json:"value"`
}

type MeterValue

type MeterValue struct {
	Timestamp    Time           `json:"timestamp"`
	SampledValue []SampledValue `json:"sampledValue"`
}

type MeterValuesRequest

type MeterValuesRequest struct {
	ConnectorID   int          `json:"connectorId"`
	TransactionID *int         `json:"transactionId,omitempty"`
	MeterValue    []MeterValue `json:"meterValue"`
}

type MeterValuesResponse

type MeterValuesResponse struct{}

type RemoteStartTransactionRequest

type RemoteStartTransactionRequest struct {
	ConnectorID *int   `json:"connectorId,omitempty"`
	IDTag       string `json:"idTag"`
	// ChargingProfile, when given, is a TxProfile for the transaction the
	// request starts.
	ChargingProfile *ChargingProfile `json:"chargingProfile,omitempty"`
}

type RemoteStopTransactionRequest

type RemoteStopTransactionRequest struct {
	TransactionID int `json:"transactionId"`
}

type ResetRequest

type ResetRequest struct {
	Type string `json:"type"`
}

type SampledValue

type SampledValue struct {
	Value     string `json:"value"`
	Context   string `json:"context,omitempty"`
	Measurand string `json:"measurand,omitempty"`
	Location  string `json:"location,omitempty"`
	Unit      string `json:"unit,omitempty"`
}

type SetChargingProfileRequest

type SetChargingProfileRequest struct {
	ConnectorID        int             `json:"connectorId"`
	CsChargingProfiles ChargingProfile `json:"csChargingProfiles"`
}

type StartTransactionRequest

type StartTransactionRequest struct {
	ConnectorID int    `json:"connectorId"`
	IDTag       string `json:"idTag"`
	MeterStart  int    `json:"meterStart"`
	Timestamp   Time   `json:"timestamp"`
}

type StartTransactionResponse

type StartTransactionResponse struct {
	IDTagInfo     IDTagInfo `json:"idTagInfo"`
	TransactionID int       `json:"transactionId"`
}

type StatusAnswer

type StatusAnswer struct {
	Status string `json:"status"`
}

StatusAnswer is the answer to every request that is answered with only a status.

type StatusNotificationRequest

type StatusNotificationRequest struct {
	ConnectorID int    `json:"connectorId"`
	ErrorCode   string `json:"errorCode"`
	Info        string `json:"info,omitempty"`
	Status      string `json:"status"`
	Timestamp   *Time  `json:"timestamp,omitempty"`
	// VendorErrorCode is a vendor's own code for the fault.
	VendorErrorCode string `json:"vendorErrorCode,omitempty"`
}

type StatusNotificationResponse

type StatusNotificationResponse struct{}

type StopTransactionRequest

type StopTransactionRequest struct {
	IDTag           string       `json:"idTag,omitempty"`
	MeterStop       int          `json:"meterStop"`
	Timestamp       Time         `json:"timestamp"`
	TransactionID   int          `json:"transactionId"`
	Reason          string       `json:"reason,omitempty"`
	TransactionData []MeterValue `json:"transactionData,omitempty"`
}

type StopTransactionResponse

type StopTransactionResponse struct {
	IDTagInfo *IDTagInfo `json:"idTagInfo,omitempty"`
}

type Time

type Time struct{ time.Time }

Time is a timestamp in the form OCPP 1.6 uses: RFC 3339 in UTC with millisecond precision.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type TransferStatusNotification added in v0.1.2

type TransferStatusNotification struct {
	Status string `json:"status"`
}

TransferStatusNotification is both FirmwareStatusNotification and DiagnosticsStatusNotification: each carries only a status.

type TriggerMessageRequest

type TriggerMessageRequest struct {
	RequestedMessage string `json:"requestedMessage"`
	ConnectorID      *int   `json:"connectorId,omitempty"`
}

type UnlockConnectorRequest

type UnlockConnectorRequest struct {
	ConnectorID int `json:"connectorId"`
}

type UpdateFirmwareRequest added in v0.1.2

type UpdateFirmwareRequest struct {
	Location      string `json:"location"`
	Retries       *int   `json:"retries,omitempty"`
	RetrieveDate  Time   `json:"retrieveDate"`
	RetryInterval *int   `json:"retryInterval,omitempty"`
}

Jump to

Keyboard shortcuts

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