Skip to content

Commit 603e8f5

Browse files
committed
[config] Update onu argument from hex to int
1 parent 56f2382 commit 603e8f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The Parameters that affect the configuration of the CRU, their possible values (
141141

142142
`AllowRejection (true | false) [false]`
143143

144-
`CruId (0x42) [0x0]`
144+
`CruId (0x0-0xffff) [0x0]`
145145

146146
`Clock (LOCAL | TTC) [LOCAL]`
147147

@@ -157,7 +157,7 @@ The Parameters that affect the configuration of the CRU, their possible values (
157157

158158
`PonUpstreamEnabled (true | false) [false]`
159159

160-
`OnuAddress (0x01234567) [0x0]`
160+
`OnuAddress (0-4294967296) [0]`
161161

162162
`DynamicOffsetEnabled (true | false) [false]`
163163

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ProgramConfig : public Program
7878
po::bool_switch(&mOptions.dynamicOffsetEnabled),
7979
"Flag to enable the dynamic offset");
8080
options.add_options()("onu-address",
81-
po::value<std::string>(&mOptions.onuAddress)->default_value("0x0"),
81+
po::value<uint32_t>(&mOptions.onuAddress)->default_value(0),
8282
"ONU address for PON upstream");
8383
options.add_options()("config-all",
8484
po::bool_switch(&mOptions.configAll),
@@ -150,7 +150,7 @@ class ProgramConfig : public Program
150150
params.setLinkLoopbackEnabled(mOptions.linkLoopbackEnabled);
151151
params.setPonUpstreamEnabled(mOptions.ponUpstreamEnabled);
152152
params.setDynamicOffsetEnabled(mOptions.dynamicOffsetEnabled);
153-
params.setOnuAddress(strtoul(mOptions.onuAddress.c_str(), NULL, 16));
153+
params.setOnuAddress(mOptions.onuAddress);
154154
params.setTriggerWindowSize(mOptions.triggerWindowSize);
155155

156156
// Generate a configuration file base on the parameters provided
@@ -219,7 +219,7 @@ class ProgramConfig : public Program
219219
bool linkLoopbackEnabled = false;
220220
bool ponUpstreamEnabled = false;
221221
bool dynamicOffsetEnabled = false;
222-
std::string onuAddress = "0x0";
222+
uint32_t onuAddress = 0;
223223
std::string cruId = "0x0";
224224
uint32_t triggerWindowSize = 1000;
225225
} mOptions;

0 commit comments

Comments
 (0)