Add port setting to TABinaryManager 94/174794/2
authorIgor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Thu, 7 Dec 2017 10:57:01 +0000 (11:57 +0100)
committerIgor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Fri, 6 Apr 2018 09:58:27 +0000 (11:58 +0200)
Change-Id: I713b7015f86a12b704209c64e7cda135d50f9153
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
simulatordaemon/src/TABinaryManager/TABinaryManager.cpp
simulatordaemon/src/TABinaryManager/TABinaryManager.h

index 7fbcb80..4ab2d1c 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015-2018 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -417,6 +417,22 @@ string TABinaryManager::getPort(string uuid) {
        return returnValue;
 }
 
+int TABinaryManager::setPort(string uuid, string port) {
+       int ret;
+       pthread_rwlock_wrlock(&binaryMapLock);
+
+       map<string, StructBinaryInfo>::iterator it = binaryMap.find(uuid);
+       if (it != binaryMap.end()) {
+               it->second.port = port;
+               ret = 0;
+       } else {
+               ret = 1;
+       }
+
+       pthread_rwlock_unlock(&binaryMapLock);
+       return ret;
+}
+
 /**
  * Converts UUID from TEEC_UUID to a string
  * @return string of TEEC_UUID
index b2b471d..4526a62 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015-2018 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -98,6 +98,11 @@ public:
        string getPort(string uuid);
        int isKeepAlive(string uuid, bool &KeepAlive);
 
+       /*
+        * TA property setters
+        */
+       int setPort(string uuid, string port);
+
        virtual ~TABinaryManager();
 };