@@ -5,21 +5,6 @@ import (
5
5
"github.com/enbility/eebus-go/spine/model"
6
6
)
7
7
8
- type ManufacturerType struct {
9
- BrandName string
10
- VendorName string
11
- VendorCode string
12
- DeviceName string
13
- DeviceCode string
14
- SerialNumber string
15
- SoftwareRevision string
16
- HardwareRevision string
17
- PowerSource string
18
- ManufacturerNodeIdentification string
19
- ManufacturerLabel string
20
- ManufacturerDescription string
21
- }
22
-
23
8
type DeviceClassification struct {
24
9
* FeatureImpl
25
10
}
@@ -38,22 +23,12 @@ func NewDeviceClassification(localRole, remoteRole model.RoleType, spineLocalDev
38
23
}
39
24
40
25
// request DeviceClassificationManufacturerData from a remote device entity
41
- func (d * DeviceClassification ) RequestManufacturerDetailsForEntity () (* model.MsgCounterType , error ) {
42
- // request DeviceClassificationManufacturer from a remote entity
43
- msgCounter , err := d .requestData (model .FunctionTypeDeviceClassificationManufacturerData , nil , nil )
44
- if err != nil {
45
- return nil , err
46
- }
47
-
48
- return msgCounter , nil
26
+ func (d * DeviceClassification ) RequestManufacturerDetails () (* model.MsgCounterType , error ) {
27
+ return d .requestData (model .FunctionTypeDeviceClassificationManufacturerData , nil , nil )
49
28
}
50
29
51
30
// get the current manufacturer details for a remote device entity
52
- func (d * DeviceClassification ) GetManufacturerDetails () (* ManufacturerType , error ) {
53
- if d .featureRemote == nil {
54
- return nil , ErrDataNotAvailable
55
- }
56
-
31
+ func (d * DeviceClassification ) GetManufacturerDetails () (* model.DeviceClassificationManufacturerDataType , error ) {
57
32
rData := d .featureRemote .Data (model .FunctionTypeDeviceClassificationManufacturerData )
58
33
if rData == nil {
59
34
return nil , ErrDataNotAvailable
@@ -64,44 +39,5 @@ func (d *DeviceClassification) GetManufacturerDetails() (*ManufacturerType, erro
64
39
return nil , ErrDataNotAvailable
65
40
}
66
41
67
- details := & ManufacturerType {}
68
-
69
- if data .BrandName != nil {
70
- details .BrandName = string (* data .BrandName )
71
- }
72
- if data .VendorName != nil {
73
- details .VendorName = string (* data .VendorName )
74
- }
75
- if data .VendorCode != nil {
76
- details .VendorCode = string (* data .VendorCode )
77
- }
78
- if data .DeviceName != nil {
79
- details .DeviceName = string (* data .DeviceName )
80
- }
81
- if data .DeviceCode != nil {
82
- details .DeviceCode = string (* data .DeviceCode )
83
- }
84
- if data .SerialNumber != nil {
85
- details .SerialNumber = string (* data .SerialNumber )
86
- }
87
- if data .SoftwareRevision != nil {
88
- details .SoftwareRevision = string (* data .SoftwareRevision )
89
- }
90
- if data .HardwareRevision != nil {
91
- details .HardwareRevision = string (* data .HardwareRevision )
92
- }
93
- if data .PowerSource != nil {
94
- details .PowerSource = string (* data .PowerSource )
95
- }
96
- if data .ManufacturerNodeIdentification != nil {
97
- details .ManufacturerNodeIdentification = string (* data .ManufacturerNodeIdentification )
98
- }
99
- if data .ManufacturerLabel != nil {
100
- details .ManufacturerLabel = string (* data .ManufacturerLabel )
101
- }
102
- if data .ManufacturerDescription != nil {
103
- details .ManufacturerDescription = string (* data .ManufacturerDescription )
104
- }
105
-
106
- return details , nil
42
+ return data , nil
107
43
}
0 commit comments