Add angle of arrival data 98/264498/2 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.5/unified/20211028.101144 accepted/tizen/6.5/unified/20220212.065045 accepted/tizen/7.0/unified/20221110.055804 accepted/tizen/7.0/unified/hotfix/20221116.105232 accepted/tizen/8.0/unified/20231005.093254 accepted/tizen/unified/20210926.235657 submit/tizen/20210924.142521 submit/tizen_6.5/20211028.162201 submit/tizen_6.5/20220209.010525 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorjiung-yu <jiung.yu@samsung.com>
Thu, 23 Sep 2021 17:30:07 +0000 (02:30 +0900)
committerJiung Yu <jiung.yu@samsung.com>
Thu, 23 Sep 2021 23:08:30 +0000 (23:08 +0000)
Change-Id: Ie3b51cb1d0b8e2c51360e4087ca5a08731248aa0
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
include/LocationManager.h
include/Node.h
include/uwb-def.h
packaging/uwb-manager.spec
src/LocationManager.cpp
src/UwbDbusIfaceAdapter.cpp

index 25ab3c70731ee5b53a79faf17aa25faaab9221e7..07607ed59ca183db82a54b5a005b8acbe957c48a 100644 (file)
@@ -49,8 +49,8 @@ public:
        int stop(void);
 
        int updateUwbPosition(void);
-       Node &getCurrentPosition(void) {return _current;};
-       std::map<int, std::unique_ptr<Node>> &getNodeMap(void) {return _node_map;};
+       Node &getCurrentPosition(void);
+       std::map<int, std::unique_ptr<Node>> &getNodeMap(void);
        int requestBroadcast(std::unique_ptr<UwbMqttMessage> mqtt_msg);
 
        bool isPositionBroadcastSourceAvailable(void) {return _position_broadcast_source != 0;}
index bfaf9b371a74e38dabfe689e7c0828359cf44236..9dc65e616b5c93ba078b6e41a092b957d2554b3f 100755 (executable)
@@ -30,24 +30,26 @@ namespace UwbManagerNamespace {
 class Node {
 public:
        Node(): _distance(0), _pan_id(0), _node_id(0), _x(0), _y(0), _z(0),
+       _range(0), _aoa(0), _pdoa(0),
        _is_remote(false), _is_calculated(false), _tech(TECH_UNKNOWN),
        _last_update(std::chrono::steady_clock::now()) {};
 
-       Node(int pan_id, unsigned long long node_id, int x, int y, int z) :
+       Node(int pan_id, unsigned long long node_id, int x, int y, int z, int range, int aoa, int pdoa) :
                _distance(0), _pan_id(pan_id), _node_id(node_id), _x(x), _y(y), _z(z),
+               _range(range), _aoa(aoa), _pdoa(pdoa),
                _is_remote(false), _is_calculated(false), _tech(TECH_UNKNOWN),
                _last_update(std::chrono::steady_clock::now()) {};
 
        Node(uwb_node_s *node) :
                _distance(node->distance), _pan_id(node->pan_id), _node_id(node->node_id),
-               _x(node->x), _y(node->y), _z(node->z), _is_remote(node->is_remote),
-               _is_calculated(false), _tech(TECH_UWB),
+               _x(node->x), _y(node->y), _z(node->z), _range(node->range), _aoa(node->aoa), _pdoa(node->pdoa),
+               _is_remote(node->is_remote), _is_calculated(false), _tech(TECH_UWB),
                _last_update(std::chrono::steady_clock::now()){};
 
        Node(Node *node) :
                _distance(node->_distance), _pan_id(node->_pan_id), _node_id(node->_node_id),
-               _x(node->_x), _y(node->_y), _z(node->_z), _is_remote(node->_is_remote),
-               _is_calculated(node->_is_calculated), _tech(node->_tech),
+               _x(node->_x), _y(node->_y), _z(node->_z), _range(node->_range), _aoa(node->_aoa), _pdoa(node->_pdoa),
+               _is_remote(node->_is_remote), _is_calculated(node->_is_calculated), _tech(node->_tech),
                _last_update(node->_last_update){};
 
        //~Node(){UWB_LOGI("%llu removed", _node_id);}
@@ -68,6 +70,12 @@ public:
        void setY(int y) {_y = y;};
        int getZ(void) {return _z;};
        void setZ(int z) {_z = z;};
+       int getRange(void) {return _range;};
+       void setRange(int range) {_range = range;};
+       int getAoa(void) {return _aoa;};
+       void setAoa(int aoa) {_aoa = aoa;};
+       int getPdoa(void) {return _pdoa;};
+       void setPdoa(int pdoa) {_pdoa = pdoa;};
        bool getIsRemote(void) {return _is_remote;};
        void setIsRemote(bool is_remote) {_is_remote = is_remote;};
        bool getIsCalculated(void) {return _is_calculated;};
@@ -84,6 +92,9 @@ private:
        int _x;
        int _y;
        int _z;
+       int _range;
+       int _aoa;
+       int _pdoa;
        bool _is_remote;
        bool _is_calculated;
        int _tech;
index 3467076a855097c9d1a966982565ed72d7f38d35..84a1be23526e318d506661f4655ac9f1b2e62302 100755 (executable)
@@ -32,7 +32,10 @@ typedef struct {
         int x;
         int y;
         int z;
-} uwb_node_s;
+        int range;
+        int aoa;
+        int pdoa;
+}       uwb_node_s;
 
 typedef struct {
         uint16_t pan_id;
index 635b5523b375e3f113d3c846c22cd5ac5a6d1d0b..588cda0082b5ac9c4533ded996a45a970253585f 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       uwb-manager
 Summary:    This is the daemon managing UWB related functionalities
-Version:    0.0.4
+Version:    0.0.5
 Release:    1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index 5d51634ba62fee857ffa2f32c48aa5f6453548a5..89bfcf4f39c50335e77d4bbf4b165ce5dd856954 100644 (file)
@@ -325,6 +325,22 @@ int LocationManager::connectMqttBroker(const char *server, int port)
        return 0;
 }
 
+Node &LocationManager::getCurrentPosition(void)
+{
+       if (!this->_mqtt_context->isConnected())
+               this->updateUwbPosition();
+
+       return _current;
+}
+
+std::map<int, std::unique_ptr<Node>> &LocationManager::getNodeMap(void)
+{
+       if (!this->_mqtt_context->isConnected())
+               this->updateUwbPosition();
+
+       return _node_map;
+}
+
 void LocationManager::updateOwnUwbPosition(void)
 {
        this->_current = this->_uwb_position->getOwnNode();
index 09b09e846408691b17d851bedd328579d8e99658..8ac7cee17f9234ca10275f7fac150d7088f46fda 100644 (file)
@@ -294,6 +294,12 @@ static void __build_network_variant(std::map<int, std::unique_ptr<Node>> &node_m
                                                g_variant_new_int32(node_ptr->getY()));
                g_variant_builder_add(builder, "{sv}", "Z",
                                                g_variant_new_int32(node_ptr->getZ()));
+               g_variant_builder_add(builder, "{sv}", "Range",
+                                               g_variant_new_int32(node_ptr->getRange()));
+               g_variant_builder_add(builder, "{sv}", "Aoa",
+                                               g_variant_new_int32(node_ptr->getAoa()));
+               g_variant_builder_add(builder, "{sv}", "Pdoa",
+                                               g_variant_new_int32(node_ptr->getPdoa()));
                g_variant_builder_close(builder);
        }