Documentation
¶
Overview ¶
Package v16 defines the OCPP 1.6 messages plugyard exchanges with a CSMS.
Index ¶
- Constants
- Variables
- type AuthorizeRequest
- type AuthorizeResponse
- type BootNotificationRequest
- type BootNotificationResponse
- type ChangeAvailabilityRequest
- type ChangeConfigurationRequest
- type ChargingProfile
- type ChargingSchedule
- type ChargingSchedulePeriod
- type ClearChargingProfileRequest
- type DataTransferRequest
- type DataTransferResponse
- type GetCompositeScheduleRequest
- type GetCompositeScheduleResponse
- type GetConfigurationRequest
- type GetConfigurationResponse
- type GetDiagnosticsRequest
- type GetDiagnosticsResponse
- type HeartbeatRequest
- type HeartbeatResponse
- type IDTagInfo
- type KeyValue
- type MeterValue
- type MeterValuesRequest
- type MeterValuesResponse
- type RemoteStartTransactionRequest
- type RemoteStopTransactionRequest
- type ResetRequest
- type SampledValue
- type SetChargingProfileRequest
- type StartTransactionRequest
- type StartTransactionResponse
- type StatusAnswer
- type StatusNotificationRequest
- type StatusNotificationResponse
- type StopTransactionRequest
- type StopTransactionResponse
- type Time
- type TransferStatusNotification
- type TriggerMessageRequest
- type UnlockConnectorRequest
- type UpdateFirmwareRequest
Constants ¶
const ( ActionBootNotification = "BootNotification" ActionHeartbeat = "Heartbeat" ActionStatusNotification = "StatusNotification" )
Actions.
const ( RegistrationAccepted = "Accepted" RegistrationPending = "Pending" RegistrationRejected = "Rejected" )
Registration status values in a BootNotification answer.
const ( StatusAvailable = "Available" StatusPreparing = "Preparing" StatusCharging = "Charging" StatusSuspendedEVSE = "SuspendedEVSE" StatusSuspendedEV = "SuspendedEV" StatusFinishing = "Finishing" StatusReserved = "Reserved" StatusFaulted = "Faulted" )
Connector status values.
const ( ActionAuthorize = "Authorize" ActionStartTransaction = "StartTransaction" ActionStopTransaction = "StopTransaction" ActionMeterValues = "MeterValues" )
Actions of a transaction.
const ( ReasonLocal = "Local" ReasonEVDisconnected = "EVDisconnected" ReasonRemote = "Remote" ReasonDeAuthorized = "DeAuthorized" ReasonPowerLoss = "PowerLoss" ReasonOther = "Other" )
Reasons for stopping a transaction.
const ( MeasurandEnergy = "Energy.Active.Import.Register" MeasurandPower = "Power.Active.Import" MeasurandSoC = "SoC" )
Measurands plugyard can report.
const ( ContextSamplePeriodic = "Sample.Periodic" ContextTransactionBegin = "Transaction.Begin" ContextTransactionEnd = "Transaction.End" )
Reading contexts.
const ( ReasonHardReset = "HardReset" ReasonSoftReset = "SoftReset" ReasonReboot = "Reboot" ReasonUnlockCommand = "UnlockCommand" )
More reasons for stopping a transaction.
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.
const ( ActionUpdateFirmware = "UpdateFirmware" ActionGetDiagnostics = "GetDiagnostics" ActionFirmwareStatusNotification = "FirmwareStatusNotification" ActionDiagnosticsStatusNotification = "DiagnosticsStatusNotification" )
Actions of the Firmware Management profile.
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.
const ( StatusAccepted = "Accepted" StatusRejected = "Rejected" StatusScheduled = "Scheduled" StatusNotSupported = "NotSupported" StatusNotImplemented = "NotImplemented" StatusRebootRequired = "RebootRequired" StatusUnlocked = "Unlocked" StatusUnknownVendor = "UnknownVendorId" )
Answer statuses.
const ( ResetHard = "Hard" ResetSoft = "Soft" AvailabilityOperative = "Operative" AvailabilityInoperative = "Inoperative" )
Reset types and availability types.
const ( ActionSetChargingProfile = "SetChargingProfile" ActionClearChargingProfile = "ClearChargingProfile" ActionGetCompositeSchedule = "GetCompositeSchedule" )
Actions of the Smart Charging profile.
const ( MeasurandPowerOffered = "Power.Offered" MeasurandCurrentOffered = "Current.Offered" )
More measurands plugyard can report: what a connector offers the EV.
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.
const AuthorizationAccepted = "Accepted"
AuthorizationAccepted is the idTagInfo status of a tag that may charge.
const ContextTrigger = "Trigger"
ContextTrigger is the reading context of a meter value the CSMS asked for.
const ErrorCodeNoError = "NoError"
ErrorCodeNoError is the error code of a connector that has no fault.
const StatusUnknown = "Unknown"
StatusUnknown answers a ClearChargingProfile that matched no profile.
const Subprotocol = "ocpp1.6"
Subprotocol is the WebSocket subprotocol name of OCPP 1.6J.
Variables ¶
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.
var Measurands = []string{MeasurandEnergy, MeasurandPower, MeasurandSoC, MeasurandPowerOffered, MeasurandCurrentOffered}
Measurands lists every measurand plugyard can report.
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 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 DataTransferRequest ¶
type DataTransferResponse ¶
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 GetDiagnosticsRequest ¶ added in v0.1.2
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 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 SetChargingProfileRequest ¶
type SetChargingProfileRequest struct {
ConnectorID int `json:"connectorId"`
CsChargingProfiles ChargingProfile `json:"csChargingProfiles"`
}
type StartTransactionRequest ¶
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 StopTransactionResponse ¶
type StopTransactionResponse struct {
IDTagInfo *IDTagInfo `json:"idTagInfo,omitempty"`
}
type Time ¶
Time is a timestamp in the form OCPP 1.6 uses: RFC 3339 in UTC with millisecond precision.
func (Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
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 UnlockConnectorRequest ¶
type UnlockConnectorRequest struct {
ConnectorID int `json:"connectorId"`
}