This means catching if an access code is set when mode switching (we can only guess about this), and allowing the user to specify an access code (and which slot it is set for). We need to think about how to deal with the other flags that are set when removing the access code to deal with those in a sane way.
One approach would be to allow the user to provide an access code (then unset it, mode switch, and re-set it). Another would be to actually be able to configure the access code.
This means catching if an access code is set when mode switching (we can only guess about this), and allowing the user to specify an access code (and which slot it is set for). We need to think about how to deal with the other flags that are set when removing the access code to deal with those in a sane way.
One approach would be to allow the user to provide an access code (then unset it, mode switch, and re-set it). Another would be to actually be able to configure the access code.