User manual
Wavecom GSM Modem
This confidential document is the property of WAVECOM and may not be copied or circulated without permission
23
4.9. Enter PIN/PUK code +CPIN
This command is used to validate the PIN code, or to validate the PUK
code (and define a new PIN code).
If the user application try to establish an outgoing call before having
validated the SIM PIN code, then the GSM module will refuse the "ATD"
command with a "+CME ERROR: 11" (SIM PIN required).
It's up to the application to validate the PIN after each reset or power on.
The application shall therefore use the command :
AT+CPIN="<pin>"
Application to GSM AT+CPIN=1234 enter PIN
GSM to application OK PIN correct
Application to GSM AT+CPIN=5678 enter PIN
GSM to application +CME ERROR: 16 incorrect password
After 3 unsuccessful codes, the PUK will then be required. The PUK
validation forces the user to enter as a second parameter a new PIN code
which will be the future PIN code if the PUK validation succeeds. The
application shall therefore use the command :
AT+CPIN="<puk>","<new pin>"
Application to GSM AT+CPIN=1234,5896 enter PUK and new PIN
GSM to application OK PUK correct
Application to GSM AT+CPIN=5000,5896 enter PUK and new PIN
GSM to application +CME ERROR: 16 incorrect password
To know which code has to be entered (or not), the following
interrogation command will be implemented :
AT+CPIN?
The possible responses are :
+CPIN: READY No PIN is needed
+CPIN: SIM PIN PIN is required
+CPIN: SIM PUK PUK is required
+CME ERROR: <err> SIM failure, SIM absent etc.
Please note that in this case the mobile does not finish its response with
the OK string.