2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __STC_MGR_STATISTICS_H__
17 #define __STC_MGR_STATISTICS_H__
22 #define STATISTICS_RULE_APP_ID "app_id"
23 #define STATISTICS_RULE_INTERVAL_FROM "from"
24 #define STATISTICS_RULE_INTERVAL_TO "to"
25 #define STATISTICS_RULE_IFTYPE "iftype"
26 #define STATISTICS_RULE_TIME_PERIOD "granularity"
28 #define RESET_RULE_SUBSCRIBER_ID "subscriber_id"
38 char m_AppID[APP_ID_LEN];
39 char m_SubscriberID[SUBSCRIBER_ID_LEN];
40 iface_type_e m_IfaceType;
41 time_period_e m_TimePeriod;
42 time_interval_s m_Interval;
48 class Statistics : public GDbus {
54 error_e SetRule(const char *app_id, const char *subscriber_id,
55 iface_type_e iface_type, time_t from, time_t to, time_period_e time_period);
56 time_t MakeTime(int year, int mon, int day, int hour, int min);
57 void MakeRuleParams(GVariant **params, int mode);
58 error_e InitStatistics(void);
59 error_e GetStatistics(void);
60 error_e GetTotalStatistics(void);
61 error_e GetAllStatistics(void);
62 error_e ResetStatistics(void);
66 #endif /* __STC_MGR_STATISTICS_H__ */