fcaad44bfc90b7b23318f339e1ccace7bad53ab2
[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 #include <unistd.h>
28 #include <dlog.h>
29 #include <stdio.h>
30 #include <glib.h>
31 #include "bluetooth_map_types.h"
32
33 typedef enum {
34         BT_MAP_AGENT_ERROR_INTERNAL,
35         BT_MAP_AGENT_ERROR_CANCEL,
36 } bt_map_agent_error_t;
37
38 #define BT_MAP_SERVICE_OBJECT_PATH "/org/bluez/map_agent"
39 #define BT_MAP_SERVICE_NAME "org.bluez.map_agent"
40 #define BT_MAP_SERVICE_INTERFACE "org.bluez.MapAgent"
41
42 #undef LOG_TAG
43 #define LOG_TAG "BLUETOOTH_AGENT_MAP"
44 #define INFO(fmt, args...) SLOGI(fmt, ##args)
45 #define DBG(fmt, args...) SLOGD(fmt, ##args)
46 #define ERR(fmt, args...) SLOGE(fmt, ##args)
47
48 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
49 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
50
51 #define FUCNTION_CALLS
52 #ifdef FUCNTION_CALLS
53 #define FN_START        DBG("ENTER==>")
54 #define FN_END          DBG("EXIT===>")
55 #else
56 #define FN_START
57 #define FN_END
58 #endif
59
60 #define retv_if(expr, val) \
61         do { \
62                 if (expr) { \
63                         ERR("(%s) return", #expr); \
64                         return (val); \
65                 } \
66         } while (0)
67
68 void _bt_mns_client_event_notify(gchar *event, guint64 handle,
69                                         gchar *folder, gchar *old_folder,
70                                         gchar *msg_type);
71 int _bt_update_id(guint64 map_id, int new_uid, int msg_type);
72 gboolean _bt_validate_msg_data(message_info_t *msg_info);
73 void _bt_message_info_free(gpointer data);
74 void _get_msg_timestamp(time_t *ltime, char *timestamp);
75 guint64 _bt_add_id(int uid, int msg_type);
76 guint64 _bt_validate_uid(int uid, int msg_type);
77 gboolean is_mns_connected(void);
78 gchar *__bt_get_sms_pdu_from_msg_data(gchar *number, char *msg, time_t tm,
79                 int *msg_pdu_len);
80 gboolean _bt_verify_read_status(message_info_t *msg_info, guint8 read_status);
81 gboolean _bt_verify_sender(message_info_t *msg_info, char *sender);
82 gboolean _bt_verify_receiver(message_info_t *msg_info, char *receiver);
83 gboolean _bt_verify_time(message_info_t *msg_info, map_msg_filter_t *filter);
84 gboolean _bt_filter_priority(message_info_t *msg_info, guint8 priority);
85 #endif /* __DEF_BT_AGENT_H_ */