Modify enums and convert functions for wifi-location 90/260390/2
authorAbhay Agarwal <ay.agarwal@samsung.com>
Thu, 4 Feb 2021 05:41:33 +0000 (11:11 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 25 Jun 2021 11:52:00 +0000 (17:22 +0530)
Change-Id: I9b62c9edd0d8beb6d09c27a32730591972ef476e
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
include/user-awareness-private.h
include/user-awareness-util.h
src/user-awareness-monitors.c
src/user-awareness-util.c

index bc63751dc3e3996988cc7f9d8530a1150de01942..15ec17453d531d57777cc5a00a1780ce52bd8652 100755 (executable)
@@ -203,6 +203,18 @@ do { \
  */
 #define UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN 17
 
+/**
+ * @brief Wifi location sensor.
+ * @since_tizen 6.5
+ */
+#define UA_SENSOR_WIFI_LOCATION 0x00000040
+
+/**
+ * @brief Wifi location mac type.
+ * @since_tizen 6.5
+ */
+#define UA_MAC_TYPE_WIFI_LOCATION 0x10
+
 /**
  * @brief The handle of payload information.
  * @since_tizen 6.5
index baff68fefee98cdd3a8ca4acba7020bc6ea1b484..9c319f68379f24e22a1fef1f4ca152da4f242653 100755 (executable)
@@ -161,6 +161,7 @@ uam_tech_type_e _ua_to_uam_tech_type(ua_mac_type_e type);
  * @retval #UA_SENSOR_BT Bluetooth
  * @retval #UA_SENSOR_BLE Bluetooth Low Energy
  * @retval #UA_SENSOR_WIFI Wi-Fi
+ * @retval #UA_SENSOR_WIFI_LOCATION Wi-Fi Location
  * @retval #UA_SENSOR_MAX Invalid
  *
  * @exception
index 98a9abb848d36faf40e6ed6f9a644586dcc08349..429b3843714d5e7642f2d3b8a28e632438a198ef 100755 (executable)
@@ -110,7 +110,7 @@ static void __ua_monitor_internal_presence_unref(ua_monitor_s *monitor)
                monitor->internal_presence_started = 0;
 }
 
-static unsigned int __ua_sensor_type_to_bitmask(ua_sensor_type_e sensor_type)
+static unsigned int __ua_sensor_type_to_bitmask(int sensor_type)
 {
        FUNC_ENTRY;
        unsigned int bitmask;
@@ -136,6 +136,9 @@ static unsigned int __ua_sensor_type_to_bitmask(ua_sensor_type_e sensor_type)
        case UA_SENSOR_AUDIO:
                bitmask = UAM_SENSOR_BITMASK_AUDIO;
                break;
+       case UA_SENSOR_WIFI_LOCATION:
+               bitmask = UAM_SENSOR_BITMASK_WIFI_LOCATION;
+               break;
        case UA_SENSOR_ALL:
                bitmask = UAM_SENSOR_ALL;
                break;
index e9d2d9fac0e98a16f57a5f6faa225b9bf99807a7..ba313bb21055ec864d0f60e097786e29540b0a4e 100755 (executable)
@@ -55,7 +55,7 @@ int _ua_check_supported_feature(ua_feature_t feature, bool *supported)
        return UA_ERROR_NONE;
 }
 
-ua_mac_type_e _to_ua_mac_type(uam_tech_type_e tech_type)
+ua_mac_type_e _to_ua_mac_type(int tech_type)
 {
        switch (tech_type) {
        case UAM_TECH_TYPE_BT:
@@ -66,6 +66,8 @@ ua_mac_type_e _to_ua_mac_type(uam_tech_type_e tech_type)
                return UA_MAC_TYPE_WIFI;
        case UAM_TECH_TYPE_P2P:
                return UA_MAC_TYPE_P2P;
+       case UAM_TECH_TYPE_WIFI_LOCATION:
+               return UA_MAC_TYPE_WIFI_LOCATION;
        default:
                return UA_MAC_TYPE_INVALID;
        }
@@ -189,7 +191,7 @@ const char *_ua_get_error_string(ua_error_e err)
        return err_str;
 }
 
-uam_tech_type_e _ua_to_uam_tech_type(ua_mac_type_e type)
+uam_tech_type_e _ua_to_uam_tech_type(int type)
 {
        switch (type) {
        case UA_MAC_TYPE_BT:
@@ -200,12 +202,14 @@ uam_tech_type_e _ua_to_uam_tech_type(ua_mac_type_e type)
                return UAM_TECH_TYPE_WIFI;
        case UA_MAC_TYPE_P2P:
                return UAM_TECH_TYPE_P2P;
+       case UA_MAC_TYPE_WIFI_LOCATION:
+               return UAM_TECH_TYPE_WIFI_LOCATION;
        default:
                return UA_MAC_TYPE_INVALID;
        }
 }
 
-ua_sensor_type_e _ua_dev_type_to_sensor(ua_mac_type_e type)
+ua_sensor_type_e _ua_dev_type_to_sensor(int type)
 {
        FUNC_ENTRY;
 
@@ -216,6 +220,8 @@ ua_sensor_type_e _ua_dev_type_to_sensor(ua_mac_type_e type)
                return UA_SENSOR_BLE;
        case UA_MAC_TYPE_WIFI:
                return UA_SENSOR_WIFI;
+       case UA_MAC_TYPE_WIFI_LOCATION:
+               return UA_SENSOR_WIFI_LOCATION;
        default:
                UA_WARN("Uncompatible to convert. Mac type [%u]", type);
                return UA_SENSOR_MAX;
@@ -223,7 +229,7 @@ ua_sensor_type_e _ua_dev_type_to_sensor(ua_mac_type_e type)
        FUNC_EXIT;
 }
 
-ua_mac_type_e _ua_sensor_to_dev_type(ua_sensor_type_e type)
+ua_mac_type_e _ua_sensor_to_dev_type(int type)
 {
        FUNC_ENTRY;
 
@@ -234,6 +240,8 @@ ua_mac_type_e _ua_sensor_to_dev_type(ua_sensor_type_e type)
                return UA_MAC_TYPE_BLE;
        case UA_SENSOR_WIFI:
                return UA_MAC_TYPE_WIFI;
+       case UA_SENSOR_WIFI_LOCATION:
+               return UA_MAC_TYPE_WIFI_LOCATION;
        default:
                UA_WARN("Uncompatible to convert. sensor [%u]", type);
                return UA_MAC_TYPE_INVALID;
@@ -241,7 +249,7 @@ ua_mac_type_e _ua_sensor_to_dev_type(ua_sensor_type_e type)
        FUNC_EXIT;
 }
 
-ua_sensor_type_e _uam_to_ua_sensor(uam_sensor_bitmask_e bitmask)
+ua_sensor_type_e _uam_to_ua_sensor(int bitmask)
 {
        FUNC_ENTRY;
 
@@ -258,6 +266,8 @@ ua_sensor_type_e _uam_to_ua_sensor(uam_sensor_bitmask_e bitmask)
                return UA_SENSOR_LIGHT;
        case UAM_SENSOR_BITMASK_AUDIO:
                return UA_SENSOR_AUDIO;
+       case UAM_SENSOR_BITMASK_WIFI_LOCATION:
+               return UA_SENSOR_WIFI_LOCATION;
        default:
                UA_WARN("Unknown sensor bitmask [0x%8.8X]", bitmask);
                return UA_SENSOR_MAX;