Add Angle of arrival data 99/264499/2 accepted/tizen_6.5_unified accepted/tizen/6.5/unified/20211028.101358 accepted/tizen/unified/20210926.235649 submit/tizen/20210924.142521 submit/tizen_6.5/20211028.161801 tizen_6.5.m2_release
authorjiung-yu <jiung.yu@samsung.com>
Thu, 23 Sep 2021 17:32:15 +0000 (02:32 +0900)
committerjiung-yu <jiung.yu@samsung.com>
Thu, 23 Sep 2021 18:37:26 +0000 (03:37 +0900)
Change-Id: Icf4289d059816e902a23fd61f181d6676bbafc39
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
include/uwb.h
packaging/capi-network-uwb.spec
src/uwb-private.h
src/uwb-util.c
src/uwb.c
tests/capi-network-uwb-test.c

index a6ad8493a48dbfff9909e946cb6bba34468a3db2..bd88bcc71cbf13d54fabb37d8f3913f8ee4e4d1b 100755 (executable)
@@ -99,6 +99,9 @@ int uwb_node_get_node_id(uwb_node_h node, uint64_t *node_id);
 int uwb_node_get_pan_id(uwb_node_h node, uint64_t *pan_id);
 int uwb_node_get_is_remote(uwb_node_h node, bool *is_remote);
 int uwb_node_get_position(uwb_node_h node, int *x, int *y, int *z);
+int uwb_node_get_range(uwb_node_h node, int *range);
+int uwb_node_get_aoa(uwb_node_h node, int *aoa);
+int uwb_node_get_pdoa(uwb_node_h node, int *pdoa);
 
 #ifdef __cplusplus
 }
index 06e5808b118f51dacc93704063f31b982fed4904..43e9f8cea65c84d8b23caf1f62ad9a2bbeeef989 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-network-uwb
 Summary:    UWB CAPI
-Version:    0.1.3
+Version:    0.2.0
 Release:    0
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index 117dff36a0371a7fbd89d339eb41d2255d06cd21..443b9a08011ecad79f26ca12f2d1c9808ea6e813 100755 (executable)
@@ -73,6 +73,9 @@ typedef struct {
        int x;
        int y;
        int z;
+       int range;
+       int aoa;
+       int pdoa;
 } uwb_node_s;
 
 typedef struct {
index 6a901e738ed74ad9311c6773399ea32510fe3de2..799e8deaa4201a4cddde3244305e26d0beb4c5e9 100755 (executable)
@@ -69,6 +69,12 @@ uwb_node_s *uwb_util_get_node_from_variant(GVariant *va)
                        node->y = g_variant_get_int32(key_value);
                else if (g_strcmp0(key, "Z") == 0)
                        node->z = g_variant_get_int32(key_value);
+               else if (g_strcmp0(key, "Range") == 0)
+                       node->range = g_variant_get_int32(key_value);
+               else if (g_strcmp0(key, "Aoa") == 0)
+                       node->aoa = g_variant_get_int32(key_value);
+               else if (g_strcmp0(key, "Pdoa") == 0)
+                       node->pdoa = g_variant_get_int32(key_value);
        }
 
        g_variant_iter_free(iter);
index 7b378abd29aa6a9c3085a7f88944f330a4812bf5..a39ba3f999a20cbc91fb7b8890ceb51d3e436f39 100755 (executable)
--- a/src/uwb.c
+++ b/src/uwb.c
@@ -912,6 +912,9 @@ EXPORT_API int uwb_node_clone(uwb_node_h src, uwb_node_h *dst)
        _dst->x = _src->x;
        _dst->y = _src->y;
        _dst->z = _src->z;
+       _dst->range = _src->range;
+       _dst->aoa = _src->aoa;
+       _dst->pdoa = _src->pdoa;
 
        _END();
 
@@ -1028,6 +1031,58 @@ EXPORT_API int uwb_node_get_position(uwb_node_h node, int *x, int *y, int *z)
 
        return ret;
 }
+EXPORT_API int uwb_node_get_range(uwb_node_h node, int *range)
+{
+       int ret = UWB_ERROR_NONE;
+
+       CHECK_FEATURE_SUPPORTED(UWB_FEATURE);
+
+       _BEGIN();
+
+       uwb_check_null_ret_error("node", node, UWB_ERROR_INVALID_PARAMETER);
+       uwb_check_null_ret_error("range", range, UWB_ERROR_INVALID_PARAMETER);
+       *range = ((uwb_node_s *)node)->range;
+
+       _END();
+
+       return ret;
+}
+
+EXPORT_API int uwb_node_get_aoa(uwb_node_h node, int *aoa)
+{
+       int ret = UWB_ERROR_NONE;
+
+       CHECK_FEATURE_SUPPORTED(UWB_FEATURE);
+
+       _BEGIN();
+
+       uwb_check_null_ret_error("node", node, UWB_ERROR_INVALID_PARAMETER);
+       uwb_check_null_ret_error("aoa", aoa, UWB_ERROR_INVALID_PARAMETER);
+
+       *aoa = ((uwb_node_s *)node)->aoa;
+
+       _END();
+
+       return ret;
+}
+
+EXPORT_API int uwb_node_get_pdoa(uwb_node_h node, int *pdoa)
+{
+       int ret = UWB_ERROR_NONE;
+
+       CHECK_FEATURE_SUPPORTED(UWB_FEATURE);
+
+       _BEGIN();
+
+       uwb_check_null_ret_error("node", node, UWB_ERROR_INVALID_PARAMETER);
+       uwb_check_null_ret_error("pdoa", pdoa, UWB_ERROR_INVALID_PARAMETER);
+
+       *pdoa = ((uwb_node_s *)node)->pdoa;
+
+       _END();
+
+       return ret;
+}
 
 static void __get_network_cb(GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
@@ -1129,6 +1184,9 @@ static gpointer __copy_node(gconstpointer src, gpointer data)
        dst_ptr->x = src_ptr->x;
        dst_ptr->y = src_ptr->y;
        dst_ptr->z = src_ptr->z;
+       dst_ptr->range = src_ptr->range;
+       dst_ptr->aoa = src_ptr->aoa;
+       dst_ptr->pdoa = src_ptr->pdoa;
 
        return (gpointer)dst_ptr;
 }
index f42c667d422bbbf343b5009d66f184a466ad896d..55f9de0476f649016d54bf9a5b2f0028b574e7b0 100644 (file)
@@ -322,6 +322,7 @@ bool __print_node_info(uwb_node_h node, void *user_data)
        uint64_t pan_id = 0;
        bool is_remote = 0;
        int x = 0, y = 0, z = 0;
+       int range = 0, aoa = 0, pdoa = 0;
        int ret = 0;
 
        if (node == NULL)
@@ -340,6 +341,16 @@ bool __print_node_info(uwb_node_h node, void *user_data)
 
        printf("Distance :%llu Node ID: %llu Pan ID: %llu\n", distance, node_id, pan_id);
        printf("Position X: %d Y: %d Z: %d\n", x, y, z);
+
+       ret = uwb_node_get_range(node, &range);
+       __print_result(ret, "uwb_node_get_range");
+       ret = uwb_node_get_aoa(node, &aoa);
+       __print_result(ret, "uwb_node_get_aoa");
+       ret = uwb_node_get_pdoa(node, &pdoa);
+       __print_result(ret, "uwb_node_get_pdoa");
+       printf("AoA related range: %d aoa: %d pdoa: %d\n", range, aoa, pdoa);
+
+
        return true;
 }