Lines Matching full:p_inst
51 tBA_INST *p_inst = &battery_cb.battery_inst[0];
53 for (;i < BA_MAX_INT_NUM; i ++, p_inst++)
55 if (handle == p_inst->ba_level_hdl ||
56 handle == p_inst->clt_cfg_hdl ||
57 handle == p_inst->rpt_ref_hdl ||
58 handle == p_inst->pres_fmt_hdl )
75 tBA_INST *p_inst = &battery_cb.battery_inst[0];
80 for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
83 if (handle == p_inst->clt_cfg_hdl)
88 if (p_inst->p_cback)
90 p_inst->pending_clcb_idx = clcb_idx;
91 p_inst->pending_evt = BA_WRITE_CLT_CFG_REQ;
92 p_inst->pending_handle = handle;
96 (* p_inst->p_cback)(p_inst->app_id, BA_WRITE_CLT_CFG_REQ, &cfg);
115 tBA_INST *p_inst = &battery_cb.battery_inst[0];
119 for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
122 if (handle == p_inst->ba_level_hdl ||
123 handle == p_inst->clt_cfg_hdl ||
124 handle == p_inst->rpt_ref_hdl ||
125 handle == p_inst->pres_fmt_hdl)
130 if (p_inst->p_cback)
132 if (handle == p_inst->ba_level_hdl) p_inst->pending_evt = BA_READ_LEVEL_REQ;
133 if (handle == p_inst->clt_cfg_hdl) p_inst->pending_evt = BA_READ_CLT_CFG_REQ;
134 if (handle == p_inst->pres_fmt_hdl) p_inst->pending_evt = BA_READ_PRE_FMT_REQ;
135 if (handle == p_inst->rpt_ref_hdl) p_inst->pending_evt = BA_READ_RPT_REF_REQ ;
137 p_inst->pending_clcb_idx = clcb_idx;
138 p_inst->pending_handle = handle;
141 (* p_inst->p_cback)(p_inst->app_id, p_inst->pending_evt, NULL);
197 tBA_INST *p_inst;
206 p_inst = &battery_cb.battery_inst[battery_cb.inst_id];
222 p_inst->app_id = app_id;
223 p_inst->p_cback = p_reg_info->p_cback;
232 if ((p_inst->ba_level_hdl = GATTS_AddCharacteristic(srvc_hdl,
245 p_inst->clt_cfg_hdl = GATTS_AddCharDescriptor(srvc_hdl,
248 if (p_inst->clt_cfg_hdl == 0)
257 if ( (p_inst->pres_fmt_hdl = GATTS_AddCharDescriptor(srvc_hdl,
270 if ( (p_inst->rpt_ref_hdl = GATTS_AddCharDescriptor(srvc_hdl,
303 tBA_INST *p_inst = &battery_cb.battery_inst[0];
310 if (p_inst->app_id == app_id && p_inst->ba_level_hdl != 0)
320 if (p_inst->pending_evt == event)
325 rsp.attr_value.handle = p_inst->pending_handle;
329 srvc_sr_rsp(p_inst->pending_clcb_idx, st, &rsp);
333 rsp.attr_value.handle = p_inst->pending_handle;
337 srvc_sr_rsp(p_inst->pending_clcb_idx, st, &rsp);
341 srvc_sr_rsp(p_inst->pending_clcb_idx, st, NULL);
345 rsp.attr_value.handle = p_inst->pending_handle;
350 srvc_sr_rsp(p_inst->pending_clcb_idx, st, &rsp);
356 p_inst->pending_clcb_idx = 0;
357 p_inst->pending_evt = 0;
358 p_inst->pending_handle = 0;
371 tBA_INST *p_inst = &battery_cb.battery_inst[0];
376 if (p_inst->app_id == app_id && p_inst->ba_level_hdl != 0)
381 if (i == BA_MAX_INT_NUM || p_inst->clt_cfg_hdl == 0)
384 srvc_sr_notify(remote_bda, p_inst->ba_level_hdl, 1, &battery_level);