diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2013-06-25 19:53:54 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-06-25 19:53:54 +0200 |
commit | af49aa6be86155889ecece92fae6f58a53fda49a (patch) | |
tree | 1e6329d05e389daa5bf5f5e4c7a7187f93e77647 /include/samsung-ipc.h | |
parent | 256df8e1a96ecbcf2beba771cf865207a3492a8c (diff) | |
download | external_libsamsung-ipc-af49aa6be86155889ecece92fae6f58a53fda49a.zip external_libsamsung-ipc-af49aa6be86155889ecece92fae6f58a53fda49a.tar.gz external_libsamsung-ipc-af49aa6be86155889ecece92fae6f58a53fda49a.tar.bz2 |
Moved radio.h and types.h to samsung-ipc.h (API) and protocol.h (IPC protocol).
Also some minor headers cosmetics.
Change-Id: Id2b988b118d956e91827b9b840e3f384424593ae
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'include/samsung-ipc.h')
-rw-r--r-- | include/samsung-ipc.h | 107 |
1 files changed, 106 insertions, 1 deletions
diff --git a/include/samsung-ipc.h b/include/samsung-ipc.h index 2a15317..3dd9e3c 100644 --- a/include/samsung-ipc.h +++ b/include/samsung-ipc.h @@ -2,6 +2,7 @@ * This file is part of libsamsung-ipc. * * Copyright (C) 2012 Simon Busch <morphis@gravedo.de> + * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com> * * libsamsung-ipc is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +22,111 @@ #ifndef __SAMSUNG_IPC_H__ #define __SAMSUNG_IPC_H__ -#include <radio.h> +/* + * Values + */ + +#define IPC_CLIENT_TYPE_FMT 0x00 +#define IPC_CLIENT_TYPE_RFS 0x01 + +/* + * Structures + */ + +struct ipc_client; +struct ipc_handlers; + +struct ipc_message_info { + unsigned char mseq; + unsigned char aseq; + unsigned char group; + unsigned char index; + unsigned short cmd; + unsigned char type; + unsigned int length; + unsigned char *data; +}; + +struct ipc_client_gprs_capabilities { + int port_list; + int cid_max; +}; + +/* + * Helpers + */ + +typedef void (*ipc_client_log_handler_cb)(const char *message, void *user_data); + +typedef int (*ipc_io_handler_cb)(void *data, unsigned int size, void *io_data); +typedef int (*ipc_handler_cb)(void *io_data); + +struct ipc_client* ipc_client_new(int client_type); +struct ipc_client *ipc_client_new_for_device(int device_type, int client_type); +int ipc_client_free(struct ipc_client *client); + +int ipc_client_set_log_handler(struct ipc_client *client, ipc_client_log_handler_cb log_handler_cb, void *user_data); + +int ipc_client_set_handlers(struct ipc_client *client, struct ipc_handlers *handlers); +int ipc_client_set_io_handlers(struct ipc_client *client, ipc_io_handler_cb read, void *read_data, ipc_io_handler_cb write, void *write_data); + +int ipc_client_set_handlers_common_data(struct ipc_client *client, void *data); +void *ipc_client_get_handlers_common_data(struct ipc_client *client); +int ipc_client_create_handlers_common_data(struct ipc_client *client); +int ipc_client_destroy_handlers_common_data(struct ipc_client *client); +int ipc_client_set_handlers_common_data_fd(struct ipc_client *client, int fd); +int ipc_client_get_handlers_common_data_fd(struct ipc_client *client); + +int ipc_client_bootstrap_modem(struct ipc_client *client); +int ipc_client_open(struct ipc_client *client); +int ipc_client_close(struct ipc_client *client); +int ipc_client_power_on(struct ipc_client *client); +int ipc_client_power_off(struct ipc_client *client); +int ipc_client_gprs_handlers_available(struct ipc_client *client); +int ipc_client_gprs_activate(struct ipc_client *client, int cid); +int ipc_client_gprs_deactivate(struct ipc_client *client, int cid); +char *ipc_client_gprs_get_iface(struct ipc_client *client, int cid); +int ipc_client_gprs_get_capabilities(struct ipc_client *client, struct ipc_client_gprs_capabilities *cap); + +int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response); +void ipc_client_response_free(struct ipc_client *client, struct ipc_message_info *response); + +/* Convenience functions for ipc_send */ +void ipc_client_send(struct ipc_client *client, const unsigned short command, const char type, unsigned char *data, const int length, unsigned char mseq); +void ipc_client_send_get(struct ipc_client *client, const unsigned short command, unsigned char mseq); +void ipc_client_send_exec(struct ipc_client *client, const unsigned short command, unsigned char mseq); + +/* Utility functions */ +void ipc_client_log_recv(struct ipc_client *client, struct ipc_message_info *response, const char *prefix); +void ipc_client_log_send(struct ipc_client *client, struct ipc_message_info *request, const char *prefix); +const char *ipc_response_type_to_str(int type); +const char *ipc_request_type_to_str(int type); +const char *ipc_command_to_str(int command); + +void ipc_client_hex_dump(struct ipc_client *client, void *data, int size); +void *ipc_client_mtd_read(struct ipc_client *client, char *mtd_name, int size, int block_size); +void *ipc_client_file_read(struct ipc_client *client, char *file_name, int size, int block_size); + +/* + * Samsung-IPC protocol + */ + +#include "protocol.h" +#include "pwr.h" +#include "call.h" +#include "sms.h" +#include "sec.h" +#include "pb.h" +#include "disp.h" +#include "net.h" +#include "snd.h" +#include "misc.h" +#include "ss.h" +#include "gprs.h" +#include "sat.h" +#include "imei.h" +#include "rfs.h" +#include "gen.h" #endif |