summaryrefslogtreecommitdiffstats
path: root/include/sim.h
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-09-06 00:19:36 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-09-06 00:19:36 +0200
commitf35a9bbd1ebb52433f313c675fbe01bb1ca96d7d (patch)
treec1aff224fd4a2ea2e5e06805c7caff5406b0ab42 /include/sim.h
parent06cf4fe68ad096961b4b9c653ba2bc31d270f009 (diff)
downloadqmi-ril-f35a9bbd1ebb52433f313c675fbe01bb1ca96d7d.tar.gz
qmi-ril-f35a9bbd1ebb52433f313c675fbe01bb1ca96d7d.tar.bz2
qmi-ril-f35a9bbd1ebb52433f313c675fbe01bb1ca96d7d.zip
initial version of QMI-RILHEADmaster
The RIL uses libqmi. qmicli and ModemManager were used as references for using libqmi. The request processing is modelled after Samsung-RIL and a lot of code could be reused for QMI-RIL. Establishing a data connection succeeds and mobile data is working in early testing. However, there is not yet a routine for handling interruptions and notifying Android about them. Information about the serving network including signal strength are retrieved and an unlocked SIM card is recognized. Reading data from the SIM and requesting the usual device information should work as well. Support for voice calls and SMS is completely missing at this point. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'include/sim.h')
-rw-r--r--include/sim.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/sim.h b/include/sim.h
new file mode 100644
index 0000000..2adbfff
--- /dev/null
+++ b/include/sim.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of QMI-RIL.
+ *
+ * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr>
+ * Copyright (C) 2017 Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
+ *
+ * QMI-RIL is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * QMI-RIL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with QMI-RIL. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SIM_H_
+#define _SIM_H_
+
+#define SIM_COMMAND_READ_BINARY 0xB0
+#define SIM_COMMAND_UPDATE_BINARY 0xD6
+#define SIM_COMMAND_READ_RECORD 0xB2
+#define SIM_COMMAND_UPDATE_RECORD 0xDC
+#define SIM_COMMAND_SEEK 0xA2
+#define SIM_COMMAND_GET_RESPONSE 0xC0
+
+#define SIM_FILE_STRUCTURE_TRANSPARENT 0x00
+#define SIM_FILE_STRUCTURE_LINEAR_FIXED 0x01
+
+#define SIM_FILE_TYPE_MF 0x01
+#define SIM_FILE_TYPE_DF 0x02
+#define SIM_FILE_TYPE_EF 0x04
+
+struct sim_file_response {
+ unsigned char rfu12[2];
+ unsigned short file_size;
+ unsigned short file_id;
+ unsigned char file_type;
+ unsigned char rfu3;
+ unsigned char access_condition[3];
+ unsigned char file_status;
+ unsigned char file_length;
+ unsigned char file_structure;
+ unsigned char record_length;
+} __attribute__((__packed__));
+
+#endif