diff options
author | PaulK <contact@paulk.fr> | 2012-02-03 21:37:08 +0100 |
---|---|---|
committer | PaulK <contact@paulk.fr> | 2012-02-03 21:41:05 +0100 |
commit | 4a9af56d9831dfb1ad79b8ce9fbc8408d1d46351 (patch) | |
tree | 62d6558ee44412c195cb9cfb04fd6424ec3c74ed | |
parent | 303fbc0cd4430fdf656c711a0060cbc07ff6556c (diff) | |
download | external_libsamsung-ipc-4a9af56d9831dfb1ad79b8ce9fbc8408d1d46351.zip external_libsamsung-ipc-4a9af56d9831dfb1ad79b8ce9fbc8408d1d46351.tar.gz external_libsamsung-ipc-4a9af56d9831dfb1ad79b8ce9fbc8408d1d46351.tar.bz2 |
Fixed H1 device and devices-related fixes
-rw-r--r-- | Android.mk | 5 | ||||
-rw-r--r-- | samsung-ipc/device/h1/h1_ipc.c | 6 | ||||
-rw-r--r-- | samsung-ipc/ipc.c | 15 |
3 files changed, 20 insertions, 6 deletions
@@ -45,9 +45,12 @@ samsung-ipc_files := \ samsung-ipc/misc.c \ samsung-ipc/net.c \ samsung-ipc/sec.c \ - samsung-ipc/device/$(samsung-ipc_device)/$(samsung-ipc_device)_ipc.c + samsung-ipc/device/h1/h1_ipc.c \ + samsung-ipc/device/crespo/crespo_ipc.c \ + samsung-ipc/device/aries/aries_ipc.c LOCAL_SRC_FILES := $(samsung-ipc_files) +LOCAL_CFLAGS += -DIPC_DEVICE_EXPLICIT=\"$(samsung-ipc_device)\" LOCAL_SHARED_LIBRARIES := libutils LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \ diff --git a/samsung-ipc/device/h1/h1_ipc.c b/samsung-ipc/device/h1/h1_ipc.c index 1f6b825..ffe5ca3 100644 --- a/samsung-ipc/device/h1/h1_ipc.c +++ b/samsung-ipc/device/h1/h1_ipc.c @@ -131,7 +131,7 @@ int h1_ipc_send(struct ipc_client *client, struct ipc_message_info *request) hex_dump(frame, frame_length); - client->handlers->write(frame, frame_length, client->handlers->io_data); + client->handlers->write(frame, frame_length, client->handlers->write_data); free(frame); @@ -147,14 +147,14 @@ int h1_ipc_recv(struct ipc_client *client, struct ipc_message_info *response) int num_read; int left; - num_read = client->handlers->read((void*)buf, sizeof(buf), client->handlers->io_data); + num_read = client->handlers->read((void*)buf, sizeof(buf), client->handlers->read_data); if(num_read == sizeof(buf) && *buf == FRAME_START) { frame_length = (unsigned short*)&buf[1]; left = (*frame_length - 3 + 1); data = (unsigned char*)malloc(left); - num_read = client->handlers->read((void*)data, left, client->handlers->io_data); + num_read = client->handlers->read((void*)data, left, client->handlers->read_data); if(num_read == left && data[left-1] == FRAME_END) { ipc = (struct ipc_header*)data; diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 67a9cfe..7ac9694 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -30,6 +30,7 @@ #include <termios.h> #include <fcntl.h> #include <string.h> +#include <ctype.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/types.h> @@ -66,7 +67,7 @@ int ipc_device_detect(void) #ifdef IPC_DEVICE_EXPLICIT for(i=0 ; i < ipc_devices_count ; i++) { - if(strcmp(IPC_DEVICE_EXPLICIT, ipc_device[i].name) == 0) + if(strcmp(IPC_DEVICE_EXPLICIT, ipc_devices[i].name) == 0) { index = i; break; @@ -87,9 +88,19 @@ int ipc_device_detect(void) int rc; if ((rc = strncmp(pch, "Hardware", 9)) == 9) { + char *str = (void *) (pch + 9); + int len = strlen(str); + char tmp; + + for(i=0 ; i < len ; i++) + { + tmp = (char) tolower(str[i]); + str[i] = tmp; + } + for(i=0 ; i < ipc_devices_count ; i++) { - if(strcmp(pch, ipc_devices[i].board_name) == 0) + if(strstr(pch, ipc_devices[i].board_name) != NULL) { index = i; break; |