def start_pin(self, *args):
logger.debug("start_pin")
- bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex'))
+ bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode()))
wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670',
'Bssid': bssid_ay})
return False
def start_pin(self, *args):
logger.debug("start_pin")
- bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex'))
+ bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode()))
res = wps.Start({'Role': 'enrollee', 'Type': 'pin',
'Bssid': bssid_ay})
pin = res['Pin']
def start_pin(self, *args):
logger.debug("start_pin")
- bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex'))
+ bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode()))
wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670',
'Bssid': bssid_ay})
return False
def start_reg(self, *args):
logger.debug("start_reg")
- bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex'))
+ bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode()))
wps.Start({'Role': 'registrar', 'Type': 'pin',
'Pin': '12345670', 'Bssid': bssid_ay})
return False
wps.Cancel()
dev[0].scan_for_bss(bssid, freq="2412")
- bssid_ay = dbus.ByteArray(bssid.replace(':','').decode('hex'))
+ bssid_ay = dbus.ByteArray(binascii.unhexlify(bssid.replace(':','').encode()))
wps.Start({'Role': 'enrollee', 'Type': 'pin', 'Pin': '12345670',
'Bssid': bssid_ay})
wps.Cancel()
def to_hex(s):
return binascii.hexlify(s.encode()).decode()
+def from_hex(s):
+ return binascii.unhexlify(s).decode()
+
def sigma_dut_cmd(cmd, port=9000, timeout=2):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM,
socket.IPPROTO_TCP)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
if not resp_pending:
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
cmd = "DPP_CONFIGURATOR_ADD"
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)
if "status,COMPLETE" not in res:
raise Exception("dev_exec_action did not succeed: " + res)
hex = res.split(',')[3]
- uri = hex.decode('hex')
+ uri = from_hex(hex)
logger.info("URI from sigma_dut: " + uri)
res = dev[1].request("DPP_QR_CODE " + uri)