/* * pwlock * * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.tizenopensource.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 #include #include 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 }; 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 { unsigned int sid; 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); 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); #endif /* __PWLOCK_TAPI_H__ */