Documentation ¶
Overview ¶
Contains common and shared data types between OCPP 1.6 messages.
Index ¶
- Constants
- Variables
- func DateTimeIsNull(dateTime *DateTime) bool
- func FormatTimestamp(t time.Time) string
- type AuthorizationStatus
- type ChargingProfile
- type ChargingProfileKindType
- type ChargingProfilePurposeType
- type ChargingRateUnitType
- type ChargingSchedule
- type ChargingSchedulePeriod
- type DateTime
- type IdTagInfo
- type Location
- type Measurand
- type MeterValue
- type Phase
- type PropertyViolation
- type ReadingContext
- type RecurrencyKindType
- type RemoteStartStopStatus
- type SampledValue
- type UnitOfMeasure
- type ValueFormat
Constants ¶
View Source
const ( ChargingProfilePurposeChargePointMaxProfile ChargingProfilePurposeType = "ChargePointMaxProfile" ChargingProfilePurposeTxDefaultProfile ChargingProfilePurposeType = "TxDefaultProfile" ChargingProfilePurposeTxProfile ChargingProfilePurposeType = "TxProfile" ChargingProfileKindAbsolute ChargingProfileKindType = "Absolute" ChargingProfileKindRecurring ChargingProfileKindType = "Recurring" ChargingProfileKindRelative ChargingProfileKindType = "Relative" RecurrencyKindDaily RecurrencyKindType = "Daily" RecurrencyKindWeekly RecurrencyKindType = "Weekly" ChargingRateUnitWatts ChargingRateUnitType = "W" ChargingRateUnitAmperes ChargingRateUnitType = "A" )
View Source
const ( ReadingContextInterruptionBegin ReadingContext = "Interruption.Begin" ReadingContextInterruptionEnd ReadingContext = "Interruption.End" ReadingContextOther ReadingContext = "Other" ReadingContextSampleClock ReadingContext = "Sample.Clock" ReadingContextSamplePeriodic ReadingContext = "Sample.Periodic" ReadingContextTransactionBegin ReadingContext = "Transaction.Begin" ReadingContextTransactionEnd ReadingContext = "Transaction.End" ReadingContextTrigger ReadingContext = "Trigger" ValueFormatRaw ValueFormat = "Raw" ValueFormatSignedData ValueFormat = "SignedData" MeasurandCurrentExport Measurand = "Current.Export" MeasurandCurrentImport Measurand = "Current.Import" MeasurandCurrentOffered Measurand = "Current.Offered" MeasurandEnergyActiveExportRegister Measurand = "Energy.Active.Export.Register" MeasurandEnergyActiveImportRegister Measurand = "Energy.Active.Import.Register" MeasurandEnergyReactiveExportRegister Measurand = "Energy.Reactive.Export.Register" MeasurandEnergyReactiveImportRegister Measurand = "Energy.Reactive.Import.Register" MeasurandEnergyActiveExportInterval Measurand = "Energy.Active.Export.Interval" MeasurandEnergyActiveImportInterval Measurand = "Energy.Active.Import.Interval" MeasurandEnergyReactiveExportInterval Measurand = "Energy.Reactive.Export.Interval" MeasurandEnergyReactiveImportInterval Measurand = "Energy.Reactive.Import.Interval" MeasurandFrequency Measurand = "Frequency" MeasurandPowerActiveExport Measurand = "Power.Active.Export" MeasurandPowerActiveImport Measurand = "Power.Active.Import" MeasurandPowerFactor Measurand = "Power.Factor" MeasurandPowerOffered Measurand = "Power.Offered" MeasurandPowerReactiveExport Measurand = "Power.Reactive.Export" MeasurandPowerReactiveImport Measurand = "Power.Reactive.Import" MeasurandRPM Measurand = "RPM" MeasueandSoC Measurand = "SoC" MeasurandTemperature Measurand = "Temperature" MeasurandVoltage Measurand = "Voltage" PhaseL1 Phase = "L1" PhaseL2 Phase = "L2" PhaseL3 Phase = "L3" PhaseN Phase = "N" PhaseL1N Phase = "L1-N" PhaseL2N Phase = "L2-N" PhaseL3N Phase = "L3-N" PhaseL1L2 Phase = "L1-L2" PhaseL2L3 Phase = "L2-L3" PhaseL3L1 Phase = "L3-L1" LocationBody Location = "Body" LocationCable Location = "Cable" LocationEV Location = "EV" LocationInlet Location = "Inlet" LocationOutlet Location = "Outlet" UnitOfMeasureWh UnitOfMeasure = "Wh" UnitOfMeasureKWh UnitOfMeasure = "kWh" UnitOfMeasureVarh UnitOfMeasure = "varh" UnitOfMeasureKvarh UnitOfMeasure = "kvarh" UnitOfMeasureW UnitOfMeasure = "W" UnitOfMeasureKW UnitOfMeasure = "kW" UnitOfMeasureVA UnitOfMeasure = "VA" UnitOfMeasureKVA UnitOfMeasure = "kVA" UnitOfMeasureVar UnitOfMeasure = "var" UnitOfMeasureKvar UnitOfMeasure = "kvar" UnitOfMeasureA UnitOfMeasure = "A" UnitOfMeasureV UnitOfMeasure = "V" UnitOfMeasureCelsius UnitOfMeasure = "Celsius" UnitOfMeasureFahrenheit UnitOfMeasure = "Fahrenheit" UnitOfMeasureK UnitOfMeasure = "K" UnitOfMeasurePercent UnitOfMeasure = "Percent" )
View Source
const ISO8601 = "2006-01-02T15:04:05Z"
ISO8601 time format, assuming Zulu timestamp.
View Source
const (
V16Subprotocol = "ocpp1.6"
)
Variables ¶
View Source
var DateTimeFormat = time.RFC3339
DateTimeFormat to be used for all OCPP messages.
The default dateTime format is RFC3339. Change this if another format is desired.
View Source
var Validate = ocppj.Validate
Initialize validator
Functions ¶
func DateTimeIsNull ¶
func FormatTimestamp ¶
Types ¶
type AuthorizationStatus ¶
type AuthorizationStatus string
const ( AuthorizationStatusAccepted AuthorizationStatus = "Accepted" AuthorizationStatusBlocked AuthorizationStatus = "Blocked" AuthorizationStatusExpired AuthorizationStatus = "Expired" AuthorizationStatusInvalid AuthorizationStatus = "Invalid" AuthorizationStatusConcurrentTx AuthorizationStatus = "ConcurrentTx" )
type ChargingProfile ¶
type ChargingProfile struct { ChargingProfileId int `json:"chargingProfileId" validate:"gte=0"` TransactionId int `json:"transactionId,omitempty"` StackLevel int `json:"stackLevel" validate:"gt=0"` ChargingProfilePurpose ChargingProfilePurposeType `json:"chargingProfilePurpose" validate:"required,chargingProfilePurpose"` ChargingProfileKind ChargingProfileKindType `json:"chargingProfileKind" validate:"required,chargingProfileKind"` RecurrencyKind RecurrencyKindType `json:"recurrencyKind,omitempty" validate:"omitempty,recurrencyKind"` ValidFrom *DateTime `json:"validFrom,omitempty"` ValidTo *DateTime `json:"validTo,omitempty"` ChargingSchedule *ChargingSchedule `json:"chargingSchedule" validate:"required"` }
func NewChargingProfile ¶
func NewChargingProfile(chargingProfileId int, stackLevel int, chargingProfilePurpose ChargingProfilePurposeType, chargingProfileKind ChargingProfileKindType, schedule *ChargingSchedule) *ChargingProfile
type ChargingProfileKindType ¶
type ChargingProfileKindType string
type ChargingRateUnitType ¶
type ChargingRateUnitType string
type ChargingSchedule ¶
type ChargingSchedule struct { Duration *int `json:"duration,omitempty" validate:"omitempty,gte=0"` StartSchedule *DateTime `json:"startSchedule,omitempty"` ChargingRateUnit ChargingRateUnitType `json:"chargingRateUnit" validate:"required,chargingRateUnit"` ChargingSchedulePeriod []ChargingSchedulePeriod `json:"chargingSchedulePeriod" validate:"required,min=1"` MinChargingRate *float64 `json:"minChargingRate,omitempty" validate:"omitempty,gte=0"` }
func NewChargingSchedule ¶
func NewChargingSchedule(chargingRateUnit ChargingRateUnitType, schedulePeriod ...ChargingSchedulePeriod) *ChargingSchedule
type ChargingSchedulePeriod ¶
type ChargingSchedulePeriod struct { StartPeriod int `json:"startPeriod" validate:"gte=0"` Limit float64 `json:"limit" validate:"gte=0"` NumberPhases *int `json:"numberPhases,omitempty" validate:"omitempty,gte=0"` }
func NewChargingSchedulePeriod ¶
func NewChargingSchedulePeriod(startPeriod int, limit float64) ChargingSchedulePeriod
type DateTime ¶
DateTime wraps a time.Time struct, allowing for improved dateTime JSON compatibility.
func NewDateTime ¶
Creates a new DateTime struct, embedding a time.Time struct.
func (*DateTime) FormatTimestamp ¶
Formats the UTC timestamp using the DateTimeFormat setting. This function is used during JSON marshaling as well.
func (*DateTime) MarshalJSON ¶
func (*DateTime) UnmarshalJSON ¶
type IdTagInfo ¶
type IdTagInfo struct { ExpiryDate *DateTime `json:"expiryDate,omitempty" validate:"omitempty"` ParentIdTag string `json:"parentIdTag,omitempty" validate:"omitempty,max=20"` Status AuthorizationStatus `json:"status" validate:"required,authorizationStatus"` }
func NewIdTagInfo ¶
func NewIdTagInfo(status AuthorizationStatus) *IdTagInfo
type MeterValue ¶
type MeterValue struct { Timestamp *DateTime `json:"timestamp" validate:"required"` SampledValue []SampledValue `json:"sampledValue" validate:"required,min=0,dive"` }
type PropertyViolation ¶
type PropertyViolation struct { Property string // contains filtered or unexported fields }
func (*PropertyViolation) Error ¶
func (e *PropertyViolation) Error() string
type RecurrencyKindType ¶
type RecurrencyKindType string
type RemoteStartStopStatus ¶
type RemoteStartStopStatus string
Remote Start/Stop
const ( RemoteStartStopStatusAccepted RemoteStartStopStatus = "Accepted" RemoteStartStopStatusRejected RemoteStartStopStatus = "Rejected" )
type SampledValue ¶
type SampledValue struct { Value string `json:"value" validate:"required"` Context ReadingContext `json:"context,omitempty" validate:"omitempty,readingContext"` Format ValueFormat `json:"format,omitempty" validate:"omitempty,valueFormat"` Measurand Measurand `json:"measurand,omitempty" validate:"omitempty,measurand"` Phase Phase `json:"phase,omitempty" validate:"omitempty,phase"` Location Location `json:"location,omitempty" validate:"omitempty,location"` Unit UnitOfMeasure `json:"unit,omitempty" validate:"omitempty,unitOfMeasure"` }
type UnitOfMeasure ¶
type UnitOfMeasure string
type ValueFormat ¶
type ValueFormat string
Click to show internal directories.
Click to hide internal directories.