Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
category = 2
elif (category == 'detail'):
category = 3
try:
devMgr.SetLogFilter(category)
except WeaveDeviceMgr.DeviceManagerException, ex:
print str(ex)
exit()
print "Done."
print ''
print '#################################scan-network#################################'
try:
networkType = WeaveDeviceMgr.ParseNetworkType("wifi")
scanResult = devMgr.ScanNetworks(networkType)
except WeaveDeviceMgr.DeviceManagerException, ex:
print ex
print "ScanNetworks complete, %d network(s) found" % (len(scanResult))
i = 1
for net in scanResult:
print " Network %d" % (i)
net.Print(" ")
i = i + 1
try:
networkType = WeaveDeviceMgr.ParseNetworkType("thread")
scanResult = devMgr.ScanNetworks(networkType)
except WeaveDeviceMgr.DeviceManagerException, ex:
print ex
print "ScanNetworks complete, %d network(s) found" % (len(scanResult))
i = 1
print ''
print '#################################scan-network#################################'
try:
networkType = WeaveDeviceMgr.ParseNetworkType("wifi")
scanResult = devMgr.ScanNetworks(networkType)
except WeaveDeviceMgr.DeviceManagerException, ex:
print ex
print "ScanNetworks complete, %d network(s) found" % (len(scanResult))
i = 1
for net in scanResult:
print " Network %d" % (i)
net.Print(" ")
i = i + 1
try:
networkType = WeaveDeviceMgr.ParseNetworkType("thread")
scanResult = devMgr.ScanNetworks(networkType)
except WeaveDeviceMgr.DeviceManagerException, ex:
print ex
print "ScanNetworks complete, %d network(s) found" % (len(scanResult))
i = 1
for net in scanResult:
print " Network %d" % (i)
net.Print(" ")
i = i + 1
print ''
print '#################################add-network#################################'
networkInfo = WeaveDeviceMgr.NetworkInfo(
networkType = WeaveDeviceMgr.NetworkType_WiFi,
wifiSSID = "Wireless-1",
wifiMode = WeaveDeviceMgr.WiFiMode_Managed,
scan-networks
Scan for remote WiFi networks.
"""
args = shlex.split(line)
networkType = WeaveDeviceMgr.NetworkType_WiFi
if (len(args) > 1):
print "Unexpected argument: " + args[1]
return
if (len(args) == 1):
try:
networkType = WeaveDeviceMgr.ParseNetworkType(args[0])
except Exception, ex:
print "Invalid network type: " + args[0]
return
try:
scanResult = self.devMgr.ScanNetworks(networkType)
except WeaveDeviceMgr.DeviceManagerException, ex:
print str(ex)
return
print "ScanNetworks complete, %d network(s) found" % (len(scanResult))
i = 1
for net in scanResult:
print " Network %d" % (i)
net.Print(" ")
i = i + 1