c语言读取at指令,学渣求指教,如何识别字符串中的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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值