ipc_utils: Utility to check whether a seq is valid
authorPaul Kocialkowski <contact@paulk.fr>
Fri, 4 Jul 2014 17:53:11 +0000 (19:53 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Fri, 4 Jul 2014 17:53:11 +0000 (19:53 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
include/samsung-ipc.h
samsung-ipc/ipc_utils.c

index 7240472..a706f97 100644 (file)
@@ -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);
index 3ca3879..0538387 100644 (file)
 #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 };