Ejemplo n.º 1
0
 def __init__(self):
     WatchdogBase.__init__(self)
     self._librt = ctypes.CDLL('librt.so.1', use_errno=True)
     self._clock_gettime = self._librt.clock_gettime
     self._clock_gettime.argtypes = [
         ctypes.c_int, ctypes.POINTER(_timespec)
     ]
Ejemplo n.º 2
0
    def __init__(self):
        WatchdogBase.__init__(self)

        self.watchdog, self.wdt_main_dev_name = self._get_wdt()
        self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name
        self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name
        self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name
        # Set default value
        self._disable()
        self.armed = False
        self.timeout = self._gettimeout(self.timeout_path)
Ejemplo n.º 3
0
    def __init__(self):
        WatchdogBase.__init__(self)

        self._api_common = Common()

        # Init cpld reg path
        self.setreg_path = os.path.join(PLATFORM_CPLD_PATH, SETREG_FILE)
        self.getreg_path = os.path.join(PLATFORM_CPLD_PATH, GETREG_FILE)

        # Set default value
        self._disable()
        self.armed = False
        self.timeout = self._gettimeout()