A ZigBee client, handling higher level functions relating to the ZigBee
network.
interface responsible for communicating with the ZigBee SOC.
350829
function ZNPClient(config) {
  this._devices = {};

  this.config = config;

  if (!config || !config.panId) {
    throw new Error('You must set "panId" on ZNPClient config');
  }

  this.comms = new ZNPSerial();

  // Device state notifications
  this.comms.on('command:ZDO_STATE_CHANGE_IND', this._handleStateChange.bind(this));

  // Device announcements
  this.comms.on('command:ZDO_END_DEVICE_ANNCE_IND', this._handleDeviceAnnounce.bind(this));

  // Device endpoint responses
  this.comms.on('command:ZDO_MATCH_DESC_RSP', this._handleDeviceMatchDescriptionResponse.bind(this));
  this.comms.on('command:ZDO_ACTIVE_EP_RSP', this._handleDeviceMatchDescriptionResponse.bind(this));

  // Endpoint description responses
  this.comms.on('command:ZDO_SIMPLE_DESC_RSP', this._handleEndpointSimpleDescriptorResponse.bind(this));

  // Application framework (ZCL) messages
  this.comms.on('command:AF_INCOMING_MSG', this._handleAFIncomingMessage.bind(this));
}
123262
function(client) {
		this.client = client;
		if(gui.hasModule('gui-spirits@wunderbyte.com')) {
			if(client instanceof gui.Spirit) {
				this.spirit = client || null;
				this.context = window; // otherwise web worker scenario, maybe deprecate
			}
		}
		this.onconstruct();
	}
790435
def enable_i2c(self):
        
        config = self._interface_configuration(CONFIG_QUERY)
        return config == CONFIG_GPIO_I2C or config == CONFIG_SPI_I2C
1181739
function Communication() {
		// setup abstract layer
		core.CommunicationAbstract.apply(this, arguments);

		// when socket is closed we will emit the close event
		this.object.on('close', this.emit.bind(this, 'close'));

		// setup a json stream handler there rescive data from the TCP socket
		// remember that this.object is the TCP socket
		jsonStream(this, this.object);
	}
1127705
function DiscoveryClientIopaWire(app) {
  if (!app.properties[SERVER.Capabilities][IOPA.CAPABILITIES.Udp])
    throw ("Missing Dependency: UDP Server/Middleware in Pipeline");
  
  if (!app.properties[SERVER.Capabilities][DEVICESMIDDLEWARE.CAPABILITY])
    throw ("Missing Dependency: IOPA Devices Server/Middleware in Pipeline");

  app.properties[SERVER.Capabilities][THISMIDDLEWARE.CAPABILITY] = {};
  app.properties[SERVER.Capabilities][THISMIDDLEWARE.CAPABILITY][SERVER.Version] = packageVersion;

 //Also register as standard IOPA DISCOVERY CLIENT MIDDLEWARE
  app.properties[SERVER.Capabilities][IOPA.CAPABILITIES.DiscoveryClient] = {};
  app.properties[SERVER.Capabilities][IOPA.CAPABILITIES.DiscoveryClient][SERVER.Version] = app.properties[SERVER.Capabilities][IOPA.CAPABILITIES.App][SERVER.Version];

  this.app = app;
  // this._devices = {};
  this._factory = new iopa.Factory();
 
  app.device = app.device || {};
  app.device.probe = this.probe.bind(this, app.device.probe || function(query, cb){return Promise.resolve(null);});
  app.device.resolve = this.resolve.bind(this, app.device.resolve || function(id, cb){return Promise.resolve(null);});
  
  this._client = null;
 }
973776
function _handleConnection(client) {
	client.on('message', curry(_handleMessage, client))
	client.on('disconnect', curry(_handleDisconnect, client))
	client.pubsub = _engine.getPubSub()
	_emitter.emit('client_connect', client)
}
702056
def cli(env, identifier, no_vs, no_hardware):
    """"""

    mgr = SoftLayer.NetworkManager(env.client)

    vlan_id = helpers.resolve_id(mgr.resolve_vlan_ids, identifier, 'VLAN')
    vlan = mgr.get_vlan(vlan_id)

    table = formatting.KeyValueTable(['name', 'value'])
    table.align['name'] = 'r'
    table.align['value'] = 'l'

    table.add_row(['id', vlan['id']])
    table.add_row(['number', vlan['vlanNumber']])
    table.add_row(['datacenter',
                   vlan['primaryRouter']['datacenter']['longName']])
    table.add_row(['primary_router',
                   vlan['primaryRouter']['fullyQualifiedDomainName']])
    table.add_row(['firewall',
                   'Yes' if vlan['firewallInterfaces'] else 'No'])
    subnets = []
    for subnet in vlan.get('subnets', []):
        subnet_table = formatting.KeyValueTable(['name', 'value'])
        subnet_table.align['name'] = 'r'
        subnet_table.align['value'] = 'l'
        subnet_table.add_row(['id', subnet['id']])
        subnet_table.add_row(['identifier', subnet['networkIdentifier']])
        subnet_table.add_row(['netmask', subnet['netmask']])
        subnet_table.add_row(['gateway', subnet.get('gateway', '-')])
        subnet_table.add_row(['type', subnet['subnetType']])
        subnet_table.add_row(['usable ips',
                              subnet['usableIpAddressCount']])
        subnets.append(subnet_table)

    table.add_row(['subnets', subnets])

    server_columns = ['hostname', 'domain', 'public_ip', 'private_ip']

    if not no_vs:
        if vlan.get('virtualGuests'):
            vs_table = formatting.KeyValueTable(server_columns)
            for vsi in vlan['virtualGuests']:
                vs_table.add_row([vsi.get('hostname'),
                                  vsi.get('domain'),
                                  vsi.get('primaryIpAddress'),
                                  vsi.get('primaryBackendIpAddress')])
            table.add_row(['vs', vs_table])
        else:
            table.add_row(['vs', 'none'])

    if not no_hardware:
        if vlan.get('hardware'):
            hw_table = formatting.Table(server_columns)
            for hardware in vlan['hardware']:
                hw_table.add_row([hardware.get('hostname'),
                                  hardware.get('domain'),
                                  hardware.get('primaryIpAddress'),
                                  hardware.get('primaryBackendIpAddress')])
            table.add_row(['hardware', hw_table])
        else:
            table.add_row(['hardware', 'none'])

    env.fout(table)
