Skip to content

Commit e1d4bf9

Browse files
committed
[airos] added radio blob configuration and updated radio converter
1 parent c31c4f5 commit e1d4bf9

2 files changed

Lines changed: 63 additions & 6 deletions

File tree

netjsonconfig/backends/airos/converters.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .interface import bridge, bssid, hidden_ssid, protocol, radio, ssid, wireless
88
from .radius import radius_from_interface
99
from .schema import default_ntp_servers
10+
from .radio import radio_device_base, radio_configuration
1011
from .wpasupplicant import available_mode_authentication
1112

1213

@@ -353,14 +354,16 @@ def to_intermediate(self):
353354
original = get_copy(self.netjson, self.netjson_key, [])
354355
radios = []
355356
for r in original:
356-
radios.append({
357+
base = radio_device_base.copy()
358+
user_configs = {
357359
'devname': r['name'],
358-
'status': status(r),
359-
'txpower': r.get('tx_power', ''),
360-
'chanbw': r.get('channel_width', ''),
361-
})
360+
'txpower': r.get('tx_power', 24),
361+
'chanbw': r.get('channel_width', 0),
362+
}
363+
base.update(user_configs)
364+
radios.append(base)
362365
result.append(radios)
363-
result.append({'status': 'enabled'})
366+
result.append(radio_configuration)
364367
return (('radio', result),)
365368

366369

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
radio_device_base = {
2+
'ack': {'auto': 'enabled'},
3+
'ackdistance': 643,
4+
'acktimeout': 35,
5+
'ampdu': {
6+
'frames': 32,
7+
'status': 'enabled',
8+
},
9+
'antenna': {
10+
'gain': 3,
11+
'id': 2,
12+
},
13+
'atpc': {
14+
'sta.status': 'enabled',
15+
'status': 'disabled',
16+
'threshold': 36,
17+
},
18+
'cable': {'loss': 0},
19+
'center': [{'freq': 0}],
20+
'chanbw': 0,
21+
'cmsbias': 0,
22+
'countrycode': 380,
23+
'cwm': {
24+
'enable': 0,
25+
'mode': 1,
26+
},
27+
'devname': 'ath0',
28+
'dfs': {'status': 'enabled'},
29+
'freq': 0,
30+
'ieee_mode': 'auto',
31+
'low_txpower_mode': 'disabled',
32+
'mode': 'managed', # ap => master, sta => managed
33+
'obey': 'enabled',
34+
'polling': 'enabled',
35+
'polling_11ac_11n_compat': 0,
36+
'polling_ff_dl_ratio': 50,
37+
'polling_ff_dur': 0,
38+
'polling_ff_timing': 0,
39+
'pollingnoack': 0,
40+
'pollingpri': 2,
41+
'ptpmode': 1,
42+
'reg_obey': 'enabled',
43+
'rx_sensitivity': -96,
44+
'scan_list': {'status': 'disabled'},
45+
'scanbw': {'status': 'disabled'},
46+
'status': 'enabled', # cannot disable
47+
'subsystemid': 0xe7f5,
48+
'txpower': 24,
49+
}
50+
51+
radio_configuration = {
52+
'status': 'enabled',
53+
'countrycode': 380,
54+
}

0 commit comments

Comments
 (0)