#include "bt-request-sender.h"
#include "bt-event-handler.h"
-BT_EXPORT_API int bluetooth_set_proximity_property(const bluetooth_device_address_t *device_address,
+BT_EXPORT_API int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
bluetooth_pxp_poperty_t property, int value)
{
int result = BLUETOOTH_ERROR_INTERNAL;
g_array_append_vals(in_param2, &property, sizeof(int));
g_array_append_vals(in_param3, &value, sizeof(int));
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_SET_PROPERTY,
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_MONITOR_SET_PROPERTY,
in_param1, in_param2, in_param3, in_param4, &out_param);
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return result;
}
-BT_EXPORT_API int bluetooth_get_proximity_property(const bluetooth_device_address_t *device_address,
+BT_EXPORT_API int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
bluetooth_pxp_poperty_t property, int *value)
{
int result = BLUETOOTH_ERROR_INTERNAL;
g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
g_array_append_vals(in_param2, &property, sizeof(int));
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_GET_PROPERTY,
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_MONITOR_GET_PROPERTY,
in_param1, in_param2, in_param3, in_param4, &out_param);
if (result == BLUETOOTH_ERROR_NONE) {
return result;
}
-BT_EXPORT_API int bluetooth_get_proximity_supported_services(const bluetooth_device_address_t *device_address,
+BT_EXPORT_API int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
int *services_supported)
{
int result = BLUETOOTH_ERROR_INTERNAL;
g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_GET_SUPPORTED_SERIVCES,
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_MONITOR_GET_SUPPORTED_SERIVCES,
in_param1, in_param2, in_param3, in_param4, &out_param);
if (result == BLUETOOTH_ERROR_NONE) {
return result;
}
-BT_EXPORT_API int bluetooth_register_proximity_reporter()
+BT_EXPORT_API int bluetooth_proximity_reporter_register()
{
int result = BLUETOOTH_ERROR_INTERNAL;
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
BT_DBG("");
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_REGISTER_REPORTER,
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_REPORTER_REGISTER,
in_param1, in_param2, in_param3, in_param4, &out_param);
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return result;
}
-BT_EXPORT_API int bluetooth_unregister_proximity_reporter()
+BT_EXPORT_API int bluetooth_proximity_reporter_unregister()
{
int result = BLUETOOTH_ERROR_INTERNAL;
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
BT_DBG("");
- result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_UNREGISTER_REPORTER,
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_REPORTER_UNREGISTER,
in_param1, in_param2, in_param3, in_param4, &out_param);
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return result;
}
+
+BT_EXPORT_API int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
+ bluetooth_pxp_poperty_t property, int *value)
+{
+ int result = BLUETOOTH_ERROR_INTERNAL;
+
+ BT_CHECK_PARAMETER(device_address, return);
+ BT_CHECK_ENABLED(return);
+
+ BT_INIT_PARAMS();
+ BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+ BT_DBG("");
+
+ g_array_append_vals(in_param1, device_address, sizeof(bluetooth_device_address_t));
+ g_array_append_vals(in_param2, &property, sizeof(int));
+
+ result = _bt_send_request(BT_BLUEZ_SERVICE, BT_PXP_REPORTER_GET_PROPERTY,
+ in_param1, in_param2, in_param3, in_param4, &out_param);
+
+ if (result == BLUETOOTH_ERROR_NONE) {
+ if (out_param->len > 0) {
+ *value = g_array_index(out_param,
+ int, 0);
+ } else {
+ BT_ERR("out_param length is 0!!");
+ }
+ }
+
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ return result;
+}