diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-07-04 00:06:44 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-07-04 00:06:44 +0200 |
commit | e4acdd0a32e3d6f317d860e25488abde209b0e9c (patch) | |
tree | 1cc2b6d129fd966250e95a2be0747180d4948609 /samsung-ipc | |
parent | 960d41a9e018978d1622801def431990983774a4 (diff) | |
download | external_libsamsung-ipc-e4acdd0a32e3d6f317d860e25488abde209b0e9c.zip external_libsamsung-ipc-e4acdd0a32e3d6f317d860e25488abde209b0e9c.tar.gz external_libsamsung-ipc-e4acdd0a32e3d6f317d860e25488abde209b0e9c.tar.bz2 |
misc: IPC_MISC_ME_VERSION request data and new helpers
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/misc.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/samsung-ipc/misc.c b/samsung-ipc/misc.c index b766b3c..f10b9d3 100644 --- a/samsung-ipc/misc.c +++ b/samsung-ipc/misc.c @@ -23,6 +23,17 @@ #include <samsung-ipc.h> +int ipc_misc_me_version_setup(struct ipc_misc_me_version_request_data *data) +{ + if (data == NULL) + return -1; + + memset(data, 0, sizeof(struct ipc_misc_me_version_request_data)); + data->magic = 0xff; + + return 0; +} + char *ipc_misc_me_imsi_imsi_extract(const void *data, size_t size) { struct ipc_misc_me_imsi_header *header; @@ -45,4 +56,22 @@ char *ipc_misc_me_imsi_imsi_extract(const void *data, size_t size) return imsi; } +char *ipc_misc_me_sn_extract(const struct ipc_misc_me_sn_response_data *data) +{ + char *string; + size_t length; + + if (data == NULL || data->length > sizeof(data->data)) + return NULL; + + length = data->length + sizeof(char); + + string = (char *) calloc(1, length); + + strncpy(string, (char *) &data->data, data->length); + string[data->length] = '\0'; + + return string; +} + // vim:ts=4:sw=4:expandtab |