aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/ipc_utils.c
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-01-21 10:28:41 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-02-01 18:51:36 +0100
commit5a643dd89e2636cea19d9642c3a205d2d20250ec (patch)
tree97bed49241071dad583f65947d7a226efa137515 /samsung-ipc/ipc_utils.c
parent1bfa8812baf86268113de44c1aec2a4a4742ad35 (diff)
downloadhardware_replicant_libsamsung-ipc-5a643dd89e2636cea19d9642c3a205d2d20250ec.tar.gz
hardware_replicant_libsamsung-ipc-5a643dd89e2636cea19d9642c3a205d2d20250ec.tar.bz2
hardware_replicant_libsamsung-ipc-5a643dd89e2636cea19d9642c3a205d2d20250ec.zip
ipc_utils: add ipc_group_string
While ipc_group_string is not used by libsamsung-ipc (yet), it's still a good idea to add it as tools and applications using libsamsung-ipc can then use it to display the group of a command. It's also a better idea to have it in libsamsung-ipc than in each tool using it as libsamsung-ipc centralizes the knowledge about the samsung-ipc protocol, so if new groups appear at some point, the ipc_group_string function could be updated along the way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'samsung-ipc/ipc_utils.c')
-rw-r--r--samsung-ipc/ipc_utils.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/samsung-ipc/ipc_utils.c b/samsung-ipc/ipc_utils.c
index d8b69b7..9c4ccb8 100644
--- a/samsung-ipc/ipc_utils.c
+++ b/samsung-ipc/ipc_utils.c
@@ -357,6 +357,56 @@ const char *ipc_command_string(unsigned short command)
}
}
+const char *ipc_group_string(unsigned char group)
+{
+ static char group_string[5] = { 0 };
+
+ switch (group) {
+ case IPC_GROUP_PWR:
+ return "IPC_GROUP_PWR";
+ case IPC_GROUP_CALL:
+ return "IPC_GROUP_CALL";
+ case IPC_GROUP_SMS:
+ return "IPC_GROUP_SMS";
+ case IPC_GROUP_SEC:
+ return "IPC_GROUP_SEC";
+ case IPC_GROUP_PB:
+ return "IPC_GROUP_PB";
+ case IPC_GROUP_DISP:
+ return "IPC_GROUP_DISP";
+ case IPC_GROUP_NET:
+ return "IPC_GROUP_NET";
+ case IPC_GROUP_SND:
+ return "IPC_GROUP_SND";
+ case IPC_GROUP_MISC:
+ return "IPC_GROUP_MISC";
+ case IPC_GROUP_SVC:
+ return "IPC_GROUP_SVC";
+ case IPC_GROUP_SS:
+ return "IPC_GROUP_SS";
+ case IPC_GROUP_GPRS:
+ return "IPC_GROUP_GPRS";
+ case IPC_GROUP_SAT:
+ return "IPC_GROUP_SAT";
+ case IPC_GROUP_CFG:
+ return "IPC_GROUP_CFG";
+ case IPC_GROUP_IMEI:
+ return "IPC_GROUP_IMEI";
+ case IPC_GROUP_GPS:
+ return "IPC_GROUP_GPS";
+ case IPC_GROUP_SAP:
+ return "IPC_GROUP_SAP";
+ case IPC_GROUP_RFS:
+ return "IPC_GROUP_RFS";
+ case IPC_GROUP_GEN:
+ return "IPC_GROUP_GEN";
+ default:
+ snprintf((char *) &group_string, sizeof(group_string), "0x%02x",
+ (unsigned int)group_string);
+ return group_string;
+ }
+}
+
int ipc_data_dump(struct ipc_client *client, const void *data, size_t size)
{
unsigned int cols = 8;