How to use the openweave.WeaveDeviceMgr.WiFiSecurityType_None function in openweave

To help you get started, we’ve selected a few openweave examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openweave / openweave-core / src / test-apps / happy / lib / WeaveDeviceManager.py View on Github external
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,
    wifiRole = WeaveDeviceMgr.WiFiRole_Station,
    wifiSecurityType = WeaveDeviceMgr.WiFiSecurityType_None)

    try:
        addResult = devMgr.AddNetwork(networkInfo)
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print ex
        exit()

    lastNetworkId = addResult

    print "Add wifi network complete (network id = " + str(addResult) + ")"

    print ''
    print  '#################################update-network#################################'

    # networkInfo = WeaveDeviceMgr.NetworkInfo(networkId=lastNetworkId)
github openweave / openweave-core / src / test-apps / happy / lib / WeaveDeviceManager.py View on Github external
lastNetworkId = addResult

    print "Add wifi network complete (network id = " + str(addResult) + ")"

    print ''
    print  '#################################update-network#################################'

    # networkInfo = WeaveDeviceMgr.NetworkInfo(networkId=lastNetworkId)

    networkInfo = WeaveDeviceMgr.NetworkInfo(
    networkType = WeaveDeviceMgr.NetworkType_WiFi,
    networkId=lastNetworkId,
    wifiSSID = "Wireless-1",
    wifiMode = WeaveDeviceMgr.WiFiMode_Managed,
    wifiRole = WeaveDeviceMgr.WiFiRole_Station,
    wifiSecurityType = WeaveDeviceMgr.WiFiSecurityType_None)

    try:
        devMgr.UpdateNetwork(networkInfo)
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
        exit()

    print "Update network complete"

    print ''
    print  '#################################disable-network#################################'

    try:
        devMgr.DisableNetwork(lastNetworkId)
    except WeaveDeviceMgr.DeviceManagerException, ex:
        print str(ex)
github openweave / openweave-core / src / device-manager / python / weave-device-mgr.py View on Github external
print "Please specify WiFI security type"
            return

        securityType = WeaveDeviceMgr.ParseSecurityType(args[1])
        if (securityType == None):
            print "Unrecognized security type: " + args[1]
            return

        networkInfo = WeaveDeviceMgr.NetworkInfo(
            networkType = WeaveDeviceMgr.NetworkType_WiFi,
            wifiSSID = args[0],
            wifiMode = WeaveDeviceMgr.WiFiMode_Managed,
            wifiRole = WeaveDeviceMgr.WiFiRole_Station,
            wifiSecurityType = securityType)

        if (securityType != WeaveDeviceMgr.WiFiSecurityType_None):
            if (len(args) < 3):
                print "Must supply WiFi key"
                return
            if (len(args) > 3):
                print "Unexpected argument: " + args[3]
                return
            networkInfo.WiFiKey = args[2]
        elif (len(args) > 2):
            print "Unexpected argument: " + args[2]
            return

        try:
            addResult = self.devMgr.AddNetwork(networkInfo)
        except WeaveDeviceMgr.DeviceManagerException, ex:
            print str(ex)
            return