def open_device(self): MobileDevice.open_device(self) res = self.send_at_command("AT^PORTSEL=1") if res[2] != "OK" : print "error opening huawei device" res = self.send_at_command("AT+COPS=3,0") if res[2] != "OK" : print "error opening huawei device"