summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiung-yu <jiung.yu@samsung.com>2021-09-24 02:30:07 +0900
committerJiung Yu <jiung.yu@samsung.com>2021-09-23 23:08:30 +0000
commit4bcc1454b9c816310f90e3ea6612301f2a6dba40 (patch)
tree62636faa3d802e2ebe14f9d864a32f7130648e78
parent8f2b93c2aa360ea7a8fb359af8f21a825b3c5ab2 (diff)
downloaduwb-manager-tizen_7.0.tar.gz
uwb-manager-tizen_7.0.tar.bz2
uwb-manager-tizen_7.0.zip
Change-Id: Ie3b51cb1d0b8e2c51360e4087ca5a08731248aa0 Signed-off-by: Yu jiung <jiung.yu@samsung.com>
-rw-r--r--include/LocationManager.h4
-rwxr-xr-xinclude/Node.h21
-rwxr-xr-xinclude/uwb-def.h5
-rwxr-xr-xpackaging/uwb-manager.spec2
-rw-r--r--src/LocationManager.cpp16
-rw-r--r--src/UwbDbusIfaceAdapter.cpp6
6 files changed, 45 insertions, 9 deletions
diff --git a/include/LocationManager.h b/include/LocationManager.h
index 25ab3c7..07607ed 100644
--- a/include/LocationManager.h
+++ b/include/LocationManager.h
@@ -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;}
diff --git a/include/Node.h b/include/Node.h
index bfaf9b3..9dc65e6 100755
--- a/include/Node.h
+++ b/include/Node.h
@@ -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;
diff --git a/include/uwb-def.h b/include/uwb-def.h
index 3467076..84a1be2 100755
--- a/include/uwb-def.h
+++ b/include/uwb-def.h
@@ -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;
diff --git a/packaging/uwb-manager.spec b/packaging/uwb-manager.spec
index 635b552..588cda0 100755
--- a/packaging/uwb-manager.spec
+++ b/packaging/uwb-manager.spec
@@ -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
diff --git a/src/LocationManager.cpp b/src/LocationManager.cpp
index 5d51634..89bfcf4 100644
--- a/src/LocationManager.cpp
+++ b/src/LocationManager.cpp
@@ -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();
diff --git a/src/UwbDbusIfaceAdapter.cpp b/src/UwbDbusIfaceAdapter.cpp
index 09b09e8..8ac7cee 100644
--- a/src/UwbDbusIfaceAdapter.cpp
+++ b/src/UwbDbusIfaceAdapter.cpp
@@ -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);
}