2 * This file is part of libsamsung-ipc.
4 * Copyright (C) 2012 Simon Busch <morphis@gravedo.de>
5 * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
7 * libsamsung-ipc is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
12 * libsamsung-ipc is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef __SAMSUNG_IPC_H__
25 #define __SAMSUNG_IPC_H__
31 #define IPC_CLIENT_TYPE_FMT 0x00
32 #define IPC_CLIENT_TYPE_RFS 0x01
42 struct ipc_message_info {
53 struct ipc_client_gprs_capabilities {
62 struct ipc_client *ipc_client_create(int client_type);
63 int ipc_client_destroy(struct ipc_client *client);
65 void ipc_client_log(struct ipc_client *client, const char *message, ...);
66 int ipc_client_set_log_callback(struct ipc_client *client,
67 void (*log_callback)(void *log_data, const char *message), void *log_data);
69 int ipc_client_set_transport_handlers(struct ipc_client *client,
70 int (*open)(void *transport_data, int type),
71 int (*close)(void *transport_data),
72 int (*read)(void *transport_data, void *buffer, unsigned int length),
73 int (*write)(void *transport_data, void *buffer, unsigned int length),
74 int (*poll)(void *transport_data, struct timeval *timeout),
75 void *transport_data);
76 int ipc_client_set_power_handlers(struct ipc_client *client,
77 int (*power_on)(void *power_data),
78 int (*power_off)(void *power_data),
80 int ipc_client_set_gprs_handlers(struct ipc_client *client,
81 int (*gprs_activate)(void *gprs_data, int cid),
82 int (*gprs_deactivate)(void *gprs_data, int cid),
85 int ipc_client_bootstrap(struct ipc_client *client);
86 int ipc_client_send(struct ipc_client *client, const unsigned short command,
87 const char type, unsigned char *data, const int length, unsigned char mseq);
88 int ipc_client_recv(struct ipc_client *client,
89 struct ipc_message_info *response);
90 void ipc_client_response_free(struct ipc_client *client,
91 struct ipc_message_info *response);
93 int ipc_client_open(struct ipc_client *client);
94 int ipc_client_close(struct ipc_client *client);
95 int ipc_client_poll(struct ipc_client *client, struct timeval *timeout);
97 int ipc_client_power_on(struct ipc_client *client);
98 int ipc_client_power_off(struct ipc_client *client);
100 int ipc_client_gprs_activate(struct ipc_client *client, int cid);
101 int ipc_client_gprs_deactivate(struct ipc_client *client, int cid);
103 int ipc_client_data_create(struct ipc_client *client);
104 int ipc_client_data_destroy(struct ipc_client *client);
106 char *ipc_client_gprs_get_iface(struct ipc_client *client, int cid);
107 int ipc_client_gprs_get_capabilities(struct ipc_client *client,
108 struct ipc_client_gprs_capabilities *capabilities);
110 const char *ipc_response_type_to_str(int type);
111 const char *ipc_request_type_to_str(int type);
112 const char *ipc_command_to_str(int command);
113 void ipc_client_hex_dump(struct ipc_client *client, void *data, int size);
114 void ipc_client_log_recv(struct ipc_client *client,
115 struct ipc_message_info *response, const char *prefix);
116 void ipc_client_log_send(struct ipc_client *client,
117 struct ipc_message_info *request, const char *prefix);
118 void ipc_header_fill(struct ipc_header *header, struct ipc_message_info *message);
119 void ipc_message_info_fill(struct ipc_header *header, struct ipc_message_info *message);
122 * Samsung-IPC protocol
125 #include "protocol.h"
144 // vim:ts=4:sw=4:expandtab