aboutsummaryrefslogtreecommitdiff
path: root/src/app/google_rcu/address_module/rcu_link_mgr.h
blob: b30004d5d09e2240afcba8e231992e946ded7a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
*****************************************************************************************
*     Copyright(c) 2017, Realtek Semiconductor Corporation. All rights reserved.
*****************************************************************************************
   * @file      link_mgr.h
   * @brief     Define multilink manager struct and functions.
   * @author    jane
   * @date      2017-06-06
   * @version   v1.0
   **************************************************************************************
   * @attention
   * <h2><center>&copy; COPYRIGHT 2017 Realtek Semiconductor Corporation</center></h2>
   **************************************************************************************
  */
#ifndef _LINK_MANAGER_H_
#define _LINK_MANAGER_H_
/*============================================================================*
 *                              Header Files
 *============================================================================*/
#include <app_msg.h>
#include <gap_conn_le.h>
#include <profile_client.h>

/*============================================================================*
 *                              Constants
 *============================================================================*/
/** @brief  Define device list table size. */
#define APP_MAX_DEVICE_INFO 6

/** @addtogroup  SCATTERNET_GAP_MSG
    * @{
    */
/**
 * @brief  Application Link control block definition.
 */
typedef struct
{
    T_GAP_CONN_STATE        conn_state;          /**< Connection state. */
    T_GAP_REMOTE_ADDR_TYPE  bd_type;             /**< remote BD type*/
    uint8_t                 bd_addr[GAP_BD_ADDR_LEN]; /**< remote BD */
} T_APP_LINK;
/** @} */ /* End of group SCATTERNET_GAP_MSG */
/** @addtogroup  SCATTERNET_SCAN_MGR
    * @{
    */
/**
 * @brief  Device list block definition.
 */
typedef struct
{
    uint8_t      bd_addr[GAP_BD_ADDR_LEN];  /**< remote BD */
    uint8_t      bd_type;              /**< remote BD type*/
} T_DEV_INFO;
/** @} */
/** @addtogroup  SCATTERNET_RANDOM
    * @{
    */
//#if F_BT_LE_USE_STATIC_RANDOM_ADDR
typedef struct
{
    uint8_t      is_exist;
    uint8_t      reserved;         /**< remote BD type*/
    uint8_t      bd_addr[GAP_BD_ADDR_LEN];  /**< remote BD */
} T_APP_STATIC_RANDOM_ADDR;
#endif
/** @} */
/*============================================================================*
 *                              Variables
 *============================================================================*/
/** @brief  App link table */
//extern T_APP_LINK app_link_table[APP_MAX_LINKS];
/** @brief  Device list table, used to save discovered device informations. */
extern T_DEV_INFO dev_list[APP_MAX_DEVICE_INFO];
/** @brief  The number of device informations saved in dev_list. */
extern uint8_t dev_list_count;

/*============================================================================*
 *                              Functions
 *============================================================================*/
bool link_mgr_add_device(uint8_t *bd_addr, uint8_t bd_type);
void link_mgr_clear_device_list(void);
void app_static_random_addr_cfg(void);
//#if F_BT_LE_USE_STATIC_RANDOM_ADDR
uint32_t app_save_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr);
uint32_t app_load_static_random_address(T_APP_STATIC_RANDOM_ADDR *p_addr);
//#endif
//#endif