@@ -30,6 +30,7 @@ type OptFlds struct {
30
30
type ClientReportControlBlock struct {
31
31
Ena bool // 使能
32
32
IntgPd int // 周期上送时间
33
+ Resv bool // Reservation for URCB
33
34
TrgOps TrgOps // 触发条件
34
35
OptFlds OptFlds // 报告选项
35
36
}
@@ -45,6 +46,7 @@ func (c *Client) GetRCBValues(objectReference string) (*ClientReportControlBlock
45
46
return & ClientReportControlBlock {
46
47
Ena : c .getRCBEnable (rcb ),
47
48
IntgPd : int (c .getRCBIntgPd (rcb )),
49
+ Resv : c .getRCBResv (rcb ),
48
50
TrgOps : c .getTrgOps (rcb ),
49
51
OptFlds : c .getOptFlds (rcb ),
50
52
}, nil
@@ -60,6 +62,11 @@ func (c *Client) getRCBIntgPd(rcb C.ClientReportControlBlock) uint32 {
60
62
return uint32 (intgPd )
61
63
}
62
64
65
+ func (c * Client ) getRCBResv (rcb C.ClientReportControlBlock ) bool {
66
+ resv := C .ClientReportControlBlock_getResv (rcb )
67
+ return bool (resv )
68
+ }
69
+
63
70
func (c * Client ) getOptFlds (rcb C.ClientReportControlBlock ) OptFlds {
64
71
optFlds := C .ClientReportControlBlock_getOptFlds (rcb )
65
72
g := int (optFlds )
@@ -140,11 +147,18 @@ func (c *Client) SetRCBValues(objectReference string, settings ClientReportContr
140
147
optFlds = optFlds | C .RPT_OPT_CONF_REV
141
148
}
142
149
143
- C .ClientReportControlBlock_setTrgOps (rcb , trgOps ) // 触发条件
144
- C .ClientReportControlBlock_setRptEna (rcb , C .bool (settings .Ena )) // 报告使能
150
+ C .ClientReportControlBlock_setTrgOps (rcb , trgOps ) // 触发条件
151
+ C .ClientReportControlBlock_setRptEna (rcb , C .bool (settings .Ena )) // 报告使能
152
+ C .ClientReportControlBlock_setResv (rcb , C .bool (settings .Resv ))
145
153
C .ClientReportControlBlock_setIntgPd (rcb , C .uint32_t (settings .IntgPd )) // 周期上送时间
146
154
C .ClientReportControlBlock_setOptFlds (rcb , optFlds )
147
- C .IedConnection_setRCBValues (c .conn , & clientError , rcb , C .RCB_ELEMENT_RPT_ENA | C .RCB_ELEMENT_TRG_OPS | C .RCB_ELEMENT_INTG_PD , true )
155
+
156
+ if bool (C .ClientReportControlBlock_isBuffered (rcb )) {
157
+ C .IedConnection_setRCBValues (c .conn , & clientError , rcb , C .RCB_ELEMENT_RPT_ENA | C .RCB_ELEMENT_TRG_OPS | C .RCB_ELEMENT_INTG_PD , true )
158
+ } else {
159
+ C .IedConnection_setRCBValues (c .conn , & clientError , rcb , C .RCB_ELEMENT_RESV | C .RCB_ELEMENT_RPT_ENA | C .RCB_ELEMENT_TRG_OPS | C .RCB_ELEMENT_INTG_PD , true )
160
+ }
161
+
148
162
if err := GetIedClientError (clientError ); err != nil {
149
163
return err
150
164
}
0 commit comments