From: sangrae.kim Date: Wed, 22 Jun 2016 12:51:54 +0000 (+0900) Subject: [NFC] Fix the bug - missing AIDData X-Git-Tag: submit/tizen/20160623.020057~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F76061%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [NFC] Fix the bug - missing AIDData before: TCT passrate 98.86% (176/174/2/0/0) after: TCT passrate 100.00% (176/176/0/0/0) Change-Id: I104aa5f8a57c9c5e70f7e77f850ac966b2ca18d3 Signed-off-by: sangrae.kim --- diff --git a/src/nfc/aid_data.cc b/src/nfc/aid_data.cc index c6af525e..04babe2c 100644 --- a/src/nfc/aid_data.cc +++ b/src/nfc/aid_data.cc @@ -16,11 +16,12 @@ #include "nfc/aid_data.h" #include "common/logger.h" +#include "nfc/nfc_util.h" namespace extension { namespace nfc { -AIDData::AIDData(nfc_se_type_e se_type, const char* aid, bool read_only) +AIDData::AIDData(std::string se_type, std::string aid, bool read_only) : se_type_(se_type), aid_(aid), read_only_(read_only) @@ -33,9 +34,9 @@ picojson::value AIDData::toJSON() const { picojson::value retval = picojson::value(picojson::object()); picojson::object& obj = retval.get(); - obj["aid"] = picojson::value(); - obj["type"] = picojson::value(); - obj["readOnly"] = picojson::value(); + obj["aid"] = picojson::value(aid_); + obj["type"] = picojson::value(se_type_); + obj["readOnly"] = picojson::value(read_only_); return retval; } diff --git a/src/nfc/aid_data.h b/src/nfc/aid_data.h index 14774c32..51ed37d5 100644 --- a/src/nfc/aid_data.h +++ b/src/nfc/aid_data.h @@ -28,12 +28,12 @@ namespace nfc { class AIDData { public: - AIDData(nfc_se_type_e se_type, const char* aid, bool read_only); + AIDData(std::string se_type, std::string aid, bool read_only); picojson::value toJSON() const; private: - nfc_se_type_e se_type_; - const char* aid_; + std::string se_type_; + std::string aid_; bool read_only_; }; diff --git a/src/nfc/nfc_adapter.cc b/src/nfc/nfc_adapter.cc index 3ffec237..911f34de 100644 --- a/src/nfc/nfc_adapter.cc +++ b/src/nfc/nfc_adapter.cc @@ -1554,7 +1554,8 @@ static void SaveRow(nfc_se_type_e se_type, AssertMsg(aid, "Poiner can not be null!"); AssertMsg(user_data, "Poiner can not be null!"); AIDDataVector* aids = static_cast(user_data); - aids->push_back(AIDData(se_type, aid, read_only)); + std::string aid_str = std::string(aid); + aids->push_back(AIDData(std::string(NFCUtil::ToStr(se_type)), aid_str, read_only)); }; void NFCAdapter::GetAIDsForCategory(