Skip to content

Commit 4a763a2

Browse files
committed
[config] Update CardConfigurator with allowRejection
1 parent 4089c09 commit 4a763a2

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ achieves that is `makeParameters(cardId, 2)`. Refer to the [Parameters](#paramet
127127

128128
The Parameters that affect the configuration of the CRU and their possible values are as follows:
129129

130+
`AllowRejection (true | false)`
131+
132+
`CruId (0x42)`
133+
130134
`Clock (LOCAL | TTC)`
131135

132136
`DatapathMode (PACKET | CONTINUOUS)`
@@ -160,9 +164,10 @@ params.setClock(Parameters::Clock::type::Local);
160164
The above parameters will be set for the enabled links, as specified by the `LinkMask` parameter. See the [LinkMask](#linkmask) section
161165
for more info.
162166

163-
Note that for `LinkLoopbackEnabled` and `PonUpstreamEnabled` it is sufficient to do the following, as they are simply booleans.
167+
Note that for `AllowRejection`, `LinkLoopbackEnabled` and `PonUpstreamEnabled` it is sufficient to do the following, as they are simply booleans.
164168

165169
```
170+
params.setAllowRejection(true);
166171
params.setLinkLoopbackEnabled(true);
167172
params.setPonUpstreamEnabled(true);
168173
```
@@ -182,6 +187,7 @@ The "global" parameters are:
182187

183188
```
184189
clock
190+
cruid
185191
datapathmode
186192
loopback
187193
gbtmode

roc_example.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#############################################
1212

1313
[cru]
14+
# [true | false]
15+
allowrejection=false
16+
1417
# [ttc | local]
1518
clock=ttc
1619

src/CardConfigurator.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
4848

4949
Clock::type clock = Clock::type::Local;
5050
DatapathMode::type datapathMode = DatapathMode::type::Packet;
51+
bool allowRejection = false;
5152
bool loopback = false;
5253
bool ponUpstream = false;
5354
uint32_t onuAddress = 0x0;
@@ -124,6 +125,12 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
124125
} catch (...) {
125126
throw("Invalid or missing cruId property");
126127
}
128+
129+
try {
130+
allowRejection = configFile.getValue<bool>(globalGroup + ".allowrejection");
131+
} catch(...) {
132+
throw("Invalid or missing allowrejection property");
133+
}
127134
}
128135

129136
parameters.setClock(clock);
@@ -134,6 +141,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
134141
parameters.setPonUpstreamEnabled(ponUpstream);
135142
parameters.setOnuAddress(onuAddress);
136143
parameters.setCruId(cruId);
144+
parameters.setAllowRejection(allowRejection);
137145

138146
//* Per link *//
139147
for (auto configGroup: ConfigFileBrowser(&configFile, "link")) {

0 commit comments

Comments
 (0)