From 8e0e00d21146a84c18f9cf9409e187b4fb0248aa Mon Sep 17 00:00:00 2001 From: Riku Nomoto Date: Thu, 19 Nov 2020 12:45:32 +0900 Subject: Init basesystem source codes. Signed-off-by: Riku Nomoto Change-Id: I55aa2f1406ce7f751ae14140b613b53b68995528 --- .../server/include/ss_logger_common.h | 115 +++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 video_in_hal/systemservice/logger_service/server/include/ss_logger_common.h (limited to 'video_in_hal/systemservice/logger_service/server/include/ss_logger_common.h') diff --git a/video_in_hal/systemservice/logger_service/server/include/ss_logger_common.h b/video_in_hal/systemservice/logger_service/server/include/ss_logger_common.h new file mode 100755 index 0000000..80a56af --- /dev/null +++ b/video_in_hal/systemservice/logger_service/server/include/ss_logger_common.h @@ -0,0 +1,115 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/////////////////////////////////////////////////////////////////////////////// +/// \brief This file contains the callback for Notifications and Protocol +/// commands. +/// +/////////////////////////////////////////////////////////////////////////////// + +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup system_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup logger_service + * @ingroup system_service + * @{ + */ + +#ifndef LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_ +#define LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_ + +#include +#include + +const CHAR DEBUG_LOG_PATH_DIR[] = "/tmp/frameworkunifiedlog"; +const CHAR DEBUG_LOG_PATH_FN[] = "/tmp/frameworkunified_debug.log"; +const CHAR TRANSMIT_LOG_PATH_FN[] = "/tmp/interfaceunified_transmit.log"; +const CHAR PERFORMANCE_LOG_PATH_FN[] = "/tmp/frameworkunified_performance.log"; +const CHAR DRINITIAL_LOG_PATH_FN[] = "/tmp/loggerservice_drinitial.log"; +const CHAR DRLOCATION_LOG_PATH_FN[] = "/tmp/loggerservice_drlocation.log"; +const CHAR KERNEL_LOG_PATH_FN[] = "/tmp/kernel.log"; +const CHAR KERNEL_BOOT_LOG_PATH_FN[] = "/ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/kernelboot.log"; + +const UI_32 PERFORMANCELOG_FILE_SZ = 256 * 1024; + +#define CLEAR_LOG_PATH_FN "/nv/BS/ss/logger_service/rwdata/frameworkunifiedlog/" +#define NULLCHAR '\0' + +#define DEBUG_USB_PATH "/mnt/sda1" +#define KERNEL_LOG_PATH_DIR "kernellog" + +template +class cpp_callback { + public: + static CallbackFunctionPtr set(void* pInst) { + if (pInst == NULL) + throw; + ms_pInst = pInst; + return &cpp_callback::call; + } + static EFrameworkunifiedStatus call(HANDLE y) { + if (ms_pInst == NULL) + return eFrameworkunifiedStatusFault; + C* c = static_cast(ms_pInst); + return (c->*M)(y); + } + private: + static void* ms_pInst; +}; + +template +void* cpp_callback::ms_pInst = NULL; + +typedef enum _LoggerServiceStatus { + eLSInit, + eLSStart, + eLSStop, +} ELOGGERSERVICESTATUS; + +typedef enum { + SS_LOGGER_KLOG_GET, /* type : get kernel.log */ + SS_LOGGER_KBOOTLOG_CREATE /* type : create kernelboot.log */ +} SS_LOGGER_KLOG_OPE_TYPE; + +//////////////////////////////////////////////////////////////////////////////////////////// +/// \ingroup StopLoggingFunction +/// \~english @par Summary +/// Stop the logging function. +/// \~english @param [in] hApp +/// HANDLE - Application handle +/// \~english @retval +/// None +/// \~english @par Detail +/// - The API stops the logging function.\n +/// \n +/// - Include ss_logger_common.h +/// - Library libSS_SystemIfUnified.so +/// \~english @par Classification +/// Public +/// \~english @see +/// None +//////////////////////////////////////////////////////////////////////////////////////////// +void StopLoggingFunction(HANDLE hApp); + +#endif // LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_ + +/** @}*/ // end of LoggerService +/** @}*/ // end of SystemService +/** @}*/ // end of BaseSystem -- cgit 1.2.3-korg