def __init__(self, conn):
self._ed_mode = None<EOL>self._std_status = None<EOL>self._device_id = None<EOL>self.conn = conn<EOL>general_config_table = conn.get_table_data(GEN_CONFIG_TBL)<EOL>general_mfg_table = conn.get_table_data(GENERAL_MFG_ID_TBL)<EOL>try:<EOL><INDENT>mode_status_table = conn.get_table_data(ED_MODE_STATUS_TBL)<EOL><DEDENT>except C1218ReadTableError:<EOL><INDENT>mode_status_table = None<EOL><DEDENT>try:<EOL><INDENT>ident_table = conn.get_table_data(DEVICE_IDENT_TBL)<EOL><DEDENT>except C1218ReadTableError:<EOL><INDENT>ident_table = None<EOL><DEDENT>if len(general_config_table) < <NUM_LIT>:<EOL><INDENT>raise C1219ParseError('<STR_LIT>', GEN_CONFIG_TBL)<EOL><DEDENT>if len(general_mfg_table) < <NUM_LIT>:<EOL><INDENT>raise C1219ParseError('<STR_LIT>', GENERAL_MFG_ID_TBL)<EOL><DEDENT>if mode_status_table and len(mode_status_table) < <NUM_LIT:5>:<EOL><INDENT>raise C1219ParseError('<STR_LIT>', ED_MODE_STATUS_TBL)<EOL><DEDENT>self._char_format = {<NUM_LIT:1>: '<STR_LIT>', <NUM_LIT:2>: '<STR_LIT>', <NUM_LIT:3>: '<STR_LIT>', <NUM_LIT:4>: '<STR_LIT>', <NUM_LIT:5>: '<STR_LIT>'}.get((general_config_table[<NUM_LIT:0>] & <NUM_LIT>) >> <NUM_LIT:1>) or '<STR_LIT>'<EOL>encoding = self.encoding<EOL>self._nameplate_type = {<NUM_LIT:0>: '<STR_LIT>', <NUM_LIT:1>: '<STR_LIT>', <NUM_LIT:2>: '<STR_LIT>'}.get(general_config_table[<NUM_LIT:7>]) or '<STR_LIT>'<EOL>self._id_form = general_config_table[<NUM_LIT:1>] & <NUM_LIT:32><EOL>self._std_version_no = general_config_table[<NUM_LIT:11>]<EOL>self._std_revision_no = general_config_table[<NUM_LIT:12>]<EOL>self._dim_std_tables_used = general_config_table[<NUM_LIT>]<EOL>self._dim_mfg_tables_used = general_config_table[<NUM_LIT>]<EOL>self._dim_std_proc_used = general_config_table[<NUM_LIT:15>]<EOL>self._dim_mfg_proc_used = general_config_table[<NUM_LIT:16>]<EOL>self._std_tables_used = []<EOL>tmp_data = general_config_table[<NUM_LIT>:]<EOL>for p in range(self._dim_std_tables_used):<EOL><INDENT>for i in range(<NUM_LIT:7>):<EOL><INDENT>if tmp_data[p] & (<NUM_LIT:2> ** i):<EOL><INDENT>self._std_tables_used.append(i + (p * <NUM_LIT:8>))<EOL><DEDENT><DEDENT><DEDENT>self._mfg_tables_used = []<EOL>tmp_data = tmp_data[self._dim_std_tables_used:]<EOL>for p in range(self._dim_mfg_tables_used):<EOL><INDENT>for i in range(<NUM_LIT:7>):<EOL><INDENT>if tmp_data[p] & (<NUM_LIT:2> ** i):<EOL><INDENT>self._mfg_tables_used.append(i + (p * <NUM_LIT:8>))<EOL><DEDENT><DEDENT><DEDENT>self._std_proc_used = []<EOL>tmp_data = tmp_data[self._dim_mfg_tables_used:]<EOL>for p in range(self._dim_std_proc_used):<EOL><INDENT>for i in range(<NUM_LIT:7>):<EOL><INDENT>if tmp_data[p] & (<NUM_LIT:2> ** i):<EOL><INDENT>self._std_proc_used.append(i + (p * <NUM_LIT:8>))<EOL><DEDENT><DEDENT><DEDENT>self._mfg_proc_used = []<EOL>tmp_data = tmp_data[self._dim_std_proc_used:]<EOL>for p in range(self._dim_mfg_proc_used):<EOL><INDENT>for i in range(<NUM_LIT:7>):<EOL><INDENT>if tmp_data[p] & (<NUM_LIT:2> ** i):<EOL><INDENT>self._mfg_proc_used.append(i + (p * <NUM_LIT:8>))<EOL><DEDENT><DEDENT><DEDENT>self._manufacturer = general_mfg_table[<NUM_LIT:0>:<NUM_LIT:4>].rstrip().decode(encoding)<EOL>self._ed_model = general_mfg_table[<NUM_LIT:4>:<NUM_LIT:12>].rstrip().decode(encoding)<EOL>self._hw_version_no = general_mfg_table[<NUM_LIT:12>]<EOL>self._hw_revision_no = general_mfg_table[<NUM_LIT>]<EOL>self._fw_version_no = general_mfg_table[<NUM_LIT>]<EOL>self._fw_revision_no = general_mfg_table[<NUM_LIT:15>]<EOL>if self._id_form == <NUM_LIT:0>:<EOL><INDENT>self._mfg_serial_no = general_mfg_table[<NUM_LIT:16>:<NUM_LIT:32>].strip()<EOL><DEDENT>else:<EOL><INDENT>self._mfg_serial_no = general_mfg_table[<NUM_LIT:16>:<NUM_LIT>]<EOL><DEDENT>self._mfg_serial_no = self._mfg_serial_no.decode(encoding)<EOL>if mode_status_table:<EOL><INDENT>self._ed_mode = mode_status_table[<NUM_LIT:0>]<EOL>self._std_status = struct.unpack(conn.c1219_endian + '<STR_LIT:H>', mode_status_table[<NUM_LIT:1>:<NUM_LIT:3>])[<NUM_LIT:0>]<EOL><DEDENT>if ident_table:<EOL><INDENT>if self._id_form == <NUM_LIT:0> and len(ident_table) != <NUM_LIT:20>:<EOL><INDENT>raise C1219ParseError('<STR_LIT>', DEVICE_IDENT_TBL)<EOL><DEDENT>elif self._id_form != <NUM_LIT:0> and len(ident_table) != <NUM_LIT:10>:<EOL><INDENT>raise C1219ParseError('<STR_LIT>', DEVICE_IDENT_TBL)<EOL><DEDENT>self._device_id = ident_table.strip().decode(encoding)<EOL><DEDENT>
Initializes a new instance of the class and reads tables from the
corresponding decades to populate information.

@type conn: c1218.connection.Connection
@param conn: The driver to be used for interacting with the
necessary tables.