From: Abhay Agarwal Date: Thu, 4 Feb 2021 05:41:33 +0000 (+0530) Subject: Modify enums and convert functions for wifi-location X-Git-Tag: submit/tizen/20210629.001718~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7416b033be321d6cf6b09cda03e9ca62a8ce8ad;p=platform%2Fcore%2Fapi%2Fuser-awareness.git Modify enums and convert functions for wifi-location Change-Id: I9b62c9edd0d8beb6d09c27a32730591972ef476e Signed-off-by: Abhay Agarwal --- diff --git a/include/user-awareness-private.h b/include/user-awareness-private.h index bc63751..15ec174 100755 --- a/include/user-awareness-private.h +++ b/include/user-awareness-private.h @@ -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 diff --git a/include/user-awareness-util.h b/include/user-awareness-util.h index baff68f..9c319f6 100755 --- a/include/user-awareness-util.h +++ b/include/user-awareness-util.h @@ -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 diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index 98a9abb..429b384 100755 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -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; diff --git a/src/user-awareness-util.c b/src/user-awareness-util.c index e9d2d9f..ba313bb 100755 --- a/src/user-awareness-util.c +++ b/src/user-awareness-util.c @@ -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;