sdk里面sensor model部分能直接用吗?

Discussions on BLE related products, including standard BLE devices, BLE mesh, and Apple HomeKit products
Post Reply
IME
Posts: 2
Joined: Sat Aug 17, 2019 9:39 am

Sat Oct 19, 2019 9:25 am

sdk里面sensor model部分能直接用吗?看文档里面没有介绍这部分,而且代码这一段看上去还没写完
u32 sensor_measure_proc()
{
u32 min_interval = 1<<model_sig_sensor.sensor_states[0].cadence.cadence_unit.min_interval;
if(clock_time_exceed_ms(sensor_measure_ms, min_interval)){//
sensor_measure_ms = clock_time_ms();
u8 pub_flag = 0;
//update sensure_measure_quantity here

if(sensure_measure_quantity < model_sig_sensor.sensor_states[0].sensor_data){
if((model_sig_sensor.sensor_states[0].sensor_data - sensure_measure_quantity) > model_sig_sensor.sensor_states[0].cadence.cadence_unit.delta_down){
pub_flag = 1;
}
}
else{
if((sensure_measure_quantity - model_sig_sensor.sensor_states[0].sensor_data) > model_sig_sensor.sensor_states[0].cadence.cadence_unit.delta_up){
pub_flag = 1;
}
}

if(pub_flag){
model_pub_check_set(ST_G_LEVEL_SET_PUB_NOW, (u8 *)&model_sig_sensor.sensor_srv[0].com, 0);
}
model_sig_sensor.sensor_states[0].sensor_data = sensure_measure_quantity;
}

return 1;
}
Post Reply