1336231
function Device (device, sp) {
  if (!(device && sp))
    throw new Error('a Device and a SerialPort must be passed');

  for (var i in device)
    this[i] = device[i];

  this._open = false;
  this._sp = sp;

  EventEmitter.call(this);
}
258440
def HandleNetworkInterfaces(self, result):
    
    network_interfaces = self._ExtractInterfaceMetadata(result)

    if self.network_setup_enabled:
      self.network_setup.EnableNetworkInterfaces(
          [interface.name for interface in network_interfaces[1:]])

    for interface in network_interfaces:
      if self.ip_forwarding_enabled:
        self.ip_forwarding.HandleForwardedIps(
            interface.name, interface.forwarded_ips, interface.ip)
17836
function Device(key, name, children) {
    /**
     * @property key
     * @type {String}
     */
    this.key = key;
    /**
     * @property name
     * @type {String}
     */
    this.name = name;
    /**
     * @propety children
     * @type {Array}
     */
    this.children = children;
    /**
     * @property processChannels
     * @type {Array}
     */
    this.processChannels = [];
}
377169
def connect(self, interface, event, object_path, handler):
        
        if object_path:
            def callback(connection, sender_name, object_path,
                         interface_name, signal_name, parameters):
                return handler(*unpack_variant(parameters))
        else:
            def callback(connection, sender_name, object_path,
                         interface_name, signal_name, parameters):
                return handler(object_path, *unpack_variant(parameters))
        return self.connection.signal_subscribe(
            self.bus_name,
            interface,
            event,
            object_path,
            None,
            Gio.DBusSignalFlags.NONE,
            callback,
        )
407589
function SocketManager(server) {

    /**
     * ### SocketManager.server
     *
     * Cyclic ref to the GameServer object containing this instance
     */
    this.server = server;

    /**
     * ### SocketManager.sockets
     *
     *  List of available sockets
     */
    this.sockets = {};

    /**
     * ### SocketManager.clients
     *
     * Maps a client ID to a socket obj (e.g. Direct or SIO)
     *
     * @see SocketManager.sockets
     */
    this.clients = {};


    this.sysLogger = server.sysLogger;
    this.msgLogger = server.msgLogger;
}
94049
def EnableNetworkInterfaces(self, interfaces):
    
    # The default Ethernet interface is enabled by default. Do not attempt to
    # enable interfaces if only one interface is specified in metadata.
    if not interfaces or set(interfaces) == self.interfaces:
      return

    self.logger.info('Ethernet interfaces: %s.', interfaces)
    self.interfaces = set(interfaces)

    if self.dhcp_command:
      try:
        subprocess.check_call([self.dhcp_command])
      except subprocess.CalledProcessError:
        self.logger.warning('Could not enable Ethernet interfaces.')
      return

    # Distro-specific setup for network interfaces.
    self.distro_utils.EnableNetworkInterfaces(
        interfaces, self.logger, dhclient_script=self.dhclient_script)
209559
function setClientDevice() {
		var iClientId = 0;
		if (Device.system.combi) {
			iClientId = 1;
		} else if (Device.system.desktop) {
			iClientId = 2;
		} else if (Device.system.tablet) {
			iClientId = 4;
		} else if (Device.system.phone) {
			iClientId = 3;
		}
		return iClientId;
	}
1324388
def client(self, container):
        

        self._client_chk.check(container)
        return ContainerClient(self._client, int(container))
1059851
def _connect_to_socket(self, context: zmq.Context, endpoint: str):
        
        socket = context.socket(zmq.DEALER)
        socket.connect(endpoint)
        socket.setsockopt(zmq.LINGER, 0)
        _log.debug("Client connected to endpoint %s", self.endpoint)
        return socket
11106
private void registerInternalChannelsFor(
            String functionalityName,
            IAsyncMessageClient client,
            String conversationID) throws ServiceGroundingException
    {
        InternalChannel ch = new InternalChannel(client);
        this.channelProducersHelper.addChannel(ch, functionalityName, conversationID, conversationID);
        this.channelConsumersHelper.addChannel(ch, functionalityName, conversationID, conversationID);
    }