Home | History | Annotate | Download | only in telephony

Lines Matching refs:sim

65 asimcard_get_status( ASimCard  sim )
67 return sim->status;
71 asimcard_set_status( ASimCard sim, ASimStatus status )
73 sim->status = status;
77 asimcard_get_pin( ASimCard sim )
79 return sim->pin;
83 asimcard_get_puk( ASimCard sim )
85 return sim->puk;
89 asimcard_set_pin( ASimCard sim, const char* pin )
91 strncpy( sim->pin, pin, A_SIM_PIN_SIZE );
92 sim->pin_retries = 0;
96 asimcard_set_puk( ASimCard sim, const char* puk )
98 strncpy( sim->puk, puk, A_SIM_PUK_SIZE );
99 sim->pin_retries = 0;
104 asimcard_check_pin( ASimCard sim, const char* pin )
106 if (sim->status != A_SIM_STATUS_PIN &&
107 sim->status != A_SIM_STATUS_READY )
110 if ( !strcmp( sim->pin, pin ) ) {
111 sim->status = A_SIM_STATUS_READY;
112 sim->pin_retries = 0;
116 if (sim->status != A_SIM_STATUS_READY) {
117 if (++sim->pin_retries == 3)
118 sim->status = A_SIM_STATUS_PUK;
125 asimcard_check_puk( ASimCard sim, const char* puk, const char* pin )
127 if (sim->status != A_SIM_STATUS_PUK)
130 if ( !strcmp( sim->puk, puk ) ) {
131 strncpy( sim->puk, puk, A_SIM_PUK_SIZE );
132 strncpy( sim->pin, pin, A_SIM_PIN_SIZE );
133 sim->status = A_SIM_STATUS_READY;
134 sim->pin_retries = 0;
138 if ( ++sim->pin_retries == 6 ) {
139 sim->status = A_SIM_STATUS_ABSENT;
157 /* descriptor for a known SIM File */
192 /* convert a SIM File descriptor into an ASCII string,
326 asimcard_io( ASimCard sim, const char* cmd )
390 char* out = sim->out_buff;
395 return "ERROR: INTERNAL SIM ERROR";
397 return sim->out_buff;
411 char* out = sim->out_buff;
420 return sim->out_buff;
430 return "ERROR: UNSUPPORTED SIM COMMAND";
436 snprintf( sim->out_buff, sizeof(sim->out_buff), "+CRSM: 144,0,ffffffffffffffffffffffffffffffffffff0781515525%d1%d%df%dffffffffffff", (sim->port / 1000) % 10, (sim->port / 10) % 10, (sim->port / 100) % 10, sim->port % 10);
437 return sim->out_buff;