• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 GOODIX.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * INCLUDE FILES
18  *****************************************************************************************
19  */
20 #include "gr55xx_sys.h"
21 
22 /*
23 * LOCAL FUNCTION DECLARATION
24 *****************************************************************************************
25 */
26 static void app_sec_rcv_enc_req_cb(uint8_t conn_idx, sec_enc_req_t *p_enc_req);
27 static void app_sec_rcv_enc_ind_cb(uint8_t conn_idx, sec_enc_ind_t enc_ind, uint8_t auth);
28 static void app_sec_rcv_keypress_nofify_cb(uint8_t conn_idx, sec_keypress_notify_t notify_type);
29 
30 /*
31  * GLOBAL VARIABLE DEFINITIONS
32  *****************************************************************************************
33  */
34 const sec_cb_fun_t app_sec_callback = {
35     .app_sec_enc_req_cb         = app_sec_rcv_enc_req_cb,
36     .app_sec_enc_ind_cb         = app_sec_rcv_enc_ind_cb,
37     .app_sec_keypress_notify_cb = app_sec_rcv_keypress_nofify_cb
38 };
39 
40 /*
41  * LOCAL FUNCTION DEFINITIONS
42  *****************************************************************************************
43  */
44 /**
45  *****************************************************************************************
46  * @brief This callback function will be called when receiving encryption request.
47  *
48  * @param[in] conn_idx:  The connection index.
49  * @param[in] p_enc_req: The information of SEC encryption request. See @ref sec_enc_req_t.
50  *****************************************************************************************
51  */
app_sec_rcv_enc_req_cb(uint8_t conn_idx,sec_enc_req_t * p_enc_req)52 static void app_sec_rcv_enc_req_cb(uint8_t conn_idx, sec_enc_req_t *p_enc_req)
53 {
54 }
55 
56 /**
57  *****************************************************************************************
58  * @brief This callback function will be called when receiving pair indication.
59  *
60  * @param[in] conn_idx: The connection index.
61  * @param[in] enc_ind:  The result of SEC pair. See @ref sec_enc_ind_t.
62  * @param[in] auth:     Indicate the flag of bonding, MITM and secure connection.
63  *                      See @ref SEC_AUTH_FLAG.
64  *****************************************************************************************
65  */
app_sec_rcv_enc_ind_cb(uint8_t conn_idx,sec_enc_ind_t enc_ind,uint8_t auth)66 static void app_sec_rcv_enc_ind_cb(uint8_t conn_idx, sec_enc_ind_t enc_ind, uint8_t auth)
67 {
68 }
69 
70 /**
71  *****************************************************************************************
72  * @brief This callback function will be called when receiving key press notify.
73  *
74  * @param[in] conn_idx:    The connection index.
75  * @param[in] notify_type: The type of SEC key press. See @ref sec_keypress_notify_t.
76  *****************************************************************************************
77  */
app_sec_rcv_keypress_nofify_cb(uint8_t conn_idx,sec_keypress_notify_t notify_type)78 static void app_sec_rcv_keypress_nofify_cb(uint8_t conn_idx, sec_keypress_notify_t notify_type)
79 {
80 }
81