Demo HCI Implementation for WiMOD-LR Devices  V1.3.1
WiMOD_SAP_RadioLink_IDs.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32 
33 
34 /*
35  * THIS IS AN EXAMPLE IMPLEMENTATION ACCORDING THE THE HCI SPEC: V1.8
36  * FOR FIRMWARE: LR-BASE
37  *
38  * SEE FILE: WiMOD_LR_Base_HCI_Spec_V1_8.pdf for detailed information
39  */
40 
41 
42 #ifndef ARDUINO_SAP_WIMOD_SAP_RADIOLINK_IDS_H_
43 #define ARDUINO_SAP_WIMOD_SAP_RADIOLINK_IDS_H_
44 
45 //------------------------------------------------------------------------------
46 //
47 // Section Includes Files
48 //
49 //------------------------------------------------------------------------------
50 
51 #include "utils/WMDefs.h"
52 
53 //------------------------------------------------------------------------------
54 //
55 // Service Access Point Identifier
56 //
57 //------------------------------------------------------------------------------
58 
60 #define RADIOLINK_SAP_ID 0x03
61 
62 
63 
64 //------------------------------------------------------------------------------
65 //
66 // Radio Link Services Identifier
67 //
68 //------------------------------------------------------------------------------
70 #define RADIOLINK_MSG_SEND_U_DATA_REQ 0x01
71 #define RADIOLINK_MSG_SEND_U_DATA_RSP 0x02
72 #define RADIOLINK_MSG_U_DATA_RX_IND 0x04
73 #define RADIOLINK_MSG_U_DATA_TX_IND 0x06
74 #define RADIOLINK_MSG_RAW_DATA_RX_IND 0x08
75 #define RADIOLINK_MSG_SEND_C_DATA_REQ 0x09
76 #define RADIOLINK_MSG_SEND_C_DATA_RSP 0x0A
77 #define RADIOLINK_MSG_C_DATA_RX_IND 0x0C
78 #define RADIOLINK_MSG_C_DATA_TX_IND 0x0E
79 #define RADIOLINK_MSG_ACK_RX_IND 0x10
80 #define RADIOLINK_MSG_ACK_TIMEOUT_IND 0x12
81 #define RADIOLINK_MSG_ACK_TX_IND 0x14
82 #define RADIOLINK_MSG_SET_ACK_DATA_REQ 0x15
83 #define RADIOLINK_MSG_SET_ACK_DATA_RSP 0x16
84 
86 //------------------------------------------------------------------------------
87 //
88 // Radio Link Status Codes
89 //
90 //------------------------------------------------------------------------------
92 
93 #define RADIOLINK_STATUS_OK 0x00
94 #define RADIOLINK_STATUS_ERROR 0x01
95 #define RADIOLINK_STATUS_CMD_NOT_SUPPORTED 0x02
96 #define RADIOLINK_STATUS_WRONG_PARAMETER 0x03
97 #define RADIOLINK_STATUS_WRONG_RADIO_MODE 0x04
98 #define RADIOLINK_STATUS_MEDIA_BUSY 0x05
99 #define RADIOLINK_STATUS_BUFFER_FULL 0x07
100 #define RADIOLINK_STATUS_LENGTH_ERROR 0x08
101 
103 //------------------------------------------------------------------------------
104 //
105 // Format / Status Field defines
106 //
107 //------------------------------------------------------------------------------
109 #define RADIOLINK_FORMAT_EXTENDED_OUTPUT (1 << 0) // bit field
110 #define RADIOLINK_FORMAT_DECRYPTION_ERROR (1 << 6) // bit field
111 #define RADIOLINK_FORMAT_ENCRYPTED_DATA R (1 << 7) // bit field
112 //------------------------------------------------------------------------------
114 //
115 // Misc. Defines
116 //
117 //------------------------------------------------------------------------------
119 #define RADIOLINK_BROADCAST_GROUP_ADR 0xFF
120 #define RADIOLINK_BROADCAST_DEVICE_ADR 0xFFFF
121 
123 /*
124  * Number of payload bytes for a user defined message
125  *
126  * Note: the actual number of payload bytes can be less, if the air frame
127  * contains a list of MAC commands.
128  */
130 #define WiMODLRBASE_APP_PAYLOAD_LEN 100
131 
132 #define RADIOLINK_HEADER_SIZE (1+1+2+1+2+2+1+4)
133 //------------------------------------------------------------------------------
135 //
136 // structures
137 //
138 //------------------------------------------------------------------------------
140 #define WIMOD_RADIOLINK_PAYLOAD_LEN (WiMODLRBASE_APP_PAYLOAD_LEN - RADIOLINK_HEADER_SIZE)
141 
142 #define WIMOD_RADIOLINK_ACK_DATA_LEN ( 0x08 )
143 
148 typedef struct
149 {
150  // only for RX
151  UINT8 StatusFormat;
153  // RX + TX
157  //only for RX
161  // RX + TX
162  UINT8 Length;
163  UINT8 Payload[WIMOD_RADIOLINK_PAYLOAD_LEN];
164  // note: in case of encrypted data the sequence number and MIC
165  // is included in this payload field. The user must check the
166  // StatusFormat field
167 
169  // optional fields; only for RX
170  INT16 RSSI;
171  INT8 SNR;
172  INT32 RxTime;
175 
179 typedef struct
180 {
181  UINT8 Status;
182  UINT16 TxEventCounter;
184 
185 
189 typedef struct
190 {
191  UINT8 Status;
193 
194 #endif /* ARDUINO_SAP_WIMOD_SAP_RADIOLINK_IDS_H_ */
Structure containing information about an acknowledgment transmission.
Definition: WiMOD_SAP_RadioLink_IDs.h:189
UINT8 Status
Definition: WiMOD_SAP_RadioLink_IDs.h:191