I am writing a sim profile and I need to code EF PNN. As per TS31.102 and TS24.008 it shows that EF-PNN has
first byte = Full name for network IEI: '43'
second byte = Length of Full name for network Name contents
Y bytes = Full name for network
So for example, if I want to code to display network name as "Mynetwork", I am coding as
EF PNN = '43094D796E6574776F726B'H
But the output is some junk characters. Can someone throw a light on how to code network name string for EF PNN? Is it not straight ASCII conversion?
Maybe.
You need to pay really close attention to exactly what the specification says for these kinds of AT commands that is doing more special case/advanced/low level stuff (for accessing SIM EF entries I assume you are using
AT+CSIMorAT+CRSM?).For more "mainsteam", "normal" AT commands, like for instance
AT+CPBWfor writing phonebook entries, the string arguments are very likely to be plain strings (NB, subject toAT+CSCSconversion). For the more "special" case/low level commands it might not be. Specifically forAT+CRSM, in chapter 8.18 Restricted SIM access +CRSM in 27.007 the syntax is given asand below it lists
So this command has one (
<data>) that you clearly can treat as a normal string and another one (<pathid>) that you absolutely cannot tell without checking the specified reference (I briefly checked this one and it appears to also be a plain string but with some constraints on what values the string can contain).But the point is you absolutely cannot assume. You must check because many of the AT commands are literally just transparently exposing whatever low level values that is used internally by some part of the mobile stack1.
Now for the network name this appears to be defined in chapter "10.5.3.5a Network Name" in 24.008, and in "Figure 10.5.80/3GPP TS 24.008 Network Name information element" it lists
so you are missing this third byte.
Notice that for coding scheme you actually only have two values to chose from, either GSM default alphabet or UCS2 and to me this then sort of implies that the input value ought not to go through a
AT+CSCStranslation. So if you want to use gsm alphabet the safest bet would be to setAT+CSCS="GSM"first to make sure no translation is done. If you would want to use UCS2 and have runAT+CSCS="UCS2"beforehand I think maybe you would need to double encode the network name for it to be correctly saved, and I think usingAT+CSCS="HEX"instead would be a safer option in that case.1 Speaking of which, while the string in
AT+CPBWis straight forward notice that the<type>parameter literally is the raw, low level 8 bits in theEXT + TON + NPIbyte (Type of number, Numbering plan identification) from the address format specified for SMS messages.E.g. the typical 145 value (0x91, 1001_0001b) is EXT always
1, TON001(International number) and NPI0001(ISDN/telephone numbering plan (E.164/E.163)).