<s> from ztag . annotation import * <EOL> class ComputecOYMEIDevice ( Annotation ) : <EOL> protocol = protocols . MODBUS <EOL> subprotocol = protocols . MODBUS . DEVICE_ID <EOL> port = None <EOL> tests = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : Manufacturer . COMPUTEC , <EOL> } <EOL> } <EOL> } <EOL> def process ( self , obj , meta ) : <EOL> vendor = obj [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ "<STR_LIT>" ] . lower ( ) <EOL> if "<STR_LIT>" in vendor : <EOL> meta . global_metadata . manufacturer = Manufacturer . COMPUTEC <EOL> return meta <EOL> class ComputecController ( Annotation ) : <EOL> protocol = protocols . MODBUS <EOL> subprotocol = protocols . MODBUS . DEVICE_ID <EOL> port = None <EOL> tests = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : Manufacturer . COMPUTEC , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : Type . SCADA_CONTROLLER , <EOL> } <EOL> } <EOL> } <EOL> def process ( self , obj , meta ) : <EOL> mei_objs = obj [ "<STR_LIT>" ] [ "<STR_LIT>" ] <EOL> vendor = mei_objs [ "<STR_LIT>" ] <EOL> product_code = mei_objs [ "<STR_LIT>" ] <EOL> if "<STR_LIT>" not in vendor . lower ( ) : <EOL> return <EOL> if "<STR_LIT>" not in product_code . lower ( ) : <EOL> return <EOL> meta . global_metadata . manufacturer = Manufacturer . COMPUTEC <EOL> meta . global_metadata . product = product_code . rstrip ( ) <EOL> meta . global_metadata . revision = mei_objs . get ( "<STR_LIT>" , None ) <EOL> meta . global_metadata . device_type = Type . SCADA_CONTROLLER <EOL> return meta </s>
