如何编写AT + CUSD usdd命令以支持最大听筒数量 [英] How to write a AT+CUSD ussd command to support maximum handsets

查看:222
本文介绍了如何编写AT + CUSD usdd命令以支持最大听筒数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到与AT+CUSD命令相关的问题.在某些Gsm调制解调器上,此命令需要三个参数,而在其他Gsm调制解调器上,仅需要两个参数.此外,这些参数的值也不同.

I am facing an issue related to AT+CUSD command. On some Gsm modems, this command expects three parameters while on the others, it expects just two parameters. Moreover, different values of those parameters.

我想知道,如何配置Gsm调制解调器,以便可以在大多数Gsm调制解调器上以统一的方式执行此命令.

例如:在诺基亚c6-01 上,cusd命令仅通过以下方式成功执行:

Forexample: On Nokia c6-01, the cusd command is executed successfully only in this way:

AT+CUSD=1,"*123#",15

索尼爱立信K750:

AT+CUSD=1,"*123#"

如果我输入第三个参数,则会出现错误.

It gives an error if I give a third parameter.

推荐答案

该命令在 27.007 ,语法为

+CUSD=[<n>[,<str>[,<dcs>]]]

因此,实际上所有参数都是可选的,并且可以使用0、1、2或3个参数来调用命令.

so actually all parameters are optional and it is valid to invoke the command with either 0, 1, 2 or 3 arguments.

关于<dsc>值,其指定的默认值0映射到具有德语的GSM 7位默认字母,而值15是GSM 7位的默认字母,根据

Regarding the <dsc> value, its specified default value 0 maps to GSM 7 bit default alphabet with German language and value 15 is GSM 7 bit default alphabet without any specific language according to 23.038 as far as I can tell. It also says

必须实施GSM 7位默认字母.其他字符集的支持是可选的.

Implementation of the GSM 7 bit default alphabet is mandatory. Support of other character sets is optional.

因此,如果诺基亚设备出现AT+CUSD=1,"*123#"错误,我会认为这是因为它不支持任何德语,因此失败了.至于索尼爱立信手机,我不能说为什么在给定任何值的<dcs>参数的情况下如果失败会失败(当然,会有多个失败的值,但应该支持15).尝试遍历各种语言,看看是否有成功(例如,是否支持英语?).

so if the Nokia device gives error with AT+CUSD=1,"*123#" I would interpret that as it not having any German language support and thus fails. As for the Sony Ericsson phone I cannot say why it fails if it fails given a <dcs> argument of any value (of course there will be several values it will fail for, but it ought to support 15). Try to iterate over the languages and see if you get any hit (is for instance English supported?).

您可以尝试以其他方式指定GSM 7位,例如32(或可能通过探索Any reserved codings shall be assumed to be the GSM 7 bit default alphabet (the same as codepoint 00001111) by a receiving entity.,尽管可能不适用于所有手机).

You might try to specify GSM 7 bit in alternative ways e.g. 32 (or possibly by exploring Any reserved codings shall be assumed to be the GSM 7 bit default alphabet (the same as codepoint 00001111) by a receiving entity., although that might not work on all phones).

由于您正在检查在任何情况下发出的任何AT命令的最终结果代码(,对吧?),因此实现后备算法并不需要太多工作:

Since you are checking the final result codes for any AT command you issue in any case (you are, right?), it is not that much extra work to implement a fallback algorithm:

  1. 首先尝试使用dcs = 15调用
  2. 如果失败,则使用dcs = 32调用
  3. 最后,如果以上所有方法均失败,请尝试不使用dcs.

这应该是在大量手机上调用AT+CUSD的最便捷的方式.

This should be the most portable way to invoke AT+CUSD on a large set of handsets.

顺便说一下,请注意27.007规范中的<n>0值带有下划线.它有点微妙,但这意味着它是默认值,而没有明确说明(例如,对<dsc>所做的操作).因此AT+CUSD=AT+CUSD=0相同(实际上,您甚至可以像调用AT+CUSD=0,"*123#"一样调用AT+CUSD=,"*123#",尽管您可能会遇到无法正确解析此问题的电话.Sony Ericson早期生产的所有电话/调制解调器,几乎所有产品都会在以后生产,并且所有基于 ST-Ericsson 平台的手机正确解析).

By the way, notice that the 0 value for <n> is underlined in the 27.007 specification. It is a bit subtle but it means that it is a default value, without saying so explicitly (like done for <dsc> for instance). So AT+CUSD= is the same as AT+CUSD=0 (and actually you could even invoke AT+CUSD=,"*123#" as the same as AT+CUSD=0,"*123#", although you might encounter phones that fail to parse this correctly. All phones/modems produced early by Sony Ericson, and almost all produced later, and all phones based on platforms from ST-Ericsson will parse this correctly).

如果您想自动化测试,可以使用我的 atinout 程序,例如:

If you want to automate testing you can do so using my atinout program, e.g.:

echo ATE1 | atinout - /dev/ttyACM0 -
for i in $(seq 0 15) 32; \
do \
        echo AT+CUSD=1,"xxxx",$i; \
done | atinout - /dev/ttyACM0 -

如果您的调制解调器设备是/dev/ttyASM0.

if your modem device is /dev/ttyASM0.

更新:您为字符串选择的字符集很可能是问题所在,如此答案中所述.尝试运行AT+CSCS="GSM"并查看是否有帮助.

Update: Your selected character set for strings might quite possibly be the problem here like described in this answer. Try to run AT+CSCS="GSM" and see if that helps.

这篇关于如何编写AT + CUSD usdd命令以支持最大听筒数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