1 #include "rwip_task.h" // Task definitions 2 #include "stdbool.h" 3 #include "ble_arch.h" 4 struct user_db_cfg 5 { 6 /// Feature (@see enum user_features) 7 uint8_t features; 8 9 uint16_t rxlen; 10 uint16_t txlen; 11 uint8_t *prx; 12 uint8_t *ptx; 13 /// Measurement interval timer enable 14 bool timer_enable; 15 16 }; 17 18 /// Parameters of the @ref HTPT_ENABLE_REQ message 19 struct user_enable_req 20 { 21 /// Connection index 22 uint8_t conidx; 23 /// Notification configuration (Bond Data to restore: @see enum htpt_ntf_ind_cfg) 24 uint8_t ntf_ind_cfg; 25 26 27 }; 28 struct user_notify_req 29 { 30 uint8_t att_idx; 31 uint16_t send_param_length; 32 uint8_t send_param_payload[__ARRAY_EMPTY]; 33 }; 34 /// Parameters of the @ref HTPT_ENABLE_RSP message 35 struct user_enable_rsp 36 { 37 /// Connection index 38 uint8_t conidx; 39 /// Status of enable request 40 uint8_t status; 41 }; 42 /// Parameters of the @ref HTPT_TEMP_SEND_RSP message 43 struct user_notify_rsp 44 { 45 /// Status 46 uint8_t status; 47 }; 48 struct user_write_rsp 49 { 50 /// Status 51 uint16_t len; 52 uint8_t status; 53 }; 54 struct user_read_rsp 55 { 56 /// Status 57 uint8_t status; 58 }; 59 struct user_upd_rsp 60 { 61 /// status 62 uint8_t status; 63 }; 64 /// Parameters of the @ref HTPT_CFG_INDNTF_IND message 65 struct user_cfg_indntf_ind 66 { 67 /// connection index 68 uint8_t conidx; 69 /// Notification Configuration (@see enum htpt_ntf_ind_cfg) 70 uint8_t ntf_ind_cfg; 71 }; 72 /// Messages for Health Thermometer Profile Thermometer 73 enum user_msg_id 74 { 75 /// Start the Health Thermometer Profile Thermometer profile - at connection 76 USER_ENABLE_REQ = TASK_FIRST_MSG(TASK_ID_USER), 77 /// Enable confirmation 78 USER_ENABLE_RSP, 79 80 /// Send DATA value 81 USER_DATA_WRITE_REQ, 82 /// Send DATA response 83 USER_DATA_WRITE_RSP, 84 85 /// RECEIVE DATA value 86 USER_DATA_READ_REQ, 87 /// RECEIVE DATA response 88 USER_DATA_READ_RSP, 89 90 /// Indicate Measurement Interval 91 USER_NOTIFY_REQ, 92 /// Send Measurement Interval response 93 USER_NOTIFY_RSP, 94 95 /// Indicate Measurement Interval 96 USER_INTV_REQ, 97 /// Send Measurement Interval response 98 USER_INTV_RSP, 99 /// Inform APP that Indication Configuration has been changed - use to update bond data 100 USER_CFG_INDNTF_IND, 101 }; 102 /// Database Feature Configuration Flags 103 enum user_features 104 { 105 /// Indicate if READ_WRITE Char. is supported 106 USER_READ_WRITE_CHAR_SUP = 0x01, 107 /// Indicate if DATA_NOTIFY Char. is supported 108 USER_DATA_NOTIFY_CHAR_SUP = 0x02, 109 /// Indicate if DATA_WRITE Char. is supported 110 USER_DATA_WRITE_CHAR_SUP = 0x04, 111 /// Indicate if indication Char. supports indications 112 USER_DATA_IND_CHAR_SUP = 0x08, 113 /// All Features supported 114 USER_ALL_FEAT_SUP = 0xF, 115 }; 116 enum user_ntf_ind_cfg 117 { 118 USER_DATA_NTF_IND_DISABLE = 0, 119 /// 数据发送方式为notify 120 USER_DATA_NTF = (1 << 0), 121 /// 数据发送方式为indication 122 USER_DATA_IND = (1 << 1), 123 }; 124 125 126 127 128 129