当前位置:   article > 正文

C语言AT指令解析,学渣求指教,如何识别字符串中的AT命令并逐个输出,求程序!!!...

c at指令解析

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Topic – to implement a parser to retrieve AT command line and print out (1) the tokens

one by one and (2) the elapse time of each command line (processing).

Please submit the solution in 48 hours.

- The solution could be varied depends on your algorithm. There is no standard solution.

- Please program it in C language.

- The specification is as bellows:

1. Based on the following AT command set and skip the space character, comma(,), a pair of (“ “), then decode each line and print out all the tokens you retrieve.

2. Refer to the following examples which will give you a hint.

3. The length of each token is varied. But the maximum length of token is 15 characters.

For example, the command line AT+CBST=7,0,0

Output should be: token[1] is AT

token[2] is +

token[3] is CBST

token[4] is =

token[5] is 7

token[6] is 0

token[7] is 0

Example 2. the command line ATE1+CBST=7,0,0;D01763266491

Output should be: token[1] is ATE1

token[2] is +

token[3] is CBST

token[4] is =

token[5] is 7

token[6] is 0

token[7] is 0

token[8] is ;

token[9] is D01763266491

Example 3. the command line AT+CPBS= M”6

Output should be: token[1] is AT

token[2] is +

token[3] is CPBS

token[4] is =

token[5] is M

token[6] is ”

token[7] is 6

Note single “ is not ignored.

Example 4. the command line AT+CKPD= ”#12#”

Output should be: token[1] is AT

token[2] is +

token[3] is CKPD

token[4] is =

token[5] is #

token[6] is 12

token[7] is #

Example 5. the command line

AT+CMGW=”+44802333237”

This is a test message

Hello world

Output should be: token[1] is AT

token[2] is +

token[3] is CMGW

token[4] is =

token[5] is +

token[6] is 44802333237

token[7] is

token[8] is This

token[9] is is

token[10] is a

token[11] is test

token[12] is message

token[13] is

token[14] is Hello

token[15] is world

Example 6. the command line

AT+CMGW=”+44802333237”

This is a test ”message

Hello ”world

Output should be: token[1] is AT

token[2] is +

token[3] is CMGW

token[4] is =

token[5] is +

token[6] is 44802333237

token[7] is

token[8] is This

token[9] is is

token[10] is a

token[11] is test

token[12] is ”

token[13] is message

token[14] is

token[15] is Hello

token[16] is ”

token[17] is world

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/410565
推荐阅读
相关标签
  

闽ICP备14008679号