| Demo HCI Implementation for WiMOD-LR Devices V1.3.1

- Main Page
- Classes
- Files

- File List
- File Members

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
154 UINT8 DestinationGroupAddress;
155 UINT16 DestinationDeviceAddress;
157 //only for RX
158 UINT8 SourceGroupAddress;
159 UINT16 SourceDeviceAddress;
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
168 bool OptionalInfoAvaiable;
169 // optional fields; only for RX
170 INT16 RSSI;
171 INT8 SNR;
172 INT32 RxTime;
174 } TWiMODLR_RadioLink_Msg;
175
179 typedef struct
180 {
181 UINT8 Status;
182 UINT16 TxEventCounter;
183 } TWiMODLR_RadioLink_CdataInd;
184
185
189 typedef struct
190 {
191 UINT8 Status;
192 } TWiMODLR_AckTxInd_Msg;
193
194 #endif /* ARDUINO_SAP_WIMOD_SAP_RADIOLINK_IDS_H_ */
TWiMODLR_RadioLink_Msg::SNR
INT8 SNR
Definition: WiMOD_SAP_RadioLink_IDs.h:171
TWiMODLR_RadioLink_CdataInd
Structure containing information about a C-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:179
TWiMODLR_RadioLink_Msg::Length
UINT8 Length
Definition: WiMOD_SAP_RadioLink_IDs.h:162
TWiMODLR_RadioLink_Msg::DestinationDeviceAddress
UINT16 DestinationDeviceAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:155
TWiMODLR_RadioLink_Msg::StatusFormat
UINT8 StatusFormat
Definition: WiMOD_SAP_RadioLink_IDs.h:151
TWiMODLR_AckTxInd_Msg
Structure containing information about an acknowledgment transmission.
Definition: WiMOD_SAP_RadioLink_IDs.h:189
TWiMODLR_RadioLink_Msg
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RadioLink_IDs.h:148
TWiMODLR_RadioLink_CdataInd::Status
UINT8 Status
Definition: WiMOD_SAP_RadioLink_IDs.h:181
TWiMODLR_RadioLink_Msg::RxTime
INT32 RxTime
Definition: WiMOD_SAP_RadioLink_IDs.h:172
TWiMODLR_RadioLink_Msg::SourceGroupAddress
UINT8 SourceGroupAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:158
TWiMODLR_RadioLink_Msg::OptionalInfoAvaiable
bool OptionalInfoAvaiable
Definition: WiMOD_SAP_RadioLink_IDs.h:168
TWiMODLR_RadioLink_Msg::DestinationGroupAddress
UINT8 DestinationGroupAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:154
TWiMODLR_AckTxInd_Msg::Status
UINT8 Status
Definition: WiMOD_SAP_RadioLink_IDs.h:191
TWiMODLR_RadioLink_CdataInd::TxEventCounter
UINT16 TxEventCounter
Definition: WiMOD_SAP_RadioLink_IDs.h:182
TWiMODLR_RadioLink_Msg::RSSI
INT16 RSSI
Definition: WiMOD_SAP_RadioLink_IDs.h:170
TWiMODLR_RadioLink_Msg::SourceDeviceAddress
UINT16 SourceDeviceAddress
Definition: WiMOD_SAP_RadioLink_IDs.h:159