Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / systemservice / logger_service / server / include / ss_logger_device_detection.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_NS_InterfaceunifiedLogCapture
19 /// \brief    This file supports USB logging threads.
20 ///
21 ///////////////////////////////////////////////////////////////////////////////
22 #ifndef LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_DEVICE_DETECTION_H_
23 #define LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_DEVICE_DETECTION_H_
24
25 #include <system_service/ss_devicedetection_service_notifications.h>
26 #include <system_service/ss_devicedetection_service_ifc.h>
27 #include "ss_logger_cfg.h"
28 #include "ss_logger_util.h"
29
30 extern const char * USB_INSERTED_RULE;
31
32 // USB device is ejected
33 extern const CHAR USB_EJECTED_RULE[];
34
35 // The trigger event file (/log/retrievelog.evt) file is found on USB
36 extern const CHAR USB_CAPTURE_LOG_EVENT_RULE[];
37
38 // When the command to update system with script is executed all the console
39 // output will be redirected to this file on /tmp folder. later it will be
40 // moved to USB stick
41 extern const CHAR CAPTURE_LOG_FILENAME[];
42
43 //
44 extern const SI_32 INVALID_FD;
45 class CLoggerDeviceDetection {
46  public:
47   CLoggerDeviceDetection();
48   ~CLoggerDeviceDetection();
49
50   EFrameworkunifiedStatus Initialize(HANDLE hApp, CLoggerCfg *f_pLoggerCfg);
51   EFrameworkunifiedStatus DD_ServiceAvailabilityCallBack(HANDLE hApp);
52   EFrameworkunifiedStatus DD_OpenSessionAckCallBack(HANDLE hApp);
53   EFrameworkunifiedStatus DD_CloseSessionAckCallBack(HANDLE hApp);
54   EFrameworkunifiedStatus DD_CloseSessionWithDevDetectionSrv(HANDLE hApp);
55   EFrameworkunifiedStatus DD_MediaDetectCallBack(HANDLE hApp);
56
57   EFrameworkunifiedStatus OnStop(void);
58  private:
59   CLoggerCfg *m_pLoggerCfg;
60
61   /// Device Detection Class Instance
62   DeviceDetectionServiceIf m_devDetect;
63
64   CLoggerUtil *m_loggerUtil;
65 };
66 #endif  // LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_DEVICE_DETECTION_H_