def __init__(self, ip_address=None, shield_name=None, sample_rate=None, log=True, timeout=3, max_packets_to_skip=20, latency=10000, high_speed=True, ssdp_attempts=5, num_channels=8, local_ip_address=None):
    self.daisy = False
    self.gains = None
    self.high_speed = high_speed
    self.impedance = False
    self.ip_address = ip_address
    self.latency = latency
    self.log = log
    self.max_packets_to_skip = max_packets_to_skip
    self.num_channels = num_channels
    self.sample_rate = sample_rate
    self.shield_name = shield_name
    self.ssdp_attempts = ssdp_attempts
    self.streaming = False
    self.timeout = timeout
    self.board_type = 'none'
    self.eeg_channels_per_sample = 0
    self.read_state = 0
    self.log_packet_count = 0
    self.packets_dropped = 0
    self.time_last_packet = 0
    if self.log:
        print('Welcome to OpenBCI Native WiFi Shield Driver - Please contribute code!')
    self.local_ip_address = local_ip_address
    if (not self.local_ip_address):
        self.local_ip_address = self._get_local_ip_address()
    self.local_wifi_server = WiFiShieldServer(self.local_ip_address, 0)
    self.local_wifi_server_port = self.local_wifi_server.socket.getsockname()[1]
    if self.log:
        print(('Opened socket on %s:%d' % (self.local_ip_address, self.local_wifi_server_port)))
    if (ip_address is None):
        for i in range(ssdp_attempts):
            try:
                self.find_wifi_shield(wifi_shield_cb=self.on_shield_found)
                break
            except OSError:
                if self.log:
                    print('Did not find any WiFi Shields')
    else:
        self.on_shield_found(ip_address)
def __init__(self, ip_address=None, shield_name=None, sample_rate=None, log=True, timeout=3, max_packets_to_skip=20, latency=10000, high_speed=True, ssdp_attempts=5, num_channels=8, local_ip_address=None):
    self.daisy = False
    self.gains = None
    self.high_speed = high_speed
    self.impedance = False
    self.ip_address = ip_address
    self.latency = latency
    self.log = log
    self.max_packets_to_skip = max_packets_to_skip
    self.num_channels = num_channels
    self.sample_rate = sample_rate
    self.shield_name = shield_name
    self.ssdp_attempts = ssdp_attempts
    self.streaming = False
    self.timeout = timeout
    self.board_type = 'none'
    self.eeg_channels_per_sample = 0
    self.read_state = 0
    self.log_packet_count = 0
    self.packets_dropped = 0
    self.time_last_packet = 0
    if self.log:
        print('Welcome to OpenBCI Native WiFi Shield Driver - Please contribute code!')
    self.local_ip_address = local_ip_address
    if (not self.local_ip_address):
        self.local_ip_address = self._get_local_ip_address()
    self.local_wifi_server = WiFiShieldServer(self.local_ip_address, 0)
    self.local_wifi_server_port = self.local_wifi_server.socket.getsockname()[1]
    if self.log:
        print(('Opened socket on %s:%d' % (self.local_ip_address, self.local_wifi_server_port)))
    if (ip_address is None):
        for i in range(ssdp_attempts):
            try:
                self.find_wifi_shield(wifi_shield_cb=self.on_shield_found)
                break
            except OSError:
                if self.log:
                    print('Did not find any WiFi Shields')
    else:
        self.on_shield_found(ip_address)