[Hilo] How to set AT+CMGS<length> for PDU SMS?

Answer: The formula to calculate the = PDU_LENGTH - SMSC_LEN.
Also here’s an example:
1/ Details of the sample message
SMSC: +8613800755500
Recipient: +861353815xxxx
Alphabet: UCS2 (16bit)
Data: 12345
PDU after encoding:
08 91683108705505F0 11000D91683135180513F00008AA0A00310032003300340035
Here:
08: The length of SMSC address.
91683108705505F0: The SMSC address
2/ AT command:
AT+CMGS=25 ---- the = (68/2)-(1+8) =34-9 =25
> 0891683108705505F011000D91683135180513F00008AA0A00310032003300340035
+CMGS: 35
OK

Please refer to 3GPP TS 27.005 for AT+CMGS, and TS 23.040 for PDU format.