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
}
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
int x;
int y;
int z;
+ int range;
+ int aoa;
+ int pdoa;
} uwb_node_s;
typedef struct {
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);
_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();
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)
{
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;
}
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)
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;
}