LOGGER(DEBUG) << " pedometer_data->diffs_coun: " << pedometer_data->diffs_count;
if (pedometer_data->diffs_count > 0) {
for (int i = 0; i < pedometer_data->diffs_count; ++i) {
- InsertStepDifference(pedometer_data->diffs[i].steps,
- static_cast<float>(getCurrentTimeStamp(pedometer_data->diffs[i].timestamp) / 1000), &diffs);
+ InsertStepDifference(pedometer_data->diffs[i].steps, getCurrentTimeStamp(pedometer_data->diffs[i].timestamp) / 1000, &diffs);
}
} else {
- InsertStepDifference(steps_so_far > 0.0 ? pedometer_data->steps() - steps_so_far : 0.0,
- static_cast<float>(getCurrentTimeStamp(pedometer_data->timestamp) / 1000), &diffs);
+ InsertStepDifference(steps_so_far > 0.0 ? pedometer_data->steps() - steps_so_far : 0.0, getCurrentTimeStamp(pedometer_data->timestamp) / 1000, &diffs);
}
steps_so_far = pedometer_data->steps();
if (ret.IsError()) return ret;
email_attachment_data_t* tmp = (email_attachment_data_t*)calloc(1, sizeof(email_attachment_data_t));
- if (nullptr == tmp) {
- return LogAndCreateResult(
- ErrorCode::UNKNOWN_ERR, "Unknown error while adding attachment.");
- }
tmp->attachment_name = strdup(att->getShortFileName().c_str());
tmp->attachment_path = strdup(std::string(dirPath + "/"
+ att->getShortFileName()).c_str());
LoggerD("enter");
char* interfaceName = nullptr;
char* hostAddr = nullptr;
- char* gateway = nullptr;
std::unique_ptr<char, void(*)(void*)> host_addr_ptr(nullptr, &std::free);
struct addrinfo* servinfo = nullptr;
if (interfaceName) {
free(interfaceName);
}
- if (gateway) {
- free(gateway);
- }
freeaddrinfo(servinfo);
};
struct in_addr *addr = nullptr;
if (AF_INET == servinfo->ai_family) {
- LoggerD("IPv4 address");
struct sockaddr_in *ipv = (struct sockaddr_in *)servinfo->ai_addr;
addr = &(ipv->sin_addr);
} else {
- LoggerD("IPv6 address");
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)servinfo->ai_addr;
addr = (struct in_addr *) &(ipv6->sin6_addr);
}
-
if (nullptr == inet_ntop(servinfo->ai_family, addr, hostAddr, servinfo->ai_addrlen)) {
LoggerE("Error while calling inet_ntop()");
destroyProfileHandle();
LoggerE("Callback register is failed.");
destroyProfileHandle();
} else {
- int ret = CONNECTION_ERROR_NONE;
- if (AF_INET == servinfo->ai_family) {
- LoggerD("IPv4 add route");
- ret = connection_add_route(m_connection_handle_, interfaceName, hostAddr);
- } else if (AF_INET6 == servinfo->ai_family) {
- LoggerD("IPv6 add route");
- ret = connection_profile_get_gateway_address(
- m_profile_handle_, CONNECTION_ADDRESS_FAMILY_IPV6, &gateway);
-
- if (CONNECTION_ERROR_NONE != ret) {
- LoggerD("Error %d", ret);
- makeErrorCallback(domain_name, kPlatformError);
- return;
- }
-
- ret = connection_add_route_ipv6(m_connection_handle_, interfaceName, hostAddr, gateway);
- } else {
- LoggerE("Unknown ai_family address");
- makeErrorCallback(domain_name, kPlatformError);
- return;
- }
-
- if (CONNECTION_ERROR_NONE != ret) {
+ if (connection_add_route(m_connection_handle_, interfaceName, hostAddr) !=
+ CONNECTION_ERROR_NONE) {
LoggerE("add route is failed.");
connection_profile_unset_state_changed_cb(m_profile_handle_);
makeErrorCallback(domain_name, kPlatformError);
namespace {
const std::string kMemoryStateNormal = "NORMAL";
const std::string kMemoryStateWarinig = "WARNING";
-const double kDisplayInchToMillimeter = 25.4;
+const double kDisplayInchToMillimeter = 2.54;
//Battery
const double kRemainingBatteryChargeMax = 100.0;
const int kVconfErrorNone = 0;
//FETCH PHYSICAL WIDTH
if (dotsPerInchWidth != 0 && screenWidth != 0) {
- physicalWidth = (static_cast<double>(screenWidth) / dotsPerInchWidth) * kDisplayInchToMillimeter;
+ physicalWidth = (screenWidth / dotsPerInchWidth) * kDisplayInchToMillimeter;
} else {
std::string log_msg = "Failed to get physical screen width value";
LoggerE("%s, screenWidth : %d, dotsPerInchWidth: %d", log_msg.c_str(),
//FETCH PHYSICAL HEIGHT
if (dotsPerInchHeight != 0 && screenHeight != 0) {
- physicalHeight = (static_cast<double>(screenHeight) / dotsPerInchHeight) * kDisplayInchToMillimeter;
+ physicalHeight = (screenHeight / dotsPerInchHeight) * kDisplayInchToMillimeter;
} else {
std::string log_msg = "Failed to get physical screen height value";
LoggerE("%s, screenHeight : %d, dotsPerInchHeight: %d", log_msg.c_str(),