32 #define RN2903_MAX_BUFFER (512) 35 #define RN2903_MAX_HEX_EUI64 (16) 38 #define RN2903_DEFAULT_BAUDRATE (57600) 41 #define RN2903_DEFAULT_RESP_DELAY (1000) // 1 second 42 #define RN2903_DEFAULT_RESP2_DELAY (60000) // 60 seconds 46 #define RN2903_PHRASE_TERM "\r\n" 47 #define RN2903_PHRASE_TERM_LEN (2) 50 #define RN2903_PHRASE_INV_PARAM "invalid_param" 52 #define RN2903_PHRASE_OK "ok" 56 RN2903_MAC_STATUS_JOINED = 0x0001,
58 RN2903_MAC_STATUS_MAC_STATUS0 = 0x0002,
59 RN2903_MAC_STATUS_MAC_STATUS1 = 0x0004,
60 RN2903_MAC_STATUS_MAC_STATUS2 = 0x0008,
61 _RN2903_MAC_STATUS_MAC_STATUS_MASK = 7,
62 _RN2903_MAC_STATUS_MAC_STATUS_SHIFT = 1,
64 RN2903_MAC_STATUS_AUTO_REPLY = 0x0010,
65 RN2903_MAC_STATUS_ADR = 0x0020,
66 RN2903_MAC_STATUS_SILENT = 0x0040,
67 RN2903_MAC_STATUS_PAUSED = 0x0080,
68 RN2903_MAC_STATUS_RFU = 0x0100,
69 RN2903_MAC_STATUS_LINK_CHK = 0x0200,
71 RN2903_MAC_STATUS_CHAN_UPD = 0x0400,
72 RN2903_MAC_STATUS_OUT_PWR_UPD = 0x0800,
73 RN2903_MAC_STATUS_NBREP_UPD = 0x1000,
74 RN2903_MAC_STATUS_PRESCALER_UPD = 0x2000,
75 RN2903_MAC_STATUS_SECOND_RX_UPD = 0x4000,
76 RN2903_MAC_STATUS_TX_TIMING_UPD = 0x8000,
77 } RN2903_MAC_STATUS_BITS_T;
81 RN2903_MAC_STAT_IDLE = 0,
82 RN2903_MAC_STAT_TX_IN_PROGESS = 1,
83 RN2903_MAC_STAT_BEFORE_RX_WIN1 = 2,
84 RN2903_MAC_STAT_RX_WIN1_OPEN = 3,
85 RN2903_MAC_STAT_BETWEEN_RX_WIN1_WIN2 = 4,
86 RN2903_MAC_STAT_RX_WIN2_OPEN = 5,
87 RN2903_MAC_STAT_ACK_TIMEOUT = 6,
88 } RN2903_MAC_STATUS_T;
92 RN2903_JOIN_TYPE_OTAA = 0,
93 RN2903_JOIN_TYPE_ABP = 1,
99 RN2903_JOIN_STATUS_ACCEPTED = 0,
100 RN2903_JOIN_STATUS_BAD_KEYS = 1,
101 RN2903_JOIN_STATUS_NO_CHAN = 2,
102 RN2903_JOIN_STATUS_SILENT = 3,
103 RN2903_JOIN_STATUS_BUSY = 4,
104 RN2903_JOIN_STATUS_MAC_PAUSED = 5,
105 RN2903_JOIN_STATUS_DENIED = 6,
106 RN2903_JOIN_STATUS_ALREADY_JOINED = 7,
107 RN2903_JOIN_STATUS_UPM_ERROR = 8,
108 } RN2903_JOIN_STATUS_T;
112 RN2903_FLOW_CONTROL_NONE = 0,
113 RN2903_FLOW_CONTROL_HARD,
114 } RN2903_FLOW_CONTROL_T;
118 RN2903_MAC_MSG_TYPE_UNCONFIRMED = 0,
119 RN2903_MAC_MSG_TYPE_CONFIRMED = 1,
120 } RN2903_MAC_MSG_TYPE_T;
124 RN2903_MAC_TX_STATUS_TX_OK = 0,
125 RN2903_MAC_TX_STATUS_NOT_JOINED = 1,
126 RN2903_MAC_TX_STATUS_NO_CHAN = 2,
127 RN2903_MAC_TX_STATUS_SILENT = 3,
128 RN2903_MAC_TX_STATUS_FC_NEED_REJOIN = 4,
129 RN2903_MAC_TX_STATUS_BUSY = 5,
130 RN2903_MAC_TX_STATUS_MAC_PAUSED = 6,
131 RN2903_MAC_TX_STATUS_BAD_DATA_LEN = 7,
132 RN2903_MAC_TX_STATUS_RX_RECEIVED = 8,
133 RN2903_MAC_TX_STATUS_MAC_ERR = 9,
134 RN2903_MAC_TX_STATUS_UPM_ERROR = 10,
135 } RN2903_MAC_TX_STATUS_T;
139 RN2903_RESPONSE_OK = 0,
140 RN2903_RESPONSE_INVALID_PARAM = 1,
141 RN2903_RESPONSE_TIMEOUT = 3,
142 RN2903_RESPONSE_UPM_ERROR = 4,