int _uam_pm_stop_active_device_scan(unsigned int bitmask);
+int _uam_pm_add_ibeacon_adv(unsigned int adv_len, const char *iadv);
+
#ifdef __cplusplus
}
#endif
FUNC_EXIT;
return ret;
}
+
+int _uam_pm_add_ibeacon_adv(unsigned int adv_len, const char *iadv)
+{
+ FUNC_ENTRY;
+ int id;
+ int status;
+ int ret = UAM_ERROR_INTERNAL;
+
+ id = UAS_PLUGIN_ID_BLE;
+ uam_sensor_plugin_info_t *plugin = plugins[id];
+
+ if (!plugin || !plugin->api || !plugin->api->add_ibeacon_adv)
+ goto done;
+
+ status = plugin->api->add_ibeacon_adv(adv_len, iadv);
+ if (UAS_STATUS_SUCCESS != status && UAS_STATUS_ALREADY_DONE != status) {
+ UAM_ERR("plugin->add_ibeacon_adv failed for %d", id);
+ goto done;
+ }
+ ret = UAM_ERROR_NONE;
+
+done:
+ FUNC_EXIT;
+ return ret;
+}
int _uam_core_add_ibeacon_adv(unsigned int adv_len, const char *iadv)
{
FUNC_ENTRY;
+ int ret;
UAM_INFO("adv_len = %u, iadv = 0x%0x:0x%0x:0x%0x", adv_len,
iadv[0], iadv[1], iadv[2]);
+
if (UAM_ERROR_NONE != _uam_db_insert_adv_info(adv_len, iadv)) {
UAM_ERR("_uam_db_insert_adv_info failed");
return UAM_ERROR_DB_FAILED;
}
+ ret = _uam_pm_add_ibeacon_adv(adv_len, iadv);
+ if (UAM_ERROR_NONE != ret) {
+ UAM_ERR("Failed with error: %s (0x%4.4X)",
+ _uam_manager_error_to_str(ret), ret);
+ return ret;
+ }
+
FUNC_EXIT;
return UAM_ERROR_NONE;
}
* [Async API] To cancel the ongoing active devices search.
*/
int (*cancel_active_device_scan)(void);
+
+ /*
+ * [Sync API] To set iBeacon adv data in plug-in.
+ *
+ * [Param] adv_len - The value of length of iBeacon adv data to add.
+ *
+ * [Param] iadv - iBeacon adv data to be add.
+ */
+ int (*add_ibeacon_adv)(unsigned int adv_len, const char *iadv);
} uas_api_t;
typedef enum {