gisi: Add new API for setting modem remote device
[platform/upstream/ofono.git] / gisi / client.h
1 /*
2  *
3  *  oFono - Open Source Telephony
4  *
5  *  Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __GISI_CLIENT_H
23 #define __GISI_CLIENT_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <stdint.h>
30 #include <glib/gtypes.h>
31
32 #include "modem.h"
33
34 #define G_ISI_CLIENT_DEFAULT_TIMEOUT    (5)
35
36 struct _GIsiClient;
37 typedef struct _GIsiClient GIsiClient;
38
39 GIsiClient *g_isi_client_create(GIsiModem *modem, uint8_t resource);
40 GIsiModem *g_isi_client_modem(GIsiClient *client);
41 uint8_t g_isi_client_resource(GIsiClient *client);
42 void g_isi_client_reset(GIsiClient *client);
43 void g_isi_client_destroy(GIsiClient *client);
44
45 void g_isi_client_set_timeout(GIsiClient *client, unsigned timeout);
46
47 gboolean g_isi_client_send(GIsiClient *client,
48                         const void *__restrict msg, size_t len,
49                         GIsiNotifyFunc notify, void *data,
50                         GDestroyNotify destroy);
51
52 gboolean g_isi_client_vsend(GIsiClient *client,
53                         const struct iovec *iov, size_t iovlen,
54                         GIsiNotifyFunc notify, void *data,
55                         GDestroyNotify destroy);
56
57 gboolean g_isi_client_send_with_timeout(GIsiClient *client,
58                                 const void *__restrict msg,
59                                 size_t len, unsigned timeout,
60                                 GIsiNotifyFunc notify, void *data,
61                                 GDestroyNotify destroy);
62
63 gboolean g_isi_client_vsend_with_timeout(GIsiClient *client,
64                                 const struct iovec *iov,
65                                 size_t iovlen, unsigned timeout,
66                                 GIsiNotifyFunc notify, void *data,
67                                 GDestroyNotify destroy);
68
69 gboolean g_isi_client_ind_subscribe(GIsiClient *client, uint8_t type,
70                                         GIsiNotifyFunc notify, void *data);
71 gboolean g_isi_client_ntf_subscribe(GIsiClient *client, uint8_t type,
72                                         GIsiNotifyFunc notify, void *data);
73
74 gboolean g_isi_client_verify(GIsiClient *client, GIsiNotifyFunc notify,
75                                 void *data, GDestroyNotify destroy);
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif /* __GISI_CLIENT_H */