I am interfacing with a GSM modem module through the standard GSM AT command interface. Right now the access point names (APN), user names, and passwords for each known carrier are hard coded in my software. I am wondering if this information is provided by the carrier on the SIM card. Is this the case?
I am willing to try to directly access the file structure of the sim card with "+CRSM" or "+CSIM", but would like to know if the APN information is even there before I start. If so, is there a link that describes SIM file structure that contains this information? Many thanks.
SIM cards have many Elementary Files (EF). Ref 3GPP TS 31.102 & ETSI TS 102.221 which are freely available.
One such EF is EF-ACL which is "APN Control List" which can contain the APN names which the Operator wants the Device to use.
Note that EF-ACL can control the Device to use a particular APN, however, it CANNOT provide the APN. The APN should be present in Device's database (eg. apn-conf.xml in Android Phones) or the Device can ask the network to provide an APN (network-provided-APN) Ref. Sec 5.3.14 in 3GPP TS 31.102
The EF-ACL service needs to be "available" in EF-UST and "enabled" in EF-EST for the Device to use it. If it is available & enabled, then the contents can be read using the following AT Command:
at+crsm=176,28503,0,0,255
Here, I have assumed length of the EF-ACL to be 255 Bytes. However, it could be different in different SIMs.