> 5.7 | AT^SPWD Change Password

> The AT^SPWD command comprises all functions of the AT+CPWD command. Apart from the different prefixes "^SPWD" and "+CPWD", the major difference is that the <facility> list of AT^SPWD includes the additional "CM" password dedicated to the Customer SIM Lock. Set with the command AT^SCSL, this type of lock allows the application manufacturer to lock a mobile to specific operators.
> The Customer SIM Lock feature is designed to be configurable during the production of the mobile application. Therefore, to program the "CM" password, the AT^SPWD write command can be used no matter whether the SIM is inserted or PIN authentication has been done. Opposite to that, passwords for all other facilities can only be edited if the SIM is present and PIN authentication completed.
> IMPORTANT: Please note that, even though there is no need for a factory set Customer SIM Lock, you are strongly advised to specify at least a "CM" password, avoiding that end users ever have a chance to activate this lock type.
> Each password is a string of digits the length of which varies with the associated facility. The test command returns a list of pairs which represent the available facilities and the maximum length of the associated password.
> See also AT commands AT+CLCK and AT^SLCK as well as AT^SCSL for more detail on the various lock features.
> Syntax

> Test Command AT^SPWD=?
> Response(s)
> ^SPWD:list of supported ( <facility>, <password length>)
> OK

> Write Command AT^SPWD=<facility>[, <old password>][, <new password>]
> Response(s)
> New password has been registered for the facility lock function.
> OK
> If parameter <old password> was not correct:
> +CME ERROR 16 (+CME ERROR: incorrect password)
> If the password for the selected <facility> has been invalidated due to too many failed attempts:
> +CME ERROR ...
> In case of trying to set a "CM" password although another type of factory set SIM lock is already active:
> +CME ERROR: Operation not supported.
> If error is related to ME functionality:
> +CME ERROR

> PIN |  | ASC0 | ASC1 | USB | MUX1 | MUX2 | MUX3 |  |  | Charge | Q | Last
> ± |  | + | + | + | + | + | + |  |  | - | ± | -

> Parameter Description

> <facility>(str)

> “CM“
> Password used as Customer Mastercode for Customer SIM Lock.
> Defining the "CM" password allows the application manufacturer to set a Customer SIM Lock by activating a Network Personalization ("PN") with the AT^SCSL command. The "CM" password is mandatory for each operation with AT^SCSL.
> <password length> of "CM": 8 digits.
> To delete the "CM" password use the following syntax: AT^SPWD=<facility>,<old password>. Please note that this action will delete all personalisation data programmed by the manufacturer with AT^SCSL (including the operator list).
> A description of all other passwords commonly supported by AT+CPWD and AT^SPWD can be found in Section 5.6, AT+CPWD. The "CM" password cannot be edited with AT+CPWD.
> Notes

> • | When changing the PIN2 (<facility>="P2") it is recommended to check the new state of PIN2 using the AT+CPIN2 command.

> • | In the airplane mode the write command version for the network related <facility> (AO, OI, OX, AI, IR, AB, AG and AC) is not supported. For remaining facilities the command is fully functional then.

> Examples

> EXAMPLE 1 | To specify the "CM" password required as Customer Mastercode for the Customer SIM Lock:

> AT^SPWD="CM" | Check if the Customer Mastercode was already set.
> ERROR | No, it was not.
> AT^SPWD="CM", ,"12345678" | Specify a new Customer Mastercode (where <old password> is omitted and <new password>"12345678" = new Customer Mastercode)
> OK | The Customer Mastercode has been set to "12345678".
> AT^SPWD="CM" | Checking again.
> OK | Yes, it is active now.

> EXAMPLE 2 | To change the Customer Mastercode:

> AT^SPWD="CM","12345678","44444444" | (where "12345678" = old Customer Mastercode, and "44444444" = new Customer Mastercode).
> OK | The Customer Mastercode has been changed from "12345678" to "44444444".

> EXAMPLE 3 | To delete the Customer Mastercode:

> AT^SPWD="CM","44444444" | Delete the Customer Mastercode by omitting <new password> and entering only the <old password> "44444444".
> OK | The Customer Mastercode as well as all personalisation data programmed by the manufacturer with AT^SCSL were deleted.