Changeset 13564 in genesis for tools/gformat.py


Ignore:
Timestamp:
Mar 18, 2016, 9:27:03 PM (9 years ago)
Author:
rick
Message:

Support spaces in SSID, by using hex encoding, since escaping is a quote-hell.

Fixes RT#65

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13551 r13564  
    684684        ifacedump['autogen_extra'] = ifacedump['extra']
    685685       
     686      ifacedump['autogen_ssid_hex'] = '0x' + ''.join(x.encode('hex') for x in ifacedump['ssid'])
     687
    686688      output += "wlans_%(autogen_ifbase)s='%(autogen_ifname)s'\n" % ifacedump
     689      output += "# SSID is encoded in Hexadecimal to support spaces, plain text value is '%(ssid)s'\n" % ifacedump
    687690      output += ("create_args_%(autogen_ifname)s=\"wlanmode %(autogen_wlanmode)s mode " +\
    688         "%(type)s ssid \\\"%(ssid)s\\\" %(autogen_extra)s channel %(channel)s\"\n") % ifacedump
     691        "%(type)s ssid %(autogen_ssid_hex)s %(autogen_extra)s channel %(channel)s\"\n") % ifacedump
    689692      output += "\n"
    690693
Note: See TracChangeset for help on using the changeset viewer.