Add primary/secondary role for multi-instance setup

This commit is contained in:
Vasily Evseenko 2022-11-30 14:46:03 +03:00
parent 2bb5791a14
commit e2fbeae9ac
2 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@ debug = False
version = '0.0.1.trunk'
commit = None
primary = True # Set to False if you use several wfb instances on one card. Only primary instance will set radio channel.
log_file = None # Set to "wifibroadcast.log" to disable log to stdout
link_id = "default" # It will be hashed and mapped to three bytes of MAC
# You can use different link ids for multi-vehicle setup without stream remapping.

View File

@ -264,6 +264,10 @@ def init_wlans(profile, wlans):
else:
raise Exception('Unsupported bandwith %d MHz' % (max_bw,))
if not settings.common.primary:
log.msg('Skip card init due to secondary role')
return
try:
yield call_and_check_rc('iw', 'reg', 'set', settings.common.wifi_region)
for wlan in wlans: