#include "cywee_data.h"
#endif
-
+// 安全调用函数指针的宏定义
+#define SAFE_CALL(func_ptr, ...) \
+ do { \
+ if ((func_ptr) != NULL) { \
+ (func_ptr)(__VA_ARGS__); \
+ } else { \
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Function pointer is NULL: %s", #func_ptr); \
+ } \
+ } while(0)
+
+#define SAFE_CALL_RETURN(func_ptr, ret_val, ...) \
+ do { \
+ if ((func_ptr) != NULL) { \
+ ret_val = (func_ptr)(__VA_ARGS__); \
+ } else { \
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Function pointer is NULL: %s", #func_ptr); \
+ ret_val = 0; \
+ } \
+ } while(0)
+
+#define SAFE_CALL_BOOL(func_ptr, ...) \
+ ((func_ptr) != NULL ? (func_ptr)(__VA_ARGS__) : false)
+
+#define SAFE_CALL_PTR(func_ptr, ...) \
+ ((func_ptr) != NULL ? (func_ptr)(__VA_ARGS__) : NULL)
+
+#define SAFE_CALL_PTR_NO_ARGS(func_ptr) \
+ ((func_ptr) != NULL ? (func_ptr)() : NULL)
// #include "font/base_font.h"
// #include "uicomponents/UIComponents.h"
uint8_t get_dial_num()
{
- return bleInstruct_t.get_dial_num_cb();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_dial_num_cb);
}
bool ble_is_Alipay_bind(void)
void set_ota_upgrade(void)
{
- bleInstruct_t.set_ota_upgrade_cb();
+ SAFE_CALL(bleInstruct_t.set_ota_upgrade_cb);
}
void test_paly(uint8_t falg)
bool get_training_spead_path(char *path ,uint32_t time,uint32_t max_len)
{
- return bleInstruct_t.get_training_spead_path_cb(path,time,max_len);
+ return SAFE_CALL_BOOL(bleInstruct_t.get_training_spead_path_cb, path, time, max_len);
}
bool get_training_heart_path(char *path ,uint32_t time,uint32_t max_len)
{
- return bleInstruct_t.get_training_heart_path_cb(path,time,max_len);
+ return SAFE_CALL_BOOL(bleInstruct_t.get_training_heart_path_cb, path, time, max_len);
}
void ble_sos_data_save(void)
{
- bleInstruct_t.ble_sos_data_save_cb();
+ SAFE_CALL(bleInstruct_t.ble_sos_data_save_cb);
}
void ble_SOS_data_init(void)
{
- bleInstruct_t.ble_SOS_data_init_cb();
+ SAFE_CALL(bleInstruct_t.ble_SOS_data_init_cb);
}
void ota_updata_init(void)
{
- bleInstruct_t.ota_updata_init_cb();
+ SAFE_CALL(bleInstruct_t.ota_updata_init_cb);
}
uint8_t * ble_get_sos_all_data_malloc(uint32_t *len)
{
- return bleInstruct_t.ble_get_sos_all_data_malloc_cb(len);
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_sos_all_data_malloc_cb, len);
}
#define before_file_day 30
//sos
void ble_sos_number_clean(void)
{
- return bleInstruct_t.ble_sos_number_clean_cb();
+ SAFE_CALL(bleInstruct_t.ble_sos_number_clean_cb);
}
bool ble_add_sos_number(uint8_t sex,char *name,char *number)
{
- return bleInstruct_t.ble_add_sos_number_cb(sex,name,number);
+ return SAFE_CALL_BOOL(bleInstruct_t.ble_add_sos_number_cb, sex, name, number);
}
void ble_Alipayunbind(void)
void get_music_path(char *buf,uint8_t max_len)
{
- return bleInstruct_t.get_music_path_cb(buf,max_len);
+ SAFE_CALL(bleInstruct_t.get_music_path_cb, buf, max_len);
}
bool is_first_pair(void)
{
- return bleInstruct_t.is_first_pair_cb();
+ return SAFE_CALL_BOOL(bleInstruct_t.is_first_pair_cb);
}
bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_end,char *title,char *data,bool is_end)
{
- return bleInstruct_t.Ble_Set_ScheduleInfo_cb( id, timetamp_begin, timetamp_end,title,data, is_end);
+ return SAFE_CALL_BOOL(bleInstruct_t.Ble_Set_ScheduleInfo_cb, id, timetamp_begin, timetamp_end, title, data, is_end);
}
//在此处实现,给UI回复消息。
void ble_app_reply(bool data)
{
- return bleInstruct_t.ble_app_reply(data);
+ SAFE_CALL(bleInstruct_t.ble_app_reply, data);
}
void ble_connect_ok(void)
{
- return bleInstruct_t.ble_connect_ok();
+ SAFE_CALL(bleInstruct_t.ble_connect_ok);
}
void ble_disconnect_ok(void)
{
- if( bleInstruct_t.ble_disconnect_ok==NULL)
- {
- return;
- }
- return bleInstruct_t.ble_disconnect_ok();
+ SAFE_CALL(bleInstruct_t.ble_disconnect_ok);
}
void hand_watch_first_time_Paired(void)
{
- return bleInstruct_t.hand_watch_first_time_Paired();
+ SAFE_CALL(bleInstruct_t.hand_watch_first_time_Paired);
}
void ble_set_ai_Question_str(char *buf)
{
- return bleInstruct_t.ble_set_ai_Question_str(buf);
+ SAFE_CALL(bleInstruct_t.ble_set_ai_Question_str, buf);
}
void ble_set_ai_Answer_str(char *buf,uint8_t type)
{
- return bleInstruct_t.ble_set_ai_Answer_str(buf,type);
+ SAFE_CALL(bleInstruct_t.ble_set_ai_Answer_str, buf, type);
}
char* ble_get_ai_audio_path_str(void)
{
- return bleInstruct_t.ble_get_ai_audio_path_str();
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_ai_audio_path_str);
}
void ble_set_pair(uint8_t falg)
{
- return bleInstruct_t.ble_set_pair(falg);
+ SAFE_CALL(bleInstruct_t.ble_set_pair, falg);
}
uint8_t get_ble_pair(void)
{
- return bleInstruct_t.get_ble_pair();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_ble_pair);
}
uint8_t get_br_is_pair(void)
{
- return bleInstruct_t.get_br_is_pair();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_br_is_pair);
}
void set_br_pair(uint8_t data)
{
- return bleInstruct_t.set_br_pair(data);
+ SAFE_CALL(bleInstruct_t.set_br_pair, data);
}
bool get_lcd_state(void)
{
- return bleInstruct_t.get_lcd_state();
+ return SAFE_CALL_BOOL(bleInstruct_t.get_lcd_state);
}
uint8_t ble_get_heart_data()
{
- return bleInstruct_t.ble_get_heart_data();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.ble_get_heart_data);
}
uint8_t ble_get_oxygen_data()
{
- return bleInstruct_t.ble_get_oxygen_data();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.ble_get_oxygen_data);
}
cJSON* ble_get_recs_data()
{
- return bleInstruct_t.ble_get_recs_data();
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_recs_data);
}
//通过时间戳获取训练数据
cJSON* ble_get_Trainingdata_by_timetamp(uint32_t timetamp)
{
- return bleInstruct_t .ble_get_Trainingdata_by_timetamp(timetamp);
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_Trainingdata_by_timetamp, timetamp);
}
bool delete_MP3_file_By_ID(uint16_t id)
{
- return bleInstruct_t .delete_MP3_file_By_ID(id);
+ return SAFE_CALL_BOOL(bleInstruct_t.delete_MP3_file_By_ID, id);
}
char * dir_to_json_buf_malloc(uint8_t type)
{
- return bleInstruct_t .dir_to_json_buf_malloc(type);
+ return SAFE_CALL_PTR(bleInstruct_t.dir_to_json_buf_malloc, type);
}
uint8_t ble_AT_add_nap_data(uint16_t time)
{
- return bleInstruct_t .ble_AT_add_nap_data(time);
+ return SAFE_CALL_PTR(bleInstruct_t.ble_AT_add_nap_data, time);
}
uint8_t ble_get_sleep_data(uint32_t file_size,uint8_t day_,uint8_t *data)
{
- return bleInstruct_t .ble_get_sleep_data(file_size,day_,data);
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_sleep_data, file_size, day_, data);
}
uint8_t ble_get_sleep_data_dir(uint32_t *file_size,uint8_t day_)
{
- return bleInstruct_t .ble_get_sleep_data_dir(file_size,day_);
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_sleep_data_dir, file_size, day_);
}
void ble_set_password(uint8_t falg, char * data)
{
- return bleInstruct_t .ble_set_password(falg,data);
+ SAFE_CALL(bleInstruct_t.ble_set_password, falg, data);
}
uint8_t ble_get_password(void)
{
- return bleInstruct_t .ble_get_password();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.ble_get_password);
}
// void set_sedent_param(msg_sedent_set_param_info_t * data)
void get_sedent_param( msg_sedent_set_param_info_t * data)
{
- return bleInstruct_t.get_sedent_param(data);
+ SAFE_CALL(bleInstruct_t.get_sedent_param, data);
}
bool check_dial_freespace(uint16_t id,uint32_t dial_size) {
- return bleInstruct_t.check_dial_freespace(id,dial_size);
+ return SAFE_CALL_BOOL(bleInstruct_t.check_dial_freespace, id, dial_size);
}
void ble_get_dial_path(char * buf,uint16_t id)
{
- return bleInstruct_t.ble_get_dial_path(buf,id);
+ SAFE_CALL(bleInstruct_t.ble_get_dial_path, buf, id);
}
void ble_save_dial_custom(msg_recv_custom_dial_info_t *data)
{
- return bleInstruct_t.ble_save_dial_custom(data);
+ SAFE_CALL(bleInstruct_t.ble_save_dial_custom, data);
}
// void ble_set_dial_by_id_(uint16_t id)
void ble_set_dial_by_id(uint16_t id)
{
// printf("ble_set_dial_by_id %d\n",id);
- return bleInstruct_t.ble_set_dial_by_id(id);
+ SAFE_CALL(bleInstruct_t.ble_set_dial_by_id, id);
}
void ble_get_custom_dial(uint16_t id,char *buf)
{
- return bleInstruct_t.ble_get_custom_dial(id,buf);
+ SAFE_CALL(bleInstruct_t.ble_get_custom_dial, id, buf);
}
uint16_t ble_get_dial_id(void)
{
- return bleInstruct_t.ble_get_dial_id();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.ble_get_dial_id);
}
bool ble_is_dial_install_by_id(uint16_t id)
{
- return bleInstruct_t.ble_is_dial_install_by_id(id);
+ return SAFE_CALL_BOOL(bleInstruct_t.ble_is_dial_install_by_id, id);
}
int ble_get_dial_num(void)
{
- return bleInstruct_t.ble_get_dial_num();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.ble_get_dial_num);
}
// void ble_delete_dial_(uint16_t id)
bool ble_delete_dial(uint16_t id)
{
- return bleInstruct_t.ble_delete_dial(id);
+ return SAFE_CALL_BOOL(bleInstruct_t.ble_delete_dial, id);
}
int get_all_dial_id( char * buf,uint16_t MAX_LEN)
{
- return bleInstruct_t.get_all_dial_id(buf,MAX_LEN);
+ return SAFE_CALL_PTR(bleInstruct_t.get_all_dial_id, buf, MAX_LEN);
}
bool dial_file_save(void )
{
- return bleInstruct_t.dial_file_save();
+ return SAFE_CALL_BOOL(bleInstruct_t.dial_file_save);
}
// void install_Register_dial_( char * name,uint16_t id)
// }
void install_Register_dial( char * name,uint16_t id)
{
- return bleInstruct_t.install_Register_dial(name,id);
+ SAFE_CALL(bleInstruct_t.install_Register_dial, name, id);
}
void ble_set_sleep_remind(msg_get_sleep_param_info_t data)
{
- return bleInstruct_t.ble_set_sleep_remind(data);
+ SAFE_CALL(bleInstruct_t.ble_set_sleep_remind, data);
}
void ble_get_sleep_remind(msg_get_sleep_param_info_t *data)
{
- return bleInstruct_t.ble_get_sleep_remind(data);
+ SAFE_CALL(bleInstruct_t.ble_get_sleep_remind, data);
}
void ble_set_drink_remind(msg_drink_info_t data)
{
- return bleInstruct_t.ble_set_drink_remind(data);
+ SAFE_CALL(bleInstruct_t.ble_set_drink_remind, data);
}
void ble_get_drink_remind(msg_drink_info_t *data)
{
- return bleInstruct_t.ble_get_drink_remind(data);
+ SAFE_CALL(bleInstruct_t.ble_get_drink_remind, data);
}
// 闹钟数据:
void ble_delet_all_AlarmInfo(void)
{
- return bleInstruct_t.ble_delet_all_AlarmInfo();
+ SAFE_CALL(bleInstruct_t.ble_delet_all_AlarmInfo);
}
void ble_SetAlarmInfo(uint32_t time_hour, uint32_t time_min, uint8_t week,uint8_t id,uint8_t enable)
{
// OHOS::uapi_connect_pbap_pce();
- return bleInstruct_t.ble_SetAlarmInfo(time_hour,time_min,week,id,enable);
+ SAFE_CALL(bleInstruct_t.ble_SetAlarmInfo, time_hour, time_min, week, id, enable);
}
char * struct_to_json_buf_malloc_Alarm(void)
{
- return bleInstruct_t.struct_to_json_buf_malloc_Alarm();
+ return SAFE_CALL_PTR(bleInstruct_t.struct_to_json_buf_malloc_Alarm);
}
char * struct_to_json_buf_malloc(uint8_t day)
{
- return bleInstruct_t.struct_to_json_buf_malloc(day);
+ return SAFE_CALL_PTR(bleInstruct_t.struct_to_json_buf_malloc, day);
}
#define TAR_PATH EXC_TAR_PATH
void add_addressbookToRead(char *data)
{
- return bleInstruct_t.add_addressbookToRead(data);
+ SAFE_CALL(bleInstruct_t.add_addressbookToRead, data);
}
static uint32_t languaage_id=0;
void addressbookToRead(char *buf)//转化用于·c文件
{
- return bleInstruct_t.addressbookToRead(buf);
+ SAFE_CALL(bleInstruct_t.addressbookToRead, buf);
}
void addressbookTowrite(void)//转化用于·c文件
{
- return bleInstruct_t.addressbookTowrite();
+ SAFE_CALL(bleInstruct_t.addressbookTowrite);
}
uint8_t ble_falg=0;
void set_user_data(msg_user_info_t *data)
{
- return bleInstruct_t.set_user_data(data);
+ SAFE_CALL(bleInstruct_t.set_user_data, data);
}
int get_goal_stepcount(void)
{
- return bleInstruct_t.get_goal_stepcount();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_goal_stepcount);
}
int get_goal_caloriescount(void)//获取运动目标卡路里
{
- return bleInstruct_t.get_goal_caloriescount();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_goal_caloriescount);
}
int get_goal_discount(void)//获取运动目标卡路里
{
- return bleInstruct_t.get_goal_discount();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_goal_discount);
}
int get_vibrationremiander(void)
{
- return bleInstruct_t.get_vibrationremiander();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_vibrationremiander);
}
int get_SilentMode(void)
{
- return bleInstruct_t.get_SilentMode();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_SilentMode);
}
void set_quick_auxiliary_paramters(uint8_t id)//设置快捷辅助功能参数id
{
- return bleInstruct_t.set_quick_auxiliary_paramters(id);
+ SAFE_CALL(bleInstruct_t.set_quick_auxiliary_paramters, id);
}
int get_quick_auxiliary_paramters(void)//获取快捷辅助功能参数id
{
- return bleInstruct_t.get_quick_auxiliary_paramters();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_quick_auxiliary_paramters);
}
void set_goal_stepcount(uint32_t step)
{
- return bleInstruct_t.set_goal_stepcount(step);
+ SAFE_CALL(bleInstruct_t.set_goal_stepcount, step);
}
void set_goal_caloriescount(uint32_t kcal)
{
- return bleInstruct_t.set_goal_caloriescount(kcal);
+ SAFE_CALL(bleInstruct_t.set_goal_caloriescount, kcal);
}
void set_notify_switch(bool on)
{
- return bleInstruct_t.set_notify_switch(on);
+ SAFE_CALL(bleInstruct_t.set_notify_switch, on);
}
bool get_notify_switch(void)
{
- return bleInstruct_t.get_notify_switch();
+ return SAFE_CALL_BOOL(bleInstruct_t.get_notify_switch);
}
uint8_t get_other_goal_notify_switch(void)
{
- return bleInstruct_t.get_other_goal_notify_switch();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_other_goal_notify_switch);
}
uint8_t get_step_goal_notify_switch(void)
{
- return bleInstruct_t.get_step_goal_notify_switch();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_step_goal_notify_switch);
}
void set_goal_discount(uint32_t dis)
{
- return bleInstruct_t.set_goal_discount(dis);
+ SAFE_CALL(bleInstruct_t.set_goal_discount, dis);
}
void set_goal_durationcount(uint32_t time)
{
- return bleInstruct_t.set_goal_durationcount(time);
+ SAFE_CALL(bleInstruct_t.set_goal_durationcount, time);
}
int get_goal_durationcount(void)
{
- return bleInstruct_t.get_goal_durationcount();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_goal_durationcount);
}
void set_goal_standupcount(uint32_t time)
{
- return bleInstruct_t.set_goal_standupcount(time);
+ SAFE_CALL(bleInstruct_t.set_goal_standupcount, time);
}
int get_goal_standupcount(void)
{
- return bleInstruct_t.get_goal_standupcount();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_goal_standupcount);
}
void set_vibrationremiander(uint8_t falg)//设置震动模式
{
- return bleInstruct_t.set_vibrationremiander(falg);
+ SAFE_CALL(bleInstruct_t.set_vibrationremiander, falg);
}
void set_SilentMode(uint8_t falg)//设置静音模式
{
- return bleInstruct_t.set_SilentMode(falg);
+ SAFE_CALL(bleInstruct_t.set_SilentMode, falg);
}
/*设置自动获取实时数据开关*/
void set_traning_updata_auto(uint8_t traingauto)
{
- return bleInstruct_t.set_traning_updata_auto(traingauto);
+ SAFE_CALL(bleInstruct_t.set_traning_updata_auto, traingauto);
}
void set_goal_other_notification(uint8_t data)
{
- return bleInstruct_t.set_goal_other_notification(data);
+ SAFE_CALL(bleInstruct_t.set_goal_other_notification, data);
}
void set_goal_step_notification(uint8_t data)
{
- return bleInstruct_t.set_goal_step_notification(data);
+ SAFE_CALL(bleInstruct_t.set_goal_step_notification, data);
}
/*设置获取实时数据频率*/
void set_traning_updata_freq(uint8_t freq)
{
- return bleInstruct_t.set_traning_updata_freq(freq);
+ SAFE_CALL(bleInstruct_t.set_traning_updata_freq, freq);
}
/*设置最大心率提醒*/
void set_traning_heart_max(uint8_t data)
{
- return bleInstruct_t.set_traning_heart_max(data);
+ SAFE_CALL(bleInstruct_t.set_traning_heart_max, data);
}
void set_brigthness(uint8_t data) //设置屏幕亮度
{
- return bleInstruct_t.set_brigthness(data);
+ SAFE_CALL(bleInstruct_t.set_brigthness, data);
}
void Set_DmpChangeMode(int state)
{
- return bleInstruct_t.Set_DmpChangeMode(state);
+ SAFE_CALL(bleInstruct_t.Set_DmpChangeMode, state);
}
void Set_heart_cmd(msg_get_heart_set_param_info_t *data)
{
- return bleInstruct_t.Set_heart_cmd(data);
+ SAFE_CALL(bleInstruct_t.Set_heart_cmd, data);
}
void Get_heart_cmd(msg_get_heart_set_param_info_t *data)
{
- return bleInstruct_t.Get_heart_cmd(data);
+ SAFE_CALL(bleInstruct_t.Get_heart_cmd, data);
}
void Set_oxygen_cmd(msg_get_spo2_set_param_info_t *data)
{
- return bleInstruct_t.Set_oxygen_cmd(data);
+ SAFE_CALL(bleInstruct_t.Set_oxygen_cmd, data);
}
void Get_oxygen_cmd(msg_get_spo2_set_param_info_t *data)
{
- return bleInstruct_t.Get_oxygen_cmd(data);
+ SAFE_CALL(bleInstruct_t.Get_oxygen_cmd, data);
}
int Get_DmpChangeMode(void)
{
- return bleInstruct_t.Get_DmpChangeMode();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.Get_DmpChangeMode);
}
int get_brigthness(void) //获取屏幕亮度
{
- return bleInstruct_t.get_brigthness();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_brigthness);
}
void set_ScreenDuration(int data) //设置亮屏时长
{
- return bleInstruct_t.set_ScreenDuration(data);
+ SAFE_CALL(bleInstruct_t.set_ScreenDuration, data);
}
int get_ScreenDuration(void) //获取亮屏时长
{
- return bleInstruct_t.get_ScreenDuration();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.get_ScreenDuration);
}
void Set_RaiseToWake(bool value) //抬婉亮屏开关
{
- return bleInstruct_t.Set_RaiseToWake(value);
+ SAFE_CALL(bleInstruct_t.Set_RaiseToWake, value);
}
int Get_RaiseToWake(void) //获取抬婉亮屏开关
{
- return bleInstruct_t.Get_RaiseToWake();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.Get_RaiseToWake);
}
void Set_SystemVolume(int value) //设置系统音量
{
- return bleInstruct_t.Set_SystemVolume(value);
+ SAFE_CALL(bleInstruct_t.Set_SystemVolume, value);
}
int Get_SystemVolume(void) //获取系统音量
{
- return bleInstruct_t.Get_SystemVolume();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.Get_SystemVolume);
}
void Set_CallVolume(int value) //设置通话音量
{
- return bleInstruct_t.Set_CallVolume(value);
+ SAFE_CALL(bleInstruct_t.Set_CallVolume, value);
}
int Get_CallVolume(void) //获取通话音量
{
- return bleInstruct_t.Get_CallVolume();
+ return SAFE_CALL_PTR_NO_ARGS(bleInstruct_t.Get_CallVolume);
}
uint8_t ble_is_ready(void)
void get_health_HEART_data_path(char *path, uint8_t day,uint16_t max_size)
{
- return bleInstruct_t.get_health_HEART_data_path(path,day,max_size);
+ SAFE_CALL(bleInstruct_t.get_health_HEART_data_path, path, day, max_size);
}
void get_health_OXYGEN_data_path(char *path, uint8_t day,uint16_t max_size)
{
- return bleInstruct_t.get_health_OXYGEN_data_path(path,day,max_size);
+ SAFE_CALL(bleInstruct_t.get_health_OXYGEN_data_path, path, day, max_size);
}
void set_weather_now_data(int humidity, char* windScale, char* textNight,int uvIndex,int temp,int iconNight)
{
//UpdateWeatherViewData();
- return bleInstruct_t.set_weather_now_data(humidity,windScale,textNight,uvIndex,temp,iconNight);
+ SAFE_CALL(bleInstruct_t.set_weather_now_data, humidity, windScale, textNight, uvIndex, temp, iconNight);
}
void set_weather_address_data(int lat, char* atm, char* city,char* subLocality,int lon)
{
- return bleInstruct_t.set_weather_address_data(lat,atm,city,subLocality,lon);
+ SAFE_CALL(bleInstruct_t.set_weather_address_data, lat, atm, city, subLocality, lon);
}
// struct ONE_DAY_DATA
// {
void set_weather_one_data(int tempMin, int iconDay,int fxDate, int tempMax, char *textDay,int count)
{
- return bleInstruct_t.set_weather_one_data(tempMin,iconDay,fxDate,tempMax,textDay,count);
+ SAFE_CALL(bleInstruct_t.set_weather_one_data, tempMin, iconDay, fxDate, tempMax, textDay, count);
}
void ble_add_message_index(uint32_t old_index)
{
- return bleInstruct_t.ble_add_message_index(old_index);
+ SAFE_CALL(bleInstruct_t.ble_add_message_index, old_index);
}
void SendDtfmStrNumberToCat1(char ch) // ble发送单个字符到CAT1 DTMF功能
bool IS_free_save_Mp3(uint32_t size)
{
- return bleInstruct_t.IS_free_save_Mp3(size);
+ return SAFE_CALL_BOOL(bleInstruct_t.IS_free_save_Mp3, size);
}
bool ble_bin_install(const char * data)
{
- return bleInstruct_t.ble_bin_install(data);
+ return SAFE_CALL_BOOL(bleInstruct_t.ble_bin_install, data);
}
bool ble_app_delete(const char *data)
{
- return bleInstruct_t.ble_app_delete(data);
+ return SAFE_CALL_BOOL(bleInstruct_t.ble_app_delete, data);
}
cJSON* ble_app_list(void)
{
- return bleInstruct_t.ble_app_list();
+ return SAFE_CALL_PTR(bleInstruct_t.ble_app_list);
}
cJSON* ble_get_watch_msg(void)
{
- return bleInstruct_t.ble_get_watch_msg();
+ return SAFE_CALL_PTR(bleInstruct_t.ble_get_watch_msg);
}