aboutsummaryrefslogtreecommitdiffstats
path: root/Android.mk
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-01-21 10:47:36 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-02-02 13:29:11 +0100
commitf712b6252090b2be4f7683da2d6b037c8ad549fb (patch)
tree5ee07b49b927c03b2cae046cc137f001c1129728 /Android.mk
parent7b58fc01338e7ecde37b9fe6257fe2c06377bd02 (diff)
downloadhardware_replicant_libsamsung-ipc-f712b6252090b2be4f7683da2d6b037c8ad549fb.tar.gz
hardware_replicant_libsamsung-ipc-f712b6252090b2be4f7683da2d6b037c8ad549fb.tar.bz2
hardware_replicant_libsamsung-ipc-f712b6252090b2be4f7683da2d6b037c8ad549fb.zip
[wip] tools: add ipc-imei
The idea here is to use that to validate that libsamsung-ipc works fine by reading some information of the modem data or the SIM card through libsamsung-ipc. The code is written in a way that enables code sharing as much as possible to be able to build other custom tests or tools for other usages (like a PCSC interface to the SIM card for instance). In the long run, the idea would be to be able to write very simple applications without the huge boilerplate that is needed to handle the modem and concentrate on the specific information the application needs to send and receive. A very simple application could for instance look like that: /* A free softrware license */ /* Some includes */ /* callbacks for logging */ static int my_callback(struct ipc_client *client, struct ipc_message *resp, void* data) { /* User code */ } static do_something(struct ipc_client *client) { /* User code */ } int main(int argc, char** argv) { [...] client = ipc_client_create(IPC_CLIENT_TYPE_FMT); if (client == NULL) { printf("Creating client failed\n"); return 1; } rc = init_modem(&client, STATE_LPM) if (rc < 0) return rc; register_callback(&my_callback, NULL); do_something(&client); return 0; } The boilerplate would then be provided in another C file and/or linked to from a small library. +======+ | TODO | +======+ The tool-name in this commit message need to be changed from ipc-sim to ipc-imei as that was done in the code already. On Replicant 6, we still have a segfault when exiting though: [D] ipc-sim: modem_read_loop done [D] modem_stop: ipc_client_close [D] modem_stop: ipc_client_power_off [D] modem_stop: Modem stopped [1] + Segmentation fault ipc-sim In addition, we still need to fix the startup code as it segfaults on Replicant 6 about 50% of the time: [D] modem_start: requested state MODEM_STATE_LPM: 1 [D] Starting i9300 modem boot [D] Opened modem image device [D] Mapped modem image data to memory [D] Opened modem boot device [D] Opened modem link device [D] Turned the modem off [D] Turned the modem on [D] Waited for link connected [D] Wrote ATAT in ASCII [D] Reading boot ACK failed [D] Sending XMM626 HSIC PSI failed [D] Booting failed: error -1 [1] + Stopped (signal) ipc-sim Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk16
1 files changed, 16 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 386bd77..2bb59a5 100644
--- a/Android.mk
+++ b/Android.mk
@@ -161,6 +161,22 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(local_export_c_include_dirs)
include $(BUILD_SHARED_LIBRARY)
##################
+# ipc-imei tool #
+##################
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/android_versions.mk
+
+LOCAL_MODULE := ipc-imei
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := tools/ipc-imei.c tools/common/modem.c
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/tools/include/glibc
+LOCAL_SHARED_LIBRARIES := libsamsung-ipc
+
+include $(BUILD_EXECUTABLE)
+
+##################
# ipc-modem tool #
##################
include $(CLEAR_VARS)