Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
MAC_BUSY_ERR = -6
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
TX_UNCOMFIRMED = 2
JOINED_SUCCESS = 3
ARG_NOT_FIND = -2
JOIN_ABP_ERR = -3
JOIN_OTAA_ERR = -4
NOT_JOIN = -5
MAC_BUSY_ERR = -6
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
def __init__(self, code):
"""Just assign return codes."""
try:
self.errno = int(code)
except ValueError:
self.errno = code
if self.errno in ERROR_MESSAGE:
self.strerror = ERROR_MESSAGE[self.errno]
else:
self.strerror = ERROR_MESSAGE[ErrorCode.UNKNOWN_ERR]
super().__init__(('[Errno {}] {}').format(self.errno, self.strerror))
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
TX_UNCOMFIRMED = 2
JOINED_SUCCESS = 3
JOINED_FAILED = 4
TX_TIMEOUT = 5
RX2_TIMEOUT = 6
DOWNLINK_REPEATED = 7
WAKE_UP = 8
ARG_ERR = -1
ARG_NOT_FIND = -2
JOIN_ABP_ERR = -3
JOIN_OTAA_ERR = -4
NOT_JOIN = -5
MAC_BUSY_ERR = -6
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
TX_UNCOMFIRMED = 2
JOINED_SUCCESS = 3
JOINED_FAILED = 4
JOIN_OTAA_ERR = -4
NOT_JOIN = -5
MAC_BUSY_ERR = -6
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
TX_UNCOMFIRMED = 2
JOINED_SUCCESS = 3
JOINED_FAILED = 4
TX_TIMEOUT = 5
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0
TX_COMFIRMED = 1
TX_UNCOMFIRMED = 2
JOINED_SUCCESS = 3
JOINED_FAILED = 4
TX_TIMEOUT = 5
RX2_TIMEOUT = 6
DOWNLINK_REPEATED = 7
JOIN_ABP_ERR = -3
JOIN_OTAA_ERR = -4
NOT_JOIN = -5
MAC_BUSY_ERR = -6
TX_ERR = -7
INTER_ERR = -8
WR_CFG_ERR = -11
RD_CFG_ERR = -12
TX_LEN_LIMITE_ERR = -13
UNKNOWN_ERR = -20
ERROR_MESSAGE = {
ErrorCode.ARG_ERR: 'Invalid argument',
ErrorCode.ARG_NOT_FIND: 'Argument not found',
ErrorCode.JOIN_ABP_ERR: 'ABP join error',
ErrorCode.JOIN_OTAA_ERR: 'OTAA join error',
ErrorCode.NOT_JOIN: 'Not joined',
ErrorCode.MAC_BUSY_ERR: 'MAC busy',
ErrorCode.TX_ERR: 'Transmit error',
ErrorCode.INTER_ERR: 'Inter error',
ErrorCode.WR_CFG_ERR: 'Write configuration error',
ErrorCode.RD_CFG_ERR: 'Read configuration Error',
ErrorCode.TX_LEN_LIMITE_ERR: 'Transmit len limit error',
ErrorCode.UNKNOWN_ERR: 'Unknown error',
}
class EventCode(IntEnum):
"""AT commands event codes."""
RECV_DATA = 0