@@ -140,7 +140,6 @@ struct GapConnectionCompleteEvent : public GapEvent {
140
140
* @param supervision_timeout Supervision timeout of the connection. It
141
141
* shall be in the range [0x000A : 0x0C80] where a unit represent 10ms.
142
142
*
143
- * @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.1 LE Connection Complete Event
144
143
* @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.10 LE Enhanced Connection
145
144
* Complete Event
146
145
*/
@@ -153,6 +152,69 @@ struct GapConnectionCompleteEvent : public GapEvent {
153
152
uint16_t connection_interval,
154
153
uint16_t connection_latency,
155
154
uint16_t supervision_timeout
155
+ ) :
156
+ GapEvent (GapEventType::CONNECTION_COMPLETE),
157
+ status (status),
158
+ connection_handle (connection_handle),
159
+ role (role),
160
+ peer_address_type (
161
+ peer_address_type == advertising_peer_address_type_t ::PUBLIC_ADDRESS ?
162
+ peer_address_type_t ::PUBLIC :
163
+ peer_address_type_t ::RANDOM
164
+ ),
165
+ peer_address (peer_address),
166
+ connection_interval (connection_interval),
167
+ connection_latency (connection_latency),
168
+ supervision_timeout (supervision_timeout),
169
+ local_resolvable_private_address (),
170
+ peer_resolvable_private_address () {
171
+ }
172
+
173
+ /* *
174
+ * Construct a new GapConnectionCompleteEvent.
175
+ *
176
+ * @param status Status of the operation: 0x00 in case of success otherwise
177
+ * the error code associated with the failure.
178
+ *
179
+ * @param connection_handle handle of the connection created. This handle
180
+ * will be used to address the connection in any connection oriented
181
+ * operation.
182
+ *
183
+ * @param role Role of the LE subsystem in the connection.
184
+ *
185
+ * @param address_type Type of address used by the peer for this connection.
186
+ *
187
+ * @param address Address of the peer used to establish the connection.
188
+ *
189
+ * @param connection_interval Connection interval used on this connection.
190
+ * It shall be in a range [0x0006 : 0x0C80]. A unit is equal to 1.25ms.
191
+ *
192
+ * @param connection_latency Number of connection events the slave can
193
+ * drop.
194
+ *
195
+ * @param supervision_timeout Supervision timeout of the connection. It
196
+ * shall be in the range [0x000A : 0x0C80] where a unit represent 10ms.
197
+ *
198
+ * @param local_resolvable_private_address Resolvable private address used
199
+ * by the local device to establish the connection.
200
+ *
201
+ * @param peer_resolvable_private_address Resolvable private address used
202
+ * by the peer to establish the connection.
203
+ *
204
+ * @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.10 LE Enhanced Connection
205
+ * Complete Event
206
+ */
207
+ GapConnectionCompleteEvent (
208
+ uint8_t status,
209
+ connection_handle_t connection_handle,
210
+ connection_role_t role,
211
+ peer_address_type_t peer_address_type,
212
+ const address_t & peer_address,
213
+ uint16_t connection_interval,
214
+ uint16_t connection_latency,
215
+ uint16_t supervision_timeout,
216
+ const address_t & local_resolvable_private_address,
217
+ const address_t & peer_resolvable_private_address
156
218
) :
157
219
GapEvent (GapEventType::CONNECTION_COMPLETE),
158
220
status (status),
@@ -162,9 +224,12 @@ struct GapConnectionCompleteEvent : public GapEvent {
162
224
peer_address (peer_address),
163
225
connection_interval (connection_interval),
164
226
connection_latency (connection_latency),
165
- supervision_timeout (supervision_timeout) {
227
+ supervision_timeout (supervision_timeout),
228
+ local_resolvable_private_address (local_resolvable_private_address),
229
+ peer_resolvable_private_address (peer_resolvable_private_address) {
166
230
}
167
231
232
+
168
233
/*
169
234
* @param status Indicate if the connection succesfully completed or not:
170
235
* - 0: Connection successfuly completed
@@ -188,7 +253,7 @@ struct GapConnectionCompleteEvent : public GapEvent {
188
253
/* *
189
254
* Peer address type.
190
255
*/
191
- const advertising_peer_address_type_t peer_address_type;
256
+ const peer_address_type_t peer_address_type;
192
257
193
258
/* *
194
259
* Peer address.
@@ -211,6 +276,18 @@ struct GapConnectionCompleteEvent : public GapEvent {
211
276
* It shall be in the range [0x000A : 0x0C80] where a unit represent 10ms.
212
277
*/
213
278
const uint16_t supervision_timeout;
279
+
280
+ /* *
281
+ * Resolvable private address of the local device.
282
+ * Set to all 0 if not available.
283
+ */
284
+ const address_t local_resolvable_private_address;
285
+
286
+ /* *
287
+ * Resolvable private address of the peer.
288
+ * Set to all 0 if not available. *
289
+ */
290
+ const address_t peer_resolvable_private_address;
214
291
};
215
292
216
293
0 commit comments