xref: /aosp_15_r20/external/webrtc/rtc_tools/network_tester/create_network_tester_config.py (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1#!/usr/bin/env python
2# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3#
4# Use of this source code is governed by a BSD-style license
5# that can be found in the LICENSE file in the root of the source
6# tree. An additional intellectual property rights grant can be found
7# in the file PATENTS.  All contributing project authors may
8# be found in the AUTHORS file in the root of the source tree.
9
10import network_tester_config_pb2
11
12
13def AddConfig(all_configs, packet_send_interval_ms, packet_size,
14              execution_time_ms):
15    config = all_configs.configs.add()
16    config.packet_send_interval_ms = packet_send_interval_ms
17    config.packet_size = packet_size
18    config.execution_time_ms = execution_time_ms
19
20
21def main():
22    all_configs = network_tester_config_pb2.NetworkTesterAllConfigs()
23    AddConfig(all_configs, 10, 50, 200)
24    AddConfig(all_configs, 10, 100, 200)
25    with open("network_tester_config.dat", 'wb') as f:
26        f.write(all_configs.SerializeToString())
27
28
29if __name__ == "__main__":
30    main()
31