Modify the map agent for gtest
[platform/core/connectivity/bluetooth-agent.git] / map-agent / bluetooth_map_agent.h
1 /*
2  * Bluetooth-agent
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef __DEF_BT_PB_AGENT_H_
25 #define __DEF_BT_PB_AGENT_H_
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #include <unistd.h>
32 #include <dlog.h>
33 #include <stdio.h>
34 #include <glib.h>
35 #include "bluetooth_map_types.h"
36
37 typedef enum {
38         BT_MAP_AGENT_ERROR_INTERNAL,
39         BT_MAP_AGENT_ERROR_CANCEL,
40 } bt_map_agent_error_t;
41
42 #define BT_MAP_SERVICE_OBJECT_PATH "/org/bluez/map_agent"
43 #define BT_MAP_SERVICE_NAME "org.bluez.map_agent"
44 #define BT_MAP_SERVICE_INTERFACE "org.bluez.MapAgent"
45
46 #undef LOG_TAG
47 #define LOG_TAG "BLUETOOTH_AGENT_MAP"
48 #define INFO(fmt, args...) SLOGI(fmt, ##args)
49 #define DBG(fmt, args...) SLOGD(fmt, ##args)
50 #define ERR(fmt, args...) SLOGE(fmt, ##args)
51
52 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
53 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
54
55 #define FUCNTION_CALLS
56 #ifdef FUCNTION_CALLS
57 #define FN_START        DBG("ENTER==>")
58 #define FN_END          DBG("EXIT===>")
59 #else
60 #define FN_START
61 #define FN_END
62 #endif
63
64 #define retv_if(expr, val) \
65         do { \
66                 if (expr) { \
67                         ERR("(%s) return", #expr); \
68                         return (val); \
69                 } \
70         } while (0)
71
72 void _bt_mns_client_event_notify(gchar *event, guint64 handle,
73                                         gchar *folder, gchar *old_folder,
74                                         gchar *msg_type);
75 int _bt_update_id(guint64 map_id, int new_uid, int msg_type);
76 gboolean _bt_validate_msg_data(message_info_t *msg_info);
77 void _bt_message_info_free(gpointer data);
78 void _get_msg_timestamp(time_t *ltime, char *timestamp);
79 guint64 _bt_add_id(int uid, int msg_type);
80 guint64 _bt_validate_uid(int uid, int msg_type);
81 gboolean is_mns_connected(void);
82 gchar *_bt_get_sms_pdu_from_msg_data(gchar *number, char *msg, time_t tm,
83                 int *msg_pdu_len);
84 gboolean _bt_verify_read_status(message_info_t *msg_info, guint8 read_status);
85 gboolean _bt_verify_sender(message_info_t *msg_info, char *sender);
86 gboolean _bt_verify_receiver(message_info_t *msg_info, char *receiver);
87 gboolean _bt_verify_time(message_info_t *msg_info, map_msg_filter_t *filter);
88 gboolean _bt_filter_priority(message_info_t *msg_info, guint8 priority);
89
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif /* __DEF_BT_AGENT_H_ */