1 /**
2  ****************************************************************************************
3  *
4  * @file app_user.h
5  *
6  * @brief user-defined service entry point
7  *
8  * Copyright (C) RivieraWaves 2009-2015
9  *
10  *
11  ****************************************************************************************
12  */
13 #ifndef APP_USER_H_
14 #define APP_USER_H_
15 
16 
17 
18 /*
19  * INCLUDE FILES
20  ****************************************************************************************
21  */
22 
23 #include "rwip_config.h"     // SW configuration
24 
25 #if (BLE_APP_USER)
26 
27 #include <stdint.h>          // Standard Integer Definition
28 #include "ke_task.h"
29 #include "att.h"
30 
31 /*
32  * TYPE DEFINITIONS
33  ****************************************************************************************
34  */
35 extern struct app_env_tag app_env;
36 
37 /// health thermometer application environment structure
38 struct app_user_rev_tag
39 {
40    //todo
41    uint16_t length;
42 
43  //  uint8_t data[ATT_VALUE_LEN_MAX/*__ARRAY_EMPTY*/];
44 
45     uint16_t receive_length;
46 
47     uint8_t *receive_data;
48 
49     bool  receive_flag;
50 
51     bool receive_header;
52 
53     uint16_t receive_current_length;
54 };
55 
56 /*
57  * GLOBAL VARIABLES DECLARATIONS
58  ****************************************************************************************
59  */
60 
61 /// Health Thermomter Application environment
62 //extern struct app_user_env_tag app_user_env;
63 
64 /// Table of message handlers
65 extern struct app_user_rev_tag app_user_env;
66 
67 extern const struct ke_state_handler app_user_table_handler;
68 
69 /*
70  * FUNCTIONS DECLARATION
71  ****************************************************************************************
72  */
73 
74 /**
75  ****************************************************************************************
76  *
77  * Health Thermometer Application Functions
78  *
79  ****************************************************************************************
80  */
81 
82 /**
83  ****************************************************************************************
84  * @brief Initialize Health Thermometer Application
85  ****************************************************************************************
86  */
87 void app_user_init(void);
88 
89 /**
90  ****************************************************************************************
91  * @brief Add a Health Thermometer instance in the DB
92  ****************************************************************************************
93  */
94 void app_user_add_users(void);
95 
96 /**
97  ****************************************************************************************
98  * @brief Stop the interval measurement timer if used
99  ****************************************************************************************
100  */
101 void app_stop_timer (void);
102 
103 /**
104  ****************************************************************************************
105  * @brief Enable the health thermometer profile
106  ****************************************************************************************
107  */
108 //void app_user_enable_prf(uint8_t conidx);
109 
110 void app_user_data_send(void);
111 
112 void app_user_mtu_temp_send(uint16_t mtu);
113 
114 void app_user_updata_temp_send(uint8_t status);//,uint16_t intv_min, uint16_t intv_max, uint16_t latancy, uint16_t timesout);
115 
116 void app_user_data_rec(uint16_t param_length , uint8_t * param_payload);
117 
118 
119 uint8_t app_user_data_notify(uint16_t param_length , uint8_t * param_payload, uint8_t att_idx);
120 
121 
122 #endif //(BLE_APP_USER)
123 
124 /// @} APP
125 
126 #endif // APP_HT_H_
127 
128