Skip to content

Commit abb7eca

Browse files
author
Ritwick DSouza
committed
[raspbian] Added support for 802.11ac
1 parent 697c52c commit abb7eca

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

netjsonconfig/backends/raspbian/converters/wireless.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ def to_intermediate(self):
3535
def _get_hwmode(self, radio):
3636
protocol = radio['protocol']
3737
if protocol in ['802.11a', '802.11b', '802.11g']:
38-
return protocol[1:]
39-
if radio['channel'] is 0:
40-
return radio.get('hwmode')
38+
return protocol[-1:]
4139
elif radio['channel'] <= 13:
4240
return 'g'
4341
else:

netjsonconfig/backends/raspbian/templates/hostapd.jinja2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
# config: /etc/hostapd/hostapd.conf
55
interface={{ wireless.get('ifname') }}
66
driver=nl80211
7+
{% if wireless.get('protocol') == 'a' or 'b' or 'g' %}
78
hw_mode={{ wireless.get('hwmode')}}
9+
{% endif %}
810
channel={{ wireless.get('channel')}}
911
{% if wireless.get('protocol') == '80211n' %}
1012
ieee80211n=1
1113
{% endif %}
14+
{% if wireless.get('protocol') == '80211ac' %}
15+
ieee80211ac=1
16+
{% endif %}
1217
ssid={{ wireless.get('ssid') }}
1318
{% if wireless.get('encryption') != {} %}
1419
auth_algs={{ wireless.get('encryption').get('auth_algs') }}

0 commit comments

Comments
 (0)