赞
踩
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。