コード例 #1
0
    def ReadValue(self, options):
        logging.debug('Read WiFi Services')
        wifiSsids = wifi_services_pb2.wifi_services_v1()

        for network in wifiCache:
            if (network.ssid != "--"):
                wifiSsids.services.append(str(network.ssid))
                logging.debug(str(network.ssid))
        value = []
        val = wifiSsids.SerializeToString()

        for c in val:
            value.append(dbus.Byte(c))
        return value
コード例 #2
0
    def ReadValue(self, options):
        logging.debug('Read WiFi CONFIGURED Services')
        wifiConfigured = wifi_services_pb2.wifi_services_v1()

        for network in wifiCache:
            if (network.ssid != "--"):
                if (network.in_use):
                    activeConnection = str(network.ssid)
                    wifiConfigured.services.append(activeConnection)
                    print(activeConnection)
        value = []
        val = wifiConfigured.SerializeToString()

        for c in val:
            value.append(dbus.Byte(c))
        return value
コード例 #3
0
ファイル: config_program.py プロジェクト: ryanteck/hm-config
    def ReadValue(self, options):
        logging.debug('Read WiFi Services')
        wifiSsids = wifi_services_pb2.wifi_services_v1()

        for network in wifiCache:
            ssidStr = str(network.ssid)
            if(ssidStr != "--" and ssidStr != ""):
                if(ssidStr not in wifiSsids.services):
                    wifiSsids.services.append(ssidStr)
                    logging.debug(ssidStr)
        value = []
        val = wifiSsids.SerializeToString()

        for c in val:
            value.append(dbus.Byte(c))
        if("offset" in options):
            cutDownArray = value[int(options["offset"]):]
            return cutDownArray
        else:
            return value