学习hrps中间的问题:
使用定时机周期性调调调函数,试图周周性发球,传递给该数的值ー从给该函120的整值,但当该值递到70左右(从从机应用观察到),板子手机,之后与手机应用程序断开链接,就再也连接不上了。这大厦是什么原因造成的?
void app_hrps_meas_send(uint16_t hrp_val)
{
//在数据库中添加低音
struct hrps_meas_send_req * req = ke_msg_alloc(hrps_meas_send_req,task_hrps,
task_app,hrps_meas_send_req);
req-> conhdl = active_conhdl;
struct hrs_hr_meas * phrs_hr_meas =&req-> meas_val;
phrs_hr_meas->标志= hrs_flag_hr_8bits_value;
phrs_hr_meas-> nb_rr_interval = 4;
phrs_hr_meas-> rr_intervals [0] = 10;
phrs_hr_meas-> heart_rate = hrp_val;
phrs_hr_meas-> lequence_expended = hrs_hr_cntl_point_code;
//发送消息
KE_MSG_SEND(REQ);
}
以下是概况次数:
void app_hrps_enable(uint16_t conhdl)
{
//分配消息
struct hrps_enable_req * req = ke_msg_alloc(hrps_enable_req,task_hrps,task_app,
hrps_enable_req);
//填写参数结构
active_conhdl = conhdl;
req-> conhdl = conhdl;
req-> sec_lvl = get_user_prf_srv_perm(task_hrps);
req-> con_type = prf_con_normal;// prf_con_discovery;
req-> hr_meas_ntf_en = 0; //默认情况下关闭。
// req-> batt_level_ntf_cfg [0] = 0;//默认情况下关闭。
req-> body_sensor_loc = 0;
//发送消息
KE_MSG_SEND(REQ);
app_hrps_config((uint16_t)0,deferm_hrps_level_alert,gpio_hrps_led_port,gpio_hrps_led_pin);
app_hrp_poll_start(app_hrps_poll_interval);
}
你好,
有几个问题需要确认:
1.定时代用作的哪个接口?定时期是多重?将该该分的相关代码完整贴起来。
2.用keil调试模式的时光,观察到死机的位置?
1,定时果定义代码如下:
app.h添加,见加入体
/// app任务消息
enum app_msg.
{
app_module_init_cmp_evt = ke_first_msg(task_app),
#if ble_prox_reporter.
app_pxp_timer,
#endif // ble_prox_reporter.
#if ble_bas_server
app_batt_timer,
app_batt_alert_timer,
#endif // ble_bas_server
#if ble_hr_sensor.
app_hrps_timer,
app_hrps_alert_timer,
#万一
运动速时机代码:
void app_hrp_poll_start(uint16_t poll_timeout)
{
hrp_poll_timeout = poll_timeout;
app_timer_set(app_hrps_timer,task_app,10);//在100毫秒的第一民意调查
}
定时果事件致理性:
const struct ke_msg_handler app_hrps_process_handlers [] =
{
{hrps_create_db_cfm,(ke_msg_func_t)hrps_create_db_cfm_handler},
{hrps_meas_send_cfm,(ke_msg_func_t)hrps_meas_send_cfm_handler},
{hrps_cfg_indntf_ind,(ke_msg_func_t)app_hrps_cfg_indntf_ind},
{app_hrps_timer,(ke_msg_func_t)app_hrp_timer_handler},
{app_hrps_alert_timer,(ke_msg_func_t)app_hrp_alert_timer_handler},
{hrps_disable_ind,(ke_msg_func_t)hrps_disable_handler},
};
int app_hrp_timer_handler(ke_msg_id_t const msgid,
void const * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
app_hrp_lvl(); //在这里发表感心率值
app_timer_set(app_hrps_timer,dest_id,hrp_poll_timeout);
return(ke_msg_consumed);
}
2,手机是:
void wrap_platform_reset(UINT32_T错误)
{
assert_warning(错误== reset_after_spota_update);//在Spota重置的情况下不要破坏
platform_reset_func(错误);
}
以上,谢谢!
Cyibin,你好,问题已解决,系致理性Hrps_meas_send_cfm事件时发球不合合的命令。
嗨中福寿,好的,感谢分。