def set_channel_settings(self, channel, enabled=True, gain=24, input_type=0, include_bias=True, use_srb2=True, use_srb1=True):
    try:
        if (channel > self.num_channels):
            raise ValueError('Cannot set non-existant channel')
        if (self.board_type == k.BOARD_GANGLION):
            raise ValueError('Cannot use with Ganglion')
        ch_array = list('12345678QWERTYUI')
        command = list('x1060110X')
        command[1] = ch_array[(channel - 1)]
        if (not enabled):
            command[2] = '1'
        if (gain == 1):
            command[3] = '0'
        if (gain == 2):
            command[3] = '1'
        if (gain == 4):
            command[3] = '2'
        if (gain == 6):
            command[3] = '3'
        if (gain == 8):
            command[3] = '4'
        if (gain == 12):
            command[3] = '5'
        if (not include_bias):
            command[5] = '0'
        if (not use_srb2):
            command[6] = '0'
        if use_srb1:
            command[6] = '1'
        command_send = ''.join(command)
        self.wifi_write(command_send)
        self.gains[(channel - 1)] = gain
        self.local_wifi_server.set_gains(gains=self.gains)
        self.local_wifi_server.set_parser(ParseRaw(gains=self.gains, board_type=self.board_type))
    except ValueError as e:
        print(('Something went wrong while setting channel settings: ' + str(e)))
def set_channel_settings(self, channel, enabled=True, gain=24, input_type=0, include_bias=True, use_srb2=True, use_srb1=True):
    try:
        if (channel > self.num_channels):
            raise ValueError('Cannot set non-existant channel')
        if (self.board_type == k.BOARD_GANGLION):
            raise ValueError('Cannot use with Ganglion')
        ch_array = list('12345678QWERTYUI')
        command = list('x1060110X')
        command[1] = ch_array[(channel - 1)]
        if (not enabled):
            command[2] = '1'
        if (gain == 1):
            command[3] = '0'
        if (gain == 2):
            command[3] = '1'
        if (gain == 4):
            command[3] = '2'
        if (gain == 6):
            command[3] = '3'
        if (gain == 8):
            command[3] = '4'
        if (gain == 12):
            command[3] = '5'
        if (not include_bias):
            command[5] = '0'
        if (not use_srb2):
            command[6] = '0'
        if use_srb1:
            command[6] = '1'
        command_send = .join(command)
        self.wifi_write(command_send)
        self.gains[(channel - 1)] = gain
        self.local_wifi_server.set_gains(gains=self.gains)
        self.local_wifi_server.set_parser(ParseRaw(gains=self.gains, board_type=self.board_type))
    except ValueError as e:
        print(('Something went wrong while setting channel settings: ' + str(e)))