Remove old bt-service files
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-proximity.c
index 5e1f71e..8e63487 100644 (file)
@@ -22,7 +22,7 @@
 #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;
@@ -38,7 +38,7 @@ BT_EXPORT_API int bluetooth_set_proximity_property(const bluetooth_device_addres
        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);
@@ -46,7 +46,7 @@ BT_EXPORT_API int bluetooth_set_proximity_property(const bluetooth_device_addres
        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;
@@ -61,7 +61,7 @@ BT_EXPORT_API int bluetooth_get_proximity_property(const bluetooth_device_addres
        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) {
@@ -78,7 +78,7 @@ BT_EXPORT_API int bluetooth_get_proximity_property(const bluetooth_device_addres
        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;
@@ -92,7 +92,7 @@ BT_EXPORT_API int bluetooth_get_proximity_supported_services(const bluetooth_dev
 
        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) {
@@ -108,3 +108,71 @@ BT_EXPORT_API int bluetooth_get_proximity_supported_services(const bluetooth_dev
 
        return result;
 }
+
+BT_EXPORT_API int bluetooth_proximity_reporter_register()
+{
+       int result = BLUETOOTH_ERROR_INTERNAL;
+
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+       BT_DBG("");
+
+       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_proximity_reporter_unregister()
+{
+       int result = BLUETOOTH_ERROR_INTERNAL;
+
+       BT_CHECK_ENABLED(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+       BT_DBG("");
+
+       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;
+}