diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-07-04 19:53:11 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-07-04 19:53:11 +0200 |
commit | 8cc083b403632c2b929271e17f1e77ff83e0f7cd (patch) | |
tree | e5c11ab09f9e84cbf95fde8fa20b60ff34a6f3d3 | |
parent | d2ba03448d092158da082e31326fe70a85ec1933 (diff) | |
download | external_libsamsung-ipc-8cc083b403632c2b929271e17f1e77ff83e0f7cd.zip external_libsamsung-ipc-8cc083b403632c2b929271e17f1e77ff83e0f7cd.tar.gz external_libsamsung-ipc-8cc083b403632c2b929271e17f1e77ff83e0f7cd.tar.bz2 |
ipc_utils: Utility to check whether a seq is valid
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | include/samsung-ipc.h | 2 | ||||
-rw-r--r-- | samsung-ipc/ipc_utils.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/samsung-ipc.h b/include/samsung-ipc.h index 7240472..a706f97 100644 --- a/include/samsung-ipc.h +++ b/include/samsung-ipc.h @@ -108,6 +108,8 @@ char *ipc_client_nv_data_secret(struct ipc_client *client); size_t ipc_client_nv_data_size(struct ipc_client *client); size_t ipc_client_nv_data_chunk_size(struct ipc_client *client); +int ipc_seq_valid(unsigned char seq); + const char *ipc_request_type_string(unsigned char type); const char *ipc_response_type_string(unsigned char type); const char *ipc_command_string(unsigned short command); diff --git a/samsung-ipc/ipc_utils.c b/samsung-ipc/ipc_utils.c index 3ca3879..0538387 100644 --- a/samsung-ipc/ipc_utils.c +++ b/samsung-ipc/ipc_utils.c @@ -32,6 +32,14 @@ #include <samsung-ipc.h> #include <ipc.h> +int ipc_seq_valid(unsigned char seq) +{ + if (seq == 0x00 || seq == 0xff) + return 0; + else + return 1; +} + const char *ipc_request_type_string(unsigned char type) { static char type_string[5] = { 0 }; |