Skip to content

Commit dc8815b

Browse files
committed
[config] ONU address as dec instead of hex
1 parent 4288c86 commit dc8815b

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ params.setDynamicOffsetEnabled(true);
237237
...
238238
```
239239

240-
Likewise for `OnuAddress`, passing the hex is enough.
240+
Likewise for `OnuAddress`, passing the int is enough.
241241

242242
```
243-
params.setOnuAddress(0x0badcafe)
243+
params.setOnuAddress(42)
244244
```
245245

246246
### Configuration File
@@ -591,7 +591,7 @@ metric format for the CRORC and the CRU is different, as different parameters ar
591591
| Value name - | Value | Type |
592592
| ---------------------| --------------------------- | ------ |
593593
| `"onuStickyStatus"` | 0/1 (DOWN/UP) | int |
594-
| `"onuAddress"` | ONU Address | string |
594+
| `"onuAddress"` | ONU Address | int |
595595
| `"rx40Locked"` | 0/1 (False/True) | int |
596596
| `"phaseGood"` | 0/1 (False/True) | int |
597597
| `"rxLocked"` | 0/1 (False/True) | int |

cru_template.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ downstreamData=MIDTRG
3535
# [true | false]
3636
ponUpstream=false
3737

38-
# [0x0badcafe]
39-
onuAddress=0x0badcaff
38+
# [int]
39+
onuAddress=10
4040

4141
# [true | false]
4242
dynamicOffset=false

src/CardConfigurator.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
174174
ponUpstream = subtree.get<bool>("ponUpstream");
175175
dynamicOffset = subtree.get<bool>("dynamicOffset");
176176

177-
parsedString = subtree.get<std::string>("onuAddress");
178-
onuAddress = Hex::fromString(parsedString);
177+
onuAddress = subtree.get<int>("onuAddress");
179178

180179
parsedString = subtree.get<std::string>("cruId");
181180
cruId = Hex::fromString(parsedString);

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class ProgramStatus : public Program
266266
if (mOptions.monitoring) {
267267
monitoring->send(Metric{ "onu" }
268268
.addValue(onuStickyStatusInt, "onuStickyStatus")
269-
.addValue(std::to_string(onuStatus.onuAddress), "onuAddress")
269+
.addValue(int(onuStatus.onuAddress), "onuAddress")
270270
.addValue(onuStatus.rx40Locked, "rx40Locked")
271271
.addValue(onuStatus.phaseGood, "phaseGood")
272272
.addValue(onuStatus.rxLocked, "rxLocked")
@@ -298,7 +298,7 @@ class ProgramStatus : public Program
298298
} else {
299299
std::cout << "=============================" << std::endl;
300300
std::cout << "ONU status: \t\t" << onuStickyStatus << std::endl;
301-
std::cout << "ONU address: \t\t0x" << std::hex << onuStatus.onuAddress << std::endl;
301+
std::cout << "ONU address: \t\t" << onuStatus.onuAddress << std::endl;
302302
std::cout << "-----------------------------" << std::endl;
303303
std::cout << "ONU RX40 locked: \t" << std::boolalpha << onuStatus.rx40Locked << std::endl;
304304
std::cout << "ONU phase good: \t" << std::boolalpha << onuStatus.phaseGood << std::endl;

0 commit comments

Comments
 (0)