mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 03:03:57 +08:00
* rename android hardware * add tici class * elif * read correct serial number * Update release files * Get IMEI * Refactor AT command * move get_cmdline into base class * Remove unused import * Small cleanup
42 lines
728 B
Python
42 lines
728 B
Python
from abc import abstractmethod
|
|
|
|
|
|
class HardwareBase:
|
|
@staticmethod
|
|
def get_cmdline():
|
|
with open('/proc/cmdline') as f:
|
|
cmdline = f.read()
|
|
return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2}
|
|
|
|
@abstractmethod
|
|
def get_sound_card_online(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_imei(self, slot):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_serial(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_subscriber_info(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def reboot(self, reason=None):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_network_type(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_sim_info(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_network_strength(self, network_type):
|
|
pass
|