diff options
author | Dongmei Wang <dongme@codeaurora.org> | 2014-12-02 18:39:10 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-12-05 15:15:33 -0800 |
commit | 836bdc4386232b3a86d062f89f3093845d05cb29 (patch) | |
tree | eca28ce187f928bfdaa7291bd7254d9f2c0cad76 /utils/loc_log.cpp | |
parent | 42c543919b189a758445dc1fd59030e735ad30ec (diff) | |
download | gps-836bdc4386232b3a86d062f89f3093845d05cb29.tar.gz |
loc-pla: Create Platform Library Abstraction layer
Defined PLA functions to enable gps libraries to call
platform-dependent library calls transparantly. Removed
fake files and replaced the fake function with defined
PLA functions.
CRs-fixed: 605817
Change-Id: I677f658001329a10ef9b49bd963631a83fb4c85f
Diffstat (limited to 'utils/loc_log.cpp')
-rw-r--r-- | utils/loc_log.cpp | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 597b5b6..c64310e 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,11 +34,7 @@ #include <sys/time.h> #include "loc_log.h" #include "msg_q.h" -#ifdef USE_GLIB -#include <time.h> -#endif /* USE_GLIB */ -#include "log_util.h" -#include "platform_lib_includes.h" +#include <platform_lib_includes.h> #define BUFFER_SIZE 120 @@ -180,55 +176,3 @@ char *loc_get_time(char *time_string, unsigned long buf_size) return time_string; } - - -/*=========================================================================== -FUNCTION loc_logger_init - -DESCRIPTION - Initializes the state of DEBUG_LEVEL and TIMESTAMP - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void loc_logger_init(unsigned long debug, unsigned long timestamp) -{ - loc_logger.DEBUG_LEVEL = debug; - loc_logger.TIMESTAMP = timestamp; -} - - -/*=========================================================================== -FUNCTION get_timestamp - -DESCRIPTION - Generates a timestamp using the current system time - -DEPENDENCIES - N/A - -RETURN VALUE - Char pointer to the parameter str - -SIDE EFFECTS - N/A -===========================================================================*/ -char * get_timestamp(char *str, unsigned long buf_size) -{ - struct timeval tv; - struct timezone tz; - int hh, mm, ss; - gettimeofday(&tv, &tz); - hh = tv.tv_sec/3600%24; - mm = (tv.tv_sec%3600)/60; - ss = tv.tv_sec%60; - snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); - return str; -} - |