summaryrefslogtreecommitdiff
path: root/include/tapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/tapi.h')
-rwxr-xr-xinclude/tapi.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/tapi.h b/include/tapi.h
new file mode 100755
index 0000000..ca76a2d
--- /dev/null
+++ b/include/tapi.h
@@ -0,0 +1,84 @@
+/*
+ * pwlock
+ *
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __PWLOCK_TAPI_H__
+#define __PWLOCK_TAPI_H__
+
+#include <tapi_common.h>
+#include <TapiUtility.h>
+#include <ITapiSim.h>
+
+enum sim_stat {
+ SIM_ERROR = -1,
+ SIM_RETRY = 0,
+ SIM_OK,
+ SIM_EMPTY,
+ SIM_REQ_PIN,
+ SIM_REQ_PUK,
+ SIM_REQ_LOCK,
+ SIM_REQ_NCK,
+ SIM_REQ_NSCK,
+ SIM_REQ_SPCK,
+ SIM_REQ_CCK,
+ SIM_BLOCKED,
+ SIM_WAITING,
+ SIM_REQUIRED_EVENT,
+ SIM_LOCK_INFO
+};
+
+struct pwlock_tapi_info {
+ enum sim_stat st; /* RETRY, OK, ERROR */
+ int retry_cnt;
+};
+
+struct tapi {
+ TapiHandle *handle;
+ struct tapi_event *evt;
+ int evt_sz;
+
+ void *cb_data;
+ void (*cb) (struct pwlock_tapi_info *, void *);
+};
+
+struct tapi_event {
+ char *event;
+ void (*tapi_notification_cb)(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+};
+
+struct tapi *pwlock_tapi_init(void (*cb) (struct pwlock_tapi_info *, void *), void *data);
+void pwlock_tapi_exit(struct tapi **t);
+int pwlock_tapi_ready_check(void);
+int pwlock_tapi_get_sim_lock_info(struct tapi* t);
+
+enum sim_stat pwlock_tapi_check_sim(struct tapi *t, int *changed);
+
+/* tapi wrapper */
+int pwlock_tapi_verify_pins(struct tapi *t, char *code);
+int pwlock_tapi_verify_puks(struct tapi *t, char *code, char *newcode);
+int pwlock_tapi_verify_lock(struct tapi *t, char *code);
+int pwlock_tapi_disable_net_pers(struct tapi *t, char *code, TelSimLockType_t type);
+
+/* callbacks */
+void pwlock_tapi_noti_modem_power_cb(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+void pwlock_tapi_noti_sim_status_cb(TapiHandle *handle, const char *noti_id, void *data, void *user_data);
+void pwlock_tapi_verify_sim_pins_and_puks_cb(TapiHandle *handle, int result, void *data, void *user_data);
+void pwlock_tapi_disable_sim_facility_cb(TapiHandle *handle, int result, void *data, void *user_data);
+void pwlock_tapi_get_sim_lock_info_cb(TapiHandle *handle, int result, void *data, void *user_data);
+
+#endif /* __PWLOCK_TAPI_H__ */