Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions python_transport/wirepas_gateway/configure_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def configure(
start=None,
authentication_key=None,
cipher_key=None,
diag_interval=None,
):
sink = self.sink_manager.get_sink(sink_name)
if sink is None:
Expand All @@ -165,6 +166,11 @@ def configure(
config["cipher_key"] = cipher_key
if authentication_key is not None:
config["authentication_key"] = authentication_key
if diag_interval is not None:
seq, _, data = sink.proxy.GetAppConfig()
config["app_config_seq"] = seq
config["app_config_diag"] = diag_interval
config["app_config_data"] = bytearray(data)

ret = sink.write_config(config)
print("Configuration done with result = {}".format(ret))
Expand Down Expand Up @@ -337,6 +343,17 @@ def main():
help="Start the sink after configuration",
)

parser.add_argument(
"-d",
"--diag_interval",
type=int_type,
default=get_default_value_from_env("WM_CN_DIAGNOSTIC_INTERVAL"),
help="Diagnostic interval in network expressed in seconds. "
"Ex: -d 60 "
"Note: Value should be one of [0, 30, 60, 120, 300, 600, 1800]. "
"Value 0 means that no diagnostic will be sent.",
)

args = parser.parse_args()

sink_configurator = SinkConfigurator()
Expand All @@ -354,6 +371,7 @@ def main():
start=args.start,
authentication_key=args.authentication_key,
cipher_key=args.cipher_key,
diag_interval=args.diag_interval,
)


Expand Down