# Path: pyipmi/msgs/registry.py
# def create_request_by_name(self, name, *args, **kwargs):
#     return self.registry[name + "Req"](*args, **kwargs)
# 
# Path: pyipmi/utils.py
# def check_completion_code(cc):
#     if cc != constants.CC_OK:
#         raise CompletionCodeError(cc)
# 
# Path: pyipmi/state.py
# class State(DefaultProperties, ResponseDecoder):
#     """This is a container that represents a state.
# 
#     The state can have default
#     properties that are created by init.
#     """
# 
#     def __init__(self, rsp=None):
#         DefaultProperties.__init__(self)
#         ResponseDecoder.__init__(self, rsp)
# 
# Path: pyipmi/fields.py
# class VersionField(object):
#     """This class represent the Version fields defines by IPMI.
# 
#     Introduced with HPM the version field can hold additional auxiliary bytes.
#     """
# 
#     VERSION_FIELD_LEN = 2
#     VERSION_WITH_AUX_FIELD_LEN = 6
# 
#     def __init__(self, data=None):
#         self.major = None
#         self.minor = None
#         if data:
#             self._from_data(data)
# 
#     def _from_data(self, data):
#         if isinstance(data, str):
#             data = [ord(c) for c in data]
# 
#         data = array.array('B', data)
#         self.version = self._decode_data(data[0:2])
#         if len(data) == self.VERSION_WITH_AUX_FIELD_LEN:
#             self.auxiliary = data[2:6]
# 
#     def __str__(self):
#         return self.version_to_string()
# 
#     def _decode_data(self, data):
#         """`data` is array.array."""
#         self.major = data[0]
# 
#         if data[1] == 0xff:
#             self.minor = data[1]
#         elif data[1] <= 0x99:
#             self.minor = int(py3_array_tobytes(data[1:2]).decode('bcd+'))
#         else:
#             raise DecodingError()
# 
#     def version_to_string(self):
#         return ''.join("%s.%s" % (self.major, self.minor))


from .msgs import create_request_by_name
from .utils import check_completion_code
from .state import State
from .fields import VersionField
    TIMEOUT_ACTION_HARD_RESET = 1
    TIMEOUT_ACTION_POWER_DOWN = 2
    TIMEOUT_ACTION_POWER_CYCLE = 3

    __properties__ = [
        # (propery, description)
        ('timer_use', ''),
        ('dont_stop', ''),
        ('is_running', ''),
        ('dont_log', ''),
        ('pre_timeout_interrupt', ''),
        ('timeout_action', ''),
        ('pre_timeout_interval', ''),
        ('timer_use_expiration_flags', ''),
        ('initial_countdown', ''),
        ('present_countdown', ''),
    ]

    def _from_response(self, rsp):
        self.timer_use = rsp.timer_use.timer_use
        self.is_running = bool(rsp.timer_use.is_running)
        self.dont_log = bool(rsp.timer_use.dont_log)
        self.pre_timeout_interrupt = rsp.timer_actions.pre_timeout_interrupt
        self.timeout_action = rsp.timer_actions.timeout_action
        self.pre_timeout_interval = rsp.pre_timeout_interval
        self.timer_use_expiration_flags = rsp.timer_use_expiration_flags
        self.initial_countdown = rsp.initial_countdown
        self.present_countdown = rsp.present_countdown



# Path: pyipmi/msgs/registry.py
# def create_request_by_name(self, name, *args, **kwargs):
#     return self.registry[name + "Req"](*args, **kwargs)
# 
# Path: pyipmi/utils.py
# def check_completion_code(cc):
#     if cc != constants.CC_OK:
#         raise CompletionCodeError(cc)
# 
# Path: pyipmi/state.py
# class State(DefaultProperties, ResponseDecoder):
#     """This is a container that represents a state.
# 
#     The state can have default
#     properties that are created by init.
#     """
# 
#     def __init__(self, rsp=None):
#         DefaultProperties.__init__(self)
#         ResponseDecoder.__init__(self, rsp)
# 
# Path: pyipmi/fields.py
# class VersionField(object):
#     """This class represent the Version fields defines by IPMI.
# 
#     Introduced with HPM the version field can hold additional auxiliary bytes.
#     """
# 
#     VERSION_FIELD_LEN = 2
#     VERSION_WITH_AUX_FIELD_LEN = 6
# 
#     def __init__(self, data=None):
#         self.major = None
#         self.minor = None
#         if data:
#             self._from_data(data)
# 
#     def _from_data(self, data):
#         if isinstance(data, str):
#             data = [ord(c) for c in data]
# 
#         data = array.array('B', data)
#         self.version = self._decode_data(data[0:2])
#         if len(data) == self.VERSION_WITH_AUX_FIELD_LEN:
#             self.auxiliary = data[2:6]
# 
#     def __str__(self):
#         return self.version_to_string()
# 
#     def _decode_data(self, data):
#         """`data` is array.array."""
#         self.major = data[0]
# 
#         if data[1] == 0xff:
#             self.minor = data[1]
#         elif data[1] <= 0x99:
#             self.minor = int(py3_array_tobytes(data[1:2]).decode('bcd+'))
#         else:
#             raise DecodingError()
# 
#     def version_to_string(self):
#         return ''.join("%s.%s" % (self.major, self.minor))


# Path: pyipmi/bmc.py
from .msgs import create_request_by_name
from .utils import check_completion_code
from .state import State
from .fields import VersionField

    TIMEOUT_ACTION_HARD_RESET = 1
    TIMEOUT_ACTION_POWER_DOWN = 2
    TIMEOUT_ACTION_POWER_CYCLE = 3

    __properties__ = [
        # (propery, description)
        ('timer_use', ''),
        ('dont_stop', ''),
        ('is_running', ''),
        ('dont_log', ''),
        ('pre_timeout_interrupt', ''),
        ('timeout_action', ''),
        ('pre_timeout_interval', ''),
        ('timer_use_expiration_flags', ''),
        ('initial_countdown', ''),
        ('present_countdown', ''),
    ]

    def _from_response(self, rsp):
        self.timer_use = rsp.timer_use.timer_use
        self.is_running = bool(rsp.timer_use.is_running)
        self.dont_log = bool(rsp.timer_use.dont_log)
        self.pre_timeout_interrupt = rsp.timer_actions.pre_timeout_interrupt
        self.timeout_action = rsp.timer_actions.timeout_action
        self.pre_timeout_interval = rsp.pre_timeout_interval
        self.timer_use_expiration_flags = rsp.timer_use_expiration_flags
        self.initial_countdown = rsp.initial_countdown
        self.present_countdown = rsp.present_countdown



class DeviceId(State):