#include "common/logger.h"
-// TODO:: hardcoded value, only for IsBluetoothAlwaysOn
+// hardcoded value, only for IsBluetoothAlwaysOn
#define PROFILE_MOBILE 1
namespace extension {
/*API feature*/
/*Network feature*/
-const char* kTizenFeatureBluetoothAlwaysOn = "http://tizen.org/capability/network.bluetooth.always_on"; //TODO mobile/wearable: false, tv: true
+const char* kTizenFeatureBluetoothAlwaysOn = "http://tizen.org/capability/network.bluetooth.always_on"; //hardcoded values for mobile/wearable: false, tv: true
const char* kTizenFeatureOpenglesTextureFormat = "http://tizen.org/feature/opengles.texture_format";
const char* kTizenFeatureCoreApiVersion = "http://tizen.org/feature/platform.core.api.version";
const char* kTizenFeaturePlatfromCoreCpuArch = "http://tizen.org/feature/platform.core.cpu.arch";
sim_mgr->set_spn(result_spn);
sim_mgr->TryReturn();
}
+
+void SimIccidValueCallback(TapiHandle */*handle*/, int result, void *data, void *user_data) {
+ LoggerD("Entered");
+ SimDetailsManager* sim_mgr = static_cast<SimDetailsManager*>(user_data);
+ TelSimAccessResult_t access_rt = static_cast<TelSimAccessResult_t>(result);
+ TelSimIccIdInfo_t *iccid_info = static_cast<TelSimIccIdInfo_t*>(data);
+
+ std::string result_iccid;
+ if (TAPI_SIM_ACCESS_SUCCESS == access_rt) {
+ result_iccid = (char *)iccid_info->icc_num;
+ } else {
+ LoggerW("Failed to retrieve iccid_: %d", access_rt);
+ }
+
+ sim_mgr->set_iccid(result_iccid);
+ sim_mgr->TryReturn();
+}
+
} //namespace
using common::PlatformResult;
} else {
LoggerE("Failed getting spn: %d", result);
}
+
+ result = tel_get_sim_iccid(handle, SimIccidValueCallback, this);
+ if (TAPI_API_SUCCESS == result) {
+ ++to_process_;
+ } else {
+ LoggerE("Failed getting iccid: %d", result);
+ }
}
//prevent returning not filled result
std::lock_guard<std::mutex> lock_sim(sim_info_mutex_);
return PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to get sim imsi");
}
- //TODO add code for iccid value fetching, when proper API would be ready
- iccid_ = "";
return PlatformResult(ErrorCode::NO_ERROR);
}
LoggerD("SPN value: %s", this->spn_.c_str());
};
+void SimDetailsManager::set_iccid(const std::string& iccid) {
+ LoggerD("Entered");
+ std::lock_guard<std::mutex> lock(sim_to_process_mutex_);
+ this->iccid_ = iccid;
+ --to_process_;
+ LoggerD("ICCID value: %s", this->iccid_.c_str());
+};
+
} // namespace systeminfo
} // namespace webapi