notify_device_found(count, device_data);
- if (find_mot_enb_dev_retry_cnt < RETRY_COUNT) {
- find_mot_enb_dev_retry_cnt += 1;
+ if (find_mot_enb_dev_retry_cnt <= RETRY_COUNT) {
g_timeout_add(RETRY_INTERVAL, __retry_find_mot_enable_device, NULL);
+ find_mot_enb_dev_retry_cnt += 1;
+ } else {
+ LOG_DEBUG("Find MOT enabled device finished");
+ find_mot_enb_dev_retry_cnt = 0;
}
LOG_END();
g_list_free_full (mot_enb_dev_list, _mot_enb_dev_list_free_func);
mot_enb_dev_list = NULL;
- find_mot_enb_dev_retry_cnt = 0;
+ if (find_mot_enb_dev_retry_cnt != 0) {
+ find_mot_enb_dev_retry_cnt = 1;
+ LOG_DEBUG("Find MOT enables devices in progress, reset retry count");
+ return COMP_ERROR_NONE;
+ }
ret = agent_find_mot_enable_devices(timeout);
if (ret != COMP_ERROR_NONE) {
notify_mowned_device_found(count, device_data);
- if (find_mowned_dev_retry_cnt < RETRY_COUNT) {
- find_mowned_dev_retry_cnt += 1;
+ if (find_mowned_dev_retry_cnt <= RETRY_COUNT) {
g_timeout_add(RETRY_INTERVAL, __retry_find_mowned_devices, NULL);
+ find_mowned_dev_retry_cnt += 1;
+ } else {
+ LOG_DEBUG("Find My owned devices finished");
+ find_mowned_dev_retry_cnt = 0;
}
LOG_END();
g_list_free_full(mowned_dev_list, _mot_enb_dev_list_free_func);
mowned_dev_list = NULL;
- find_mowned_dev_retry_cnt = 0;
+ if (find_mowned_dev_retry_cnt != 0) {
+ find_mowned_dev_retry_cnt = 1;
+ LOG_DEBUG("Find My owned devices in progress, reset retry count");
+ return COMP_ERROR_NONE;
+ }
ret = agent_find_mowned_devices(timeout);
if (ret != COMP_ERROR_NONE) {