features

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataForMetadataKeyNotFound = errors.New("data for key not found")

ErrDataForMetadataKeyNotFound indicates that no data item is found for the given key

View Source
var ErrDataNotAvailable = errors.New("data not available")

ErrDataNotAvailable indicates that no data set is yet available

View Source
var ErrEntityNotFound = errors.New("entity not found")
View Source
var ErrFunctionNotSupported = errors.New("function is not supported")
View Source
var ErrMetadataNotAvailable = errors.New("meta data not available")

ErrMetadataNotAvailable indicates that the meta data information is not available e.g. decsriptions, constraints, ...

View Source
var ErrMissingData = errors.New("missing data")
View Source
var ErrNotSupported = errors.New("not supported")
View Source
var ErrOperationOnFunctionNotSupported = errors.New("operation is not supported on function")
View Source
var ErrUsecCaseNotSupported = errors.New("usecase is not supported")

Functions

func EntityOfTypeForSki

func EntityOfTypeForSki(service *service.EEBUSService, entityType model.EntityTypeType, ski string) (*spine.EntityRemoteImpl, error)

return the remote entity of a given type and device ski

func IsUsecaseSupported

func IsUsecaseSupported(usecase model.UseCaseNameType, actor model.UseCaseActorType, remoteDevice *spine.DeviceRemoteImpl) bool

check if the given usecase, actor is supported by the remote device

Types

type DeviceClassification

type DeviceClassification struct {
	*FeatureImpl
}

func NewDeviceClassification

func NewDeviceClassification(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*DeviceClassification, error)

func (*DeviceClassification) GetManufacturerDetails

func (d *DeviceClassification) GetManufacturerDetails() (*ManufacturerType, error)

get the current manufacturer details for a remote device entity

func (*DeviceClassification) RequestManufacturerDetailsForEntity

func (d *DeviceClassification) RequestManufacturerDetailsForEntity() (*model.MsgCounterType, error)

request DeviceClassificationManufacturerData from a remote device entity

type DeviceConfiguration

type DeviceConfiguration struct {
	*FeatureImpl
}

func NewDeviceConfiguration

func NewDeviceConfiguration(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*DeviceConfiguration, error)

func (*DeviceConfiguration) GetDescriptionKeyNameSupport

func (d *DeviceConfiguration) GetDescriptionKeyNameSupport(keyName model.DeviceConfigurationKeyNameType) (bool, error)

returns if a provided scopetype in the device configuration descriptions is available or not returns an error if no description data is available yet

func (*DeviceConfiguration) GetEVCommunicationStandard

func (d *DeviceConfiguration) GetEVCommunicationStandard() (*string, error)

return current SoC for measurements

func (*DeviceConfiguration) GetValues

return current values for Device Configuration

func (*DeviceConfiguration) Request

func (d *DeviceConfiguration) Request() error

request DeviceConfiguration data from a remote entity

func (*DeviceConfiguration) RequestKeyValueList

func (d *DeviceConfiguration) RequestKeyValueList() (*model.MsgCounterType, error)

request DeviceConfigurationKeyValueListDataType from a remote entity

type DeviceConfigurationType

type DeviceConfigurationType struct {
	Key           string
	ValueBool     bool
	ValueDate     time.Time
	ValueDatetime time.Time
	ValueDuration time.Duration
	ValueString   string
	ValueTime     time.Time
	ValueFloat    float64
	Type          model.DeviceConfigurationKeyValueTypeType
	Unit          string
}

type DeviceDiagnosis

type DeviceDiagnosis struct {
	*FeatureImpl
}

func NewDeviceDiagnosis

func NewDeviceDiagnosis(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*DeviceDiagnosis, error)

func (*DeviceDiagnosis) GetState

func (d *DeviceDiagnosis) GetState() (*DeviceDiagnosisType, error)

get the current diagnosis state for an device entity

func (*DeviceDiagnosis) RequestStateForEntity

func (d *DeviceDiagnosis) RequestStateForEntity() (*model.MsgCounterType, error)

request DeviceDiagnosisStateData from a remote entity

func (*DeviceDiagnosis) SendState added in v0.1.5

func (d *DeviceDiagnosis) SendState(operatingState *model.DeviceDiagnosisStateDataType)

type DeviceDiagnosisType

type DeviceDiagnosisType struct {
	OperatingState       model.DeviceDiagnosisOperatingStateType
	PowerSupplyCondition model.PowerSupplyConditionType
}

type ElectricalConnection

type ElectricalConnection struct {
	*FeatureImpl
}

func NewElectricalConnection

func NewElectricalConnection(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*ElectricalConnection, error)

func (*ElectricalConnection) GetConnectedPhases

func (e *ElectricalConnection) GetConnectedPhases() (uint, error)

return number of phases the device is connected with

func (*ElectricalConnection) GetCurrentsLimits

func (e *ElectricalConnection) GetCurrentsLimits() (map[string]float64, map[string]float64, map[string]float64, error)

return current current limit values

returns a map with the phase ("a", "b", "c") as a key for minimum, maximum, default/pause values

func (*ElectricalConnection) GetDescription

func (e *ElectricalConnection) GetDescription() ([]ElectricalDescriptionType, error)

return current values for Electrical Description

func (*ElectricalConnection) GetEVLimitValues

func (e *ElectricalConnection) GetEVLimitValues() ([]ElectricalLimitType, error)

return current values for Electrical Limits

EV only: Min power data is only provided via IEC61851 or using VAS in ISO15118-2.

func (*ElectricalConnection) GetParamDescriptionListData

func (e *ElectricalConnection) GetParamDescriptionListData() (electricalParamDescriptionMapMeasurementId, electricatlParamDescriptionMapParamId, error)

return a map of ElectricalConnectionParameterDescriptionListDataType with measurementId as key and ElectricalConnectionParameterDescriptionListDataType with parameterId as key

func (*ElectricalConnection) RequestDescription

func (e *ElectricalConnection) RequestDescription() error

request ElectricalConnectionDescriptionListDataType from a remote entity

func (*ElectricalConnection) RequestParameterDescription

func (e *ElectricalConnection) RequestParameterDescription() error

request FunctionTypeElectricalConnectionParameterDescriptionListData from a remote entity

func (*ElectricalConnection) RequestPermittedValueSet

func (e *ElectricalConnection) RequestPermittedValueSet() (*model.MsgCounterType, error)

request FunctionTypeElectricalConnectionPermittedValueSetListData from a remote entity

type ElectricalDescriptionType

type ElectricalDescriptionType struct {
	ConnectionID            uint
	PowerSupplyType         model.ElectricalConnectionVoltageTypeType
	AcConnectedPhases       uint
	PositiveEnergyDirection model.EnergyDirectionType
}

Details about the electrical connection

type ElectricalLimitType

type ElectricalLimitType struct {
	ConnectionID uint
	Min          float64
	Max          float64
	Default      float64
	Phase        model.ElectricalConnectionPhaseNameType
	Scope        model.ScopeTypeType
}

Details about the limits of an electrical connection

type Feature

type Feature interface {
	SubscribeForEntity() error
}

type FeatureImpl

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

func NewFeatureImpl

func NewFeatureImpl(featureType model.FeatureTypeType, localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*FeatureImpl, error)

func (*FeatureImpl) Bind

func (f *FeatureImpl) Bind() error

bind to the feature of a the entity

func (*FeatureImpl) SubscribeForEntity

func (f *FeatureImpl) SubscribeForEntity() error

subscribe to the feature for a the entity

type Identification

type Identification struct {
	*FeatureImpl
}

func NewIdentification

func NewIdentification(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*Identification, error)

func (*Identification) GetValues

func (i *Identification) GetValues() ([]IdentificationType, error)

return current values for Identification

func (*Identification) Request

func (i *Identification) Request() (*model.MsgCounterType, error)

request FunctionTypeIdentificationListData from a remote entity

type IdentificationType

type IdentificationType struct {
	Identifier string
	Type       model.IdentificationTypeType
}

type IncentiveTable

type IncentiveTable struct {
	*FeatureImpl
}

func NewIncentiveTable

func NewIncentiveTable(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*IncentiveTable, error)

func (*IncentiveTable) RequestConstraints

func (i *IncentiveTable) RequestConstraints() error

request FunctionTypeIncentiveTableConstraintsData from a remote entity

func (*IncentiveTable) RequestDescription

func (i *IncentiveTable) RequestDescription() error

request FunctionTypeIncentiveTableDescriptionData from a remote entity

func (*IncentiveTable) RequestValues

func (i *IncentiveTable) RequestValues() error

request FunctionTypeIncentiveTableData from a remote entity

type LoadControl

type LoadControl struct {
	*FeatureImpl
}

func NewLoadControl

func NewLoadControl(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*LoadControl, error)

func (*LoadControl) GetLimitDescription

func (l *LoadControl) GetLimitDescription() (loadControlLimitDescriptionMap, error)

returns the load control descriptions returns an error if no description data is available yet

func (*LoadControl) GetLimitDescriptionCategorySupport

func (l *LoadControl) GetLimitDescriptionCategorySupport(category model.LoadControlCategoryType) (bool, error)

returns if a provided category in the load control limit descriptions is available or not returns an error if no description data is available yet

func (*LoadControl) GetLimitValues

func (l *LoadControl) GetLimitValues() ([]LoadControlLimitType, error)

func (*LoadControl) RequestLimitConstraints

func (l *LoadControl) RequestLimitConstraints() error

request FunctionTypeLoadControlLimitConstraintsListData from a remote device

func (*LoadControl) RequestLimitDescription

func (l *LoadControl) RequestLimitDescription() error

request FunctionTypeLoadControlLimitDescriptionListData from a remote device

func (*LoadControl) RequestLimits

func (l *LoadControl) RequestLimits() (*model.MsgCounterType, error)

request FunctionTypeLoadControlLimitListData from a remote device

func (*LoadControl) WriteLimitValues

func (l *LoadControl) WriteLimitValues(data []model.LoadControlLimitDataType) (*model.MsgCounterType, error)

write load control limits returns an error if this failed

type LoadControlLimitType

type LoadControlLimitType struct {
	LimitId       uint
	MeasurementId uint
	Category      model.LoadControlCategoryType
	Unit          model.UnitOfMeasurementType
	Scope         model.ScopeTypeType
	IsChangeable  bool
	IsActive      bool
	Value         float64
}

type ManufacturerType

type ManufacturerType struct {
	BrandName                      string
	VendorName                     string
	VendorCode                     string
	DeviceName                     string
	DeviceCode                     string
	SerialNumber                   string
	SoftwareRevision               string
	HardwareRevision               string
	PowerSource                    string
	ManufacturerNodeIdentification string
	ManufacturerLabel              string
	ManufacturerDescription        string
}

type Measurement

type Measurement struct {
	*FeatureImpl
}

func NewMeasurement

func NewMeasurement(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*Measurement, error)

func (*Measurement) GetConstraints

func (m *Measurement) GetConstraints() (measurementConstraintMap, error)

return a map of MeasurementDescriptionListDataType with measurementId as key

func (*Measurement) GetDescription

func (m *Measurement) GetDescription() (measurementDescriptionMap, error)

return a map of MeasurementDescriptionListDataType with measurementId as key returns an error if no description data is available yet

func (*Measurement) GetDescriptionForScope

func (m *Measurement) GetDescriptionForScope(scope model.ScopeTypeType) (measurementDescriptionMap, error)

return a map of MeasurementDescriptionListDataType with measurementId as key for a given scope returns an error if no description data is available yet

func (*Measurement) GetSoC

func (m *Measurement) GetSoC() (float64, error)

return current SoC for measurements

func (*Measurement) GetValueForScope

func (m *Measurement) GetValueForScope(scope model.ScopeTypeType, electricalConnection *ElectricalConnection) (float64, error)

return current value of a defined scope

func (*Measurement) GetValues

func (m *Measurement) GetValues() ([]MeasurementType, error)

return current values for measurements

func (*Measurement) GetValuesPerPhaseForScope

func (m *Measurement) GetValuesPerPhaseForScope(scope model.ScopeTypeType, electricalConnection *ElectricalConnection) (map[string]float64, error)

return current values of a defined scope per phase

returns a map with the phase ("a", "b", "c") as a key

If the scope is not available, it will return an empty map

func (*Measurement) Request

func (m *Measurement) Request() (*model.MsgCounterType, error)

request FunctionTypeMeasurementListData from a remote entity

func (*Measurement) RequestConstraints

func (m *Measurement) RequestConstraints() error

request FunctionTypeMeasurementConstraintsListData from a remote entity

func (*Measurement) RequestDescription

func (m *Measurement) RequestDescription() error

request FunctionTypeMeasurementDescriptionListData from a remote device

type MeasurementType

type MeasurementType struct {
	MeasurementId uint
	Value         float64
	ValueMin      float64
	ValueMax      float64
	ValueStep     float64
	Unit          model.UnitOfMeasurementType
	Scope         model.ScopeTypeType
	Timestamp     time.Time
}

type TimeSeries

type TimeSeries struct {
	*FeatureImpl
}

func NewTimeSeries

func NewTimeSeries(localRole, remoteRole model.RoleType, spineLocalDevice *spine.DeviceLocalImpl, entity *spine.EntityRemoteImpl) (*TimeSeries, error)

func (*TimeSeries) GetConstraintValues

func (t *TimeSeries) GetConstraintValues() ([]TimeSeriesConstraintsType, error)

return current constraint values for Time Series

func (*TimeSeries) GetDescriptionValues

func (t *TimeSeries) GetDescriptionValues() ([]TimeSeriesDescriptionType, error)

return current description values for Time Series

func (*TimeSeries) GetValues

func (t *TimeSeries) GetValues() ([]TimeSeriesType, error)

return current values for Time Series

func (*TimeSeries) Request

func (t *TimeSeries) Request() (*model.MsgCounterType, error)

request FunctionTypeTimeSeriesListData from a remote device

func (*TimeSeries) RequestConstraints

func (t *TimeSeries) RequestConstraints() error

request FunctionTypeTimeSeriesConstraintsListData from a remote entity

func (*TimeSeries) RequestDescription

func (t *TimeSeries) RequestDescription() error

request FunctionTypeTimeSeriesDescriptionListData from a remote entity

type TimeSeriesConstraintsType

type TimeSeriesConstraintsType struct {
	TimeSeriesId      uint
	SlotCountMin      uint          // Constraints
	SlotCountMax      uint          // Constraints
	SlotDurationMin   time.Duration // Constraints
	SlotDurationMax   time.Duration // Constraints
	SlotDurationStep  time.Duration // Constraints
	EarliestStartTime time.Time     // Constraints
	LatestEndTime     time.Time     // Constraints
	SlotValueMin      float64       // Constraints
	SlotValueMax      float64       // Constraints
	SlotValueStep     float64       // Constraints
}

type TimeSeriesDescriptionType

type TimeSeriesDescriptionType struct {
	TimeSeriesId     uint
	Type             model.TimeSeriesTypeType    // Description
	MeasurementId    uint                        // Description
	IsWriteable      bool                        // Description
	IsUpdateRequired bool                        // Description
	Unit             model.UnitOfMeasurementType // Description
}

type TimeSeriesSlotType

type TimeSeriesSlotType struct {
	TimeSeriesSlotId uint
	PeriodStartTime  time.Duration
	PeriodEndTime    time.Duration
	Duration         time.Duration
	Value            float64
	ValueMin         float64
	ValueMax         float64
}

type TimeSeriesType

type TimeSeriesType struct {
	TimeSeriesId    uint
	PeriodStartTime time.Duration
	PeriodEndTime   time.Duration
	Slots           []TimeSeriesSlotType
}

Jump to

Keyboard shortcuts

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