Trigger the wifi interface to scan.
778570
def scan(self):
        """"""

        self._logger.info("iface '%s' scans", self.name())

        self._wifi_ctrl.scan(self._raw_obj)
749503
def trigger_callback(meth, wi_or_msg, err=nil)

      wi, msg, err = if err
        [ wi_or_msg['workitem'], wi_or_msg, err ]
      elsif wi_or_msg['workitem']
        [ wi_or_msg['workitem'], wi_or_msg, nil ]
      else
        [ wi_or_msg, nil, nil ]
      end

      pinfo =
        h.participant ||
        @context.plist.lookup_info(h.participant_name, wi)

      pa = @context.plist.instantiate(pinfo, :if_respond_to? => meth)

      return nil unless pa

      args = { 'workitem' => Ruote::Workitem.new(wi) }
      args['error'] = err if err
      args['msg'] = msg if msg

      Ruote.participant_send(pa, meth, args)
    end
503903
def intialize(self):
        """"""
        print '%s call intialize' % self.port
        try:
            self.deviceConnected = False

            # init serial port
            self._connect()

            if self.firmwarePrefix in self.UIStatusMsg:
                self.deviceConnected = True
            else:
                self.UIStatusMsg = "Firmware Not Matching Expecting " + self.firmwarePrefix + " Now is " + self.UIStatusMsg
                ModuleHelper.WriteIntoDebugLogger("Err: OpenThread device Firmware not matching..")

        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger("intialize() Error: " + str(e))
            self.deviceConnected = False
954305
def setSSID(self, ssid, wifiInterfaceId=1, timeout=1):
        
        namespace = Wifi.getServiceType("setChannel") + str(wifiInterfaceId)
        uri = self.getControlURL(namespace)

        self.execute(uri, namespace, "SetChannel", timeout=timeout, NewSSID=ssid)
1335878
def start (self):
        """"""
        values = self._defn.name, self.server_host, self.server_port
        log.info('Listening for %s telemetry on %s:%d (UDP)' % values)
        super(UdpTelemetryServer, self).start()
1047804
def _wait_trigger(self):
        """"""
        if _debug: IOQController._debug("_wait_trigger")

        # make sure we are waiting
        if (self.state != CTRL_WAITING):
            raise RuntimeError("not waiting")

        # change our state
        self.state = CTRL_IDLE
        _statelog.debug("%s %s %s" % (_strftime(), self.name, "idle"))

        # look for more to do
        IOQController._trigger(self)
1269975
def trigger(self, *args, **kwargs):
        """"""
        for h in self.handlers:
            h(*args, **kwargs)
942956
def scan():
    '''
    
    '''
    ret = []
    devices = bluetooth.discover_devices(lookup_names=True)
    for device in devices:
        ret.append({device[0]: device[1]})
    return ret
319984
def detect(self):
        """"""
        if self.opts_family == AF_INET6:
            kind = IPV6_PUBLIC
        else:  # 'INET':
            kind = IPV4
        theip = None
        try:
            theip = detect_ip(kind)
        except GetIpException:
            LOG.exception("socket detector raised an exception:")
        self.set_current_value(theip)
        return theip
49683
def trigger(self):
        """"""
        if _debug: IOCB._debug("trigger(%d)", self.ioID)

        # if it's queued, remove it from its queue
        if self.ioQueue:
            if _debug: IOCB._debug("    - dequeue")
            self.ioQueue.remove(self)

        # if there's a timer, cancel it
        if self.ioTimeout:
            if _debug: IOCB._debug("    - cancel timeout")
            self.ioTimeout.suspend_task()

        # set the completion event
        self.ioComplete.set()
        if _debug: IOCB._debug("    - complete event set")

        # make the callback(s)
        for fn, args, kwargs in self.ioCallback:
            if _debug: IOCB._debug("    - callback fn: %r %r %r", fn, args, kwargs)
            fn(self, *args, **kwargs)
538269
def setChannel(self, channel, wifiInterfaceId=1, timeout=1):
        
        namespace = Wifi.getServiceType("setChannel") + str(wifiInterfaceId)
        uri = self.getControlURL(namespace)

        self.execute(uri, namespace, "SetChannel", timeout=timeout, NewChannel=channel)
829342
def scan(self):
        """"""
        devices = []
        diff = 65
        rom = False
        count = 0
        for _ in range(0xff):
            rom, diff = self._search_rom(rom, diff)
            if rom:
                count += 1
                if count > self.maximum_devices:
                    raise RuntimeError(
                        "Maximum device count of {} exceeded."\
                        .format(self.maximum_devices))
                devices.append(OneWireAddress(rom))
            if diff == 0:
                break
        return devices
416488
def listen(self, callback=None, timeout=(5, 300)):
        """"""
        if self._running:
            return False
        # if self.devices() is False:
        #    return False
        self._queue = Queue()
        self._running = True
        self._timeout = timeout
        self._callback_listen = callback
        threading.Thread(target=self._thread_listen, args=()).start()
        threading.Thread(target=self._thread_worker, args=()).start()
        return True
560567
def set_scanner_alert_threshold(self, scanner_ids, alert_threshold):
        """"""
        for scanner_id in scanner_ids:
            self.logger.debug('Setting alert threshold for scanner {0} to {1}'.format(scanner_id, alert_threshold))
            result = self.zap.ascan.set_scanner_alert_threshold(scanner_id, alert_threshold)
            if result != 'OK':
                raise ZAPError('Error setting alert threshold for scanner with ID {0}: {1}'.format(scanner_id, result))
575173
@RequiresPermission(ACCESS_WIFI_STATE)
  public static Observable<WifiSignalLevel> observeWifiSignalLevel(final Context context) {
    return observeWifiSignalLevel(context, WifiSignalLevel.getMaxLevel()).map(
        new Function<Integer, WifiSignalLevel>() {
          @Override public WifiSignalLevel apply(Integer level) throws Exception {
            return WifiSignalLevel.fromLevel(level);
          }
        });
  }
264864
def connect(self):
        """"""
        if not self.connected:
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.socket.connect(self.address)
            self.connected = True
1301345
def scan(self):
        """"""
        try:
            res = subprocess.check_output(["hcitool", "scan", "--flush"],
                                          stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError:
             raise BackendError("'hcitool scan' returned error. Make sure "
                                "your bluetooth device is powered up with "
                                "'hciconfig hciX up'.")

        devices = []
        res = res.splitlines()[1:]
        for _, bdaddr, name in map(lambda l: l.split(b"\t"), res):
            devices.append((bdaddr.decode("utf8"), name.decode("utf8")))

        return devices