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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/265322.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

hdu 5730 Shell Necklace——多项式求逆+拆系数FFT

题目:http://acm.hdu.edu.cn/showproblem.php?pid5730 可以用分治FFT。但自己只写了多项式求逆。 和COGS2259几乎很像。设A(x),指数是长度,系数是方案。 \( A(x)^{k} \) 的 m 次项系数表示 k 个连续段组成长度为 m 的序列的方案数。 \( B(x)…

虚拟磁带库

虚拟磁带库(Virtual Tape Library,VTL),是指以磁盘作为自身存储介质,并能仿真为物理磁带库的产品。简单的说,虚拟磁带库就是将磁盘空间虚拟为磁带空间,能够在传统的备份软件上实现和传统磁带库同样功能的产品。传统磁带…

w ndows7端口在哪里,win7电脑遇到端口被占用的情况该如何查看并将其关闭

Windows7操作系统的酷炫和强大已经深受用户们的喜欢了,这里根大家分享的是教你查看win7电脑端口是否被占用的技巧,端口是我们在进行远程或者打印机等都会遇到的,但是有很多用户会遇到端口被占用的情况,遇到这样的问题首先就要找出…

STM32F103五分钟入门系列(十三)独立看门狗IWDG

参考:STM32F103五分钟入门系列(十三)独立看门狗IWDG 作者:自信且爱笑‘ 发布时间:2021-07-31 19:50:28 网址:https://blog.csdn.net/Curnane0_0/article/details/119269391?utm_sourceapp&app_version…

session-cookie 和token登录验证

最近研究了下基于token的身份验证,并将这种机制整合在个人项目中。现在很多网站的认证方式都从传统的seesioncookie转向token校验。对比传统的校验方式,token确实有更好的扩展性与安全性。    传统的sessioncookie身份验证    由于HTTP是无状态的…

高效使用Bitmaps(一) 大Bitmap的加载

转自:http://my.oschina.net/rengwuxian/blog/182885 高效使用Bitmaps有什么好处? 我 们常常提到的“Android程序优化”,通常指的是性能和内存的优化,即:更快的响应速度,更低的内存占用。Android程序的性能…

android自动软键盘,Android自定义软键盘

MyKeyboardAndroid自定义键盘的使用实现步骤第一步:1、新建一个xml文件夹放在res目录下面,然后新建xml文件:money_keyboard.xml2、然后在XML文件中添加按钮布局,这个布局就是键盘的样子了android:horizontalGap"1dp"android:keyWid…

433M射频遥控灯、震动感应灯、WIFI避障小车

目录 433M射频遥控灯1. 433M射频灯的硬件连接2. 具体接线剖析3.课堂干货简述4. 准备工作之环境搭建KEIL_ISP_USBTOTTL驱动5. KEIL建立工程6.电子可编程开关继电器的原理7. 上电灯亮代码编写8. 烧写程序到单片机,实现灯一亮一灭9.遥控灯编程实现及效果验证震动感应灯1. 入门项目…

Bootstrap使用-1

目录 结构:1. 视图函数2. 模板3. 登陆4. 怎样发生的添加模板基础模板提供的block定制基础模板结构: $ tree -I "__pycache*|*.pyc|*.xlsx" -FCL 3 . |-- templates/ | -- h1.html -- test-boostracp.py 1. 视图函数 test-boostracp.py from …

测试 SyntaxHighlighter

#include <stdio.h>int main() {return 0; }转载于:https://www.cnblogs.com/gongnaixiao/p/3472817.html

段错误、内存溢出、内存泄漏(区别)、堆溢出、栈溢出

参考&#xff1a;内存泄漏、内存溢出、段错误、堆溢出、栈溢出 作者&#xff1a;焦木白 发布时间&#xff1a;2019-10-22 网址&#xff1a;https://blog.csdn.net/jiaomubai/article/details/102680705?spm1001.2014.3001.5501 目录段错误内存溢出内存泄漏栈溢出堆溢出段错误 …

12.2号

今日活动&#xff1a;继续改善软件时间&#xff1a;10.00-11.00地点&#xff1a;自习室 转载于:https://www.cnblogs.com/xinyue6/p/10072515.html

表单文本框提示字符点击时清空

表单文本框提示字符点击时清空&#xff08;input标签onfocus时文本框内提示信息清空&#xff09; 作用是&#xff0c;一个文本框&#xff0c;需要输入内容&#xff0c;在没有输入的时候里面有一段提示内容&#xff0c;当点击这个文本框输入的时候&#xff0c;文本框内的内容自…

C语言中指针的地址和内容

参考&#xff1a;C语言中指针的地址和内容 作者&#xff1a;wallying 发布时间&#xff1a;2018-10-18 09:47:54 网址&#xff1a;https://blog.csdn.net/qq_36631580/article/details/89375140?spm1001.2014.3001.5502 #include <stdio.h>//一般用"地址"表示…

android运行过程简书,android 启动过程(一)

1、由init.rc调用 app_main.cpp的main方法&#xff0c;启动zygote进程3、调用AndroidRuntime.cpp 的start方法传递ZygoteInit类路径5、AndroidRuntime.cpp的start方法主要启动java虚拟机跟注册虚拟机&#xff0c;调用ZygoteInit的main方法6、ZygoteInit的main方法主要 把zygote…

鼠标事件

<!DOCTYPE html><html lang"en"><head><meta charset"UTF-8"><title>mouse 事件</title><script type"text/javascript" src" ./js/jquery.min.js"></script><script type"t…

将会改变未来IT世界的十种编程语言

这里要说的都是革新&#xff0c;说这些的目的就是要保持关注最新技术。如果你是一个程序员&#xff0c;想要探寻未来技术&#xff0c;那这篇文章就是你的必读之选。我们这里列出了10种编程语言&#xff0c;10种将会改变IT世界工作方式的编程语言。这些语言已经在开始改变IT界的…

回调函数 —— 借助中间通用函数(形参里有函数指针,实现函数注册)调用不同的回调函数 (多态/分层)

回调函数传参&#xff1a;函数指针做函数参数&#xff08;回调函数&#xff09; 目录背景回调函数是实现函数分层且单向依赖的好办法&#xff0c;使用函数指针运行struct结构体回调函数代码更清晰简单理解回调函数Demo其他回调函数博文背景 这是我在实际工作中遇到的问题&…

linux下用户操作

在linux中添加ftp用&#xff0c;并设置相应的权限&#xff0c;操作步骤如下&#xff1a; 1、环境&#xff1a;ftp为vsftp。被限制用户名为test。被限制路径为/home/test。 2、建用户&#xff1a;在root用户下&#xff1a; useradd -d /home/test test //增加用户test&#…

Venkat 演讲翻译:你要清除代码中的异味

今天&#xff0c;Venkat Subramaniam 就关于清除代码异味的话题给我们做了一个非常有趣的演讲。下面就是我记录的一些他的话。 为什么我们需要有质量的代码&#xff1f; 敏捷开发方法是用来应付那些要求代码做大量改动的反馈信息的方法。如果程序没有用一种好的表达方式来表现&…