int scan_mode = UAS_SCAN_MODE_LOW_LATENCY;
extern uam_vendor_plugin_info_t* vendor_plugin;
int ret = UAM_ERROR_INTERNAL;
- uas_detection_type_e type;
-
- switch (detection_mode) {
- case UAM_DETECT_PRESENCE:
- type = UAS_PRESENCE;
- break;
- case UAM_DETECT_ABSENCE:
- type = UAS_ABSENCE;
- break;
- case UAM_DETECT_LOCATION:
- type = UAS_LOCATION;
- break;
- default:
- type = UAS_PRESENCE | UAS_ABSENCE;
- }
+
+ uas_detection_type_e type = _pm_util_uam_detection_to_uas_detection(detection_mode);
if (vendor_plugin && vendor_plugin->api)
vendor_plugin->api->get_scan_level(&scan_mode);
int id;
int status;
int ret = UAM_ERROR_INTERNAL;
- uas_detection_type_e type;
-
- switch (detection_mode) {
- case UAM_DETECT_PRESENCE:
- type = UAS_PRESENCE;
- break;
- case UAM_DETECT_ABSENCE:
- type = UAS_ABSENCE;
- break;
- case UAM_DETECT_LOCATION:
- type = UAS_LOCATION;
- break;
- default:
- type = UAS_PRESENCE | UAS_ABSENCE;
- }
+
+ uas_detection_type_e type = _pm_util_uam_detection_to_uas_detection(detection_mode);
for (id = UAS_PLUGIN_ID_BLE; id < UAS_PLUGIN_ID_MAX; id++) {
uam_sensor_plugin_info_t *plugin = plugins[id];
FUNC_EXIT;
return sensor_info;
}
+
+uas_detection_type_e _pm_util_uam_detection_to_uas_detection(unsigned int detection_mode)
+{
+ FUNC_ENTRY;
+
+ switch (detection_mode) {
+ case UAM_DETECT_PRESENCE:
+ return UAS_PRESENCE;
+ case UAM_DETECT_ABSENCE:
+ return UAS_ABSENCE;
+ break;
+ case UAM_DETECT_LOCATION:
+ return UAS_LOCATION;
+ break;
+ default:
+ return UAS_PRESENCE | UAS_ABSENCE;
+ }
+}