Lines Matching refs:rand_gen
23 void init(uint8_t &val, RandomGenerator &rand_gen) { in init() argument
24 val = rand_gen.get<uint8_t>(); in init()
27 void init(uint16_t &val, RandomGenerator &rand_gen) { in init() argument
28 val = rand_gen.get<uint16_t>(); in init()
31 void init(uint32_t &val, RandomGenerator &rand_gen) { in init() argument
32 val = rand_gen.get<uint32_t>(); in init()
35 void init(uint64_t &val, RandomGenerator &rand_gen) { in init() argument
36 val = rand_gen.get<uint64_t>(); in init()
39 void init(uint8_t *arr, size_t len, RandomGenerator &rand_gen) { in init() argument
41 arr[i] = rand_gen.get<uint8_t>(); in init()
45 void init_security_mode(uint8_t &sec_mode, RandomGenerator &rand_gen) { in init_security_mode() argument
46 init(sec_mode, rand_gen); in init_security_mode()
50 void init_rssi(int8_t &rssi, RandomGenerator &rand_gen) { in init_rssi() argument
51 rssi = rand_gen.get<int8_t>(); in init_rssi()
57 void init_rpc_log_record(RpcLog &log_record, RandomGenerator &rand_gen) { in init_rpc_log_record() argument
58 log_record = static_cast<RpcLog>((rand_gen.get<uint32_t>() % 6u) + in init_rpc_log_record()
62 void init_frequency(uint32_t &freq, RandomGenerator &rand_gen) { in init_frequency() argument
63 freq = kAllFrequencies_Test[rand_gen.get<uint8_t>() % kNumFrequencies_Test]; in init_frequency()
66 void init_capability(uint16_t &capa, RandomGenerator &rand_gen) { in init_capability() argument
67 capa = (rand_gen.get<uint16_t>() % 0xffff) + 1; in init_capability()
70 void init(wifi_offload::Ssid &ssid, RandomGenerator &rand_gen) { in init() argument
72 size_t len = (rand_gen.get<uint8_t>() % wifi_offload::Ssid::kMaxSsidLen) + 1; in init()
73 init(rand_ssid, len, rand_gen); in init()
77 void init(wifi_offload::PreferredNetwork &net_info, RandomGenerator &rand_gen) { in init() argument
78 init(net_info.ssid_, rand_gen); in init()
79 init_security_mode(net_info.security_modes_, rand_gen); in init()
82 void init(wifi_offload::ScanRecord &record, RandomGenerator &rand_gen) { in init() argument
83 init(record.time_spent_scanning_ms_, rand_gen); in init()
84 init(record.num_channels_scanned_, rand_gen); in init()
85 init(record.num_entries_aggregated_, rand_gen); in init()
88 void init(wifi_offload::RpcLogRecord &record, RandomGenerator &rand_gen) { in init() argument
89 init_rpc_log_record(record.record_type_, rand_gen); in init()
90 init(record.timestamp_chre_ms_, rand_gen); in init()
93 void init(wifi_offload::ChannelHistogram &histo, RandomGenerator &rand_gen) { in init() argument
96 rand_gen.get<uint16_t>()); in init()
100 void init(wifi_offload::ScanStats &stats, RandomGenerator &rand_gen) { in init() argument
101 init(stats.num_scans_requested_by_nanoapp_, rand_gen); in init()
102 init(stats.num_scans_serviced_by_hardware_, rand_gen); in init()
103 init(stats.num_scans_serviced_by_cache_, rand_gen); in init()
104 init(stats.updated_at_chre_ms_, rand_gen); in init()
105 init(stats.sent_at_chre_ms_, rand_gen); in init()
106 init(stats.last_subscription_duration_ms_, rand_gen); in init()
107 init(stats.channel_histogram_, rand_gen); in init()
108 init<wifi_offload::ScanRecord>(stats.scan_records_, rand_gen); in init()
109 init<wifi_offload::RpcLogRecord>(stats.rpc_log_records_, rand_gen); in init()
112 void init(wifi_offload::ScanParams ¶ms, RandomGenerator &rand_gen) { in init() argument
113 init<wifi_offload::Ssid>(params.ssids_to_scan_, rand_gen); in init()
117 size_t vec_len = (rand_gen.get<uint8_t>() % 10) + 1; in init()
120 init_frequency(new_freq, rand_gen); in init()
123 init(params.disconnected_mode_scan_interval_ms_, rand_gen); in init()
126 void init(wifi_offload::ScanFilter &filter, RandomGenerator &rand_gen) { in init() argument
127 init<wifi_offload::PreferredNetwork>(filter.networks_to_match_, rand_gen); in init()
128 init_rssi(filter.min_rssi_threshold_dbm_, rand_gen); in init()
131 void init(wifi_offload::ScanConfig &config, RandomGenerator &rand_gen) { in init() argument
132 init(config.scan_params_, rand_gen); in init()
133 init(config.scan_filter_, rand_gen); in init()
136 void init(wifi_offload::ScanResult &result, RandomGenerator &rand_gen) { in init() argument
137 init(result.ssid_, rand_gen); in init()
138 init_security_mode(result.security_modes_, rand_gen); in init()
139 init(result.bssid_, wifi_offload::ScanResult::kBssidSize, rand_gen); in init()
140 init_capability(result.capability_, rand_gen); in init()
141 init_frequency(result.frequency_scanned_mhz_, rand_gen); in init()
142 init_rssi(result.rssi_dbm_, rand_gen); in init()
143 init(result.tsf_, rand_gen); in init()
146 void init(chreWifiScanResult &result, RandomGenerator &rand_gen) { in init() argument
147 init(result.ageMs, rand_gen); in init()
148 init_capability(result.capabilityInfo, rand_gen); in init()
150 (rand_gen.get<uint8_t>() % wifi_offload::Ssid::kMaxSsidLen) + 1; in init()
151 init(result.ssid, result.ssidLen, rand_gen); in init()
152 init(result.bssid, CHRE_WIFI_BSSID_LEN, rand_gen); in init()
153 init(result.flags, rand_gen); in init()
154 init_rssi(result.rssi, rand_gen); in init()
155 init(result.band, rand_gen); in init()
156 init_frequency(result.primaryChannel, rand_gen); in init()
157 init(result.centerFreqPrimary, rand_gen); in init()
158 init(result.centerFreqSecondary, rand_gen); in init()
160 init_security_mode(result.securityMode, rand_gen); in init()