SIM7600数据回调拨号上网

2023-12-17 08:08

本文主要是介绍SIM7600数据回调拨号上网,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

DataCall用于设置/查询APN,CDMA网络下拨号用户和密码,连接网络,断开网络等功能,最多同时支持8个链接,建议序列号从7号开始使用。

1. API

1)int datacall_init(); 初始化网络

输入:无

输出:无

返回值:无

2)int start_dataCall(app_tech_e tech, int ip_family, int profile); //建立数据链接

输入

tech: 使用制式(枚举)

1.umts

2.cdma

3.1x

。。。

ip_family: ip类型

4:ip4

6:ip6

profile: 序列号

输出
返回值0:成功  -1:失败

3)int stop_dataCall(int profile); //断开链接

输入:profile序列号

4)int get_datacall_info_by_profile(int profile, datacall_info_type *callinfo)

功能获取数据链接参数
输入profile 序列号
输出callinfo 链接参数结构体
返回值0:成功  -1:失败

5)int datacall_deinit(); //释放网络资源

输入:无

输出:无

返回值:无

2. 数据回调函数

void simcom_datacall_test()
{const char *options_list[] = {"1. start data call","2. stop data call","3. get call Info","4. back",};int opt = 0;int i,j;char scan_string[100] = {0};if(datacall_init() != 0){return;}while(1){printf("\nPlease select an option to test from the items listed below.\n");print_option_menu(options_list, sizeof(options_list)/sizeof(options_list[0]));printf("Option > ");memset(scan_string, 0, sizeof(scan_string));if (fgets(scan_string, sizeof(scan_string), stdin) == NULL)continue;/* Convert the option to an integer, and switch on the option entered. */opt = atoi(scan_string);switch(opt){case 1: /* start data call*/{int profile;printf("\nPlease input profile index:\n");			             memset(scan_string, 0, sizeof(scan_string));if (fgets(scan_string, sizeof(scan_string), stdin) == NULL)break;profile = atoi(scan_string);if(profile > 16 || profile == 6)     //Profile = 1 for system. profile=6 for wifi{printf("please select other profile.\n");break;}start_dataCall(app_tech_auto, DSI_IP_VERSION_4, profile);}break;case 2: /*stop data call*/{int profile;printf("\nPlease input profile index:\n");			             memset(scan_string, 0, sizeof(scan_string));if (fgets(scan_string, sizeof(scan_string), stdin) == NULL)break;profile = atoi(scan_string);if(profile <= 1 || profile > 16 || profile == 6)     //Profile = 1 for system. profile=6 for wifi{printf("please select other profile.\n");break;}stop_dataCall(profile);}break;case 3:{/* get data call infomation*/int profile;int ret;datacall_info_type callinfo;printf("\nPlease input profile index:\n");			             memset(scan_string, 0, sizeof(scan_string));if (fgets(scan_string, sizeof(scan_string), stdin) == NULL)break;profile = atoi(scan_string);ret = get_datacall_info_by_profile(profile,&callinfo);if(ret == 0){printf("DC: profile=%d\n", callinfo.profile);					printf("DC: handle=%d\n", callinfo.handle);printf("DC: if_name=%s\n", callinfo.if_name);printf("DC: ip_str=%s\n", callinfo.ip_str);printf("DC: mask=%d\n", callinfo.mask);printf("DC: pri_dns_str=%s\n", callinfo.pri_dns_str);printf("DC: sec_dns_str=%s\n", callinfo.sec_dns_str);printf("DC: handle=%d\n", callinfo.status);}}break;case 4:break;default:break;}if(opt == 4){break;}}datacall_deinit();
}

 

这篇关于SIM7600数据回调拨号上网的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/503693

相关文章

详解如何使用Python构建从数据到文档的自动化工作流

《详解如何使用Python构建从数据到文档的自动化工作流》这篇文章将通过真实工作场景拆解,为大家展示如何用Python构建自动化工作流,让工具代替人力完成这些数字苦力活,感兴趣的小伙伴可以跟随小编一起... 目录一、Excel处理:从数据搬运工到智能分析师二、PDF处理:文档工厂的智能生产线三、邮件自动化:

Python数据分析与可视化的全面指南(从数据清洗到图表呈现)

《Python数据分析与可视化的全面指南(从数据清洗到图表呈现)》Python是数据分析与可视化领域中最受欢迎的编程语言之一,凭借其丰富的库和工具,Python能够帮助我们快速处理、分析数据并生成高质... 目录一、数据采集与初步探索二、数据清洗的七种武器1. 缺失值处理策略2. 异常值检测与修正3. 数据

pandas实现数据concat拼接的示例代码

《pandas实现数据concat拼接的示例代码》pandas.concat用于合并DataFrame或Series,本文主要介绍了pandas实现数据concat拼接的示例代码,具有一定的参考价值,... 目录语法示例:使用pandas.concat合并数据默认的concat:参数axis=0,join=

C#代码实现解析WTGPS和BD数据

《C#代码实现解析WTGPS和BD数据》在现代的导航与定位应用中,准确解析GPS和北斗(BD)等卫星定位数据至关重要,本文将使用C#语言实现解析WTGPS和BD数据,需要的可以了解下... 目录一、代码结构概览1. 核心解析方法2. 位置信息解析3. 经纬度转换方法4. 日期和时间戳解析5. 辅助方法二、L

使用Python和Matplotlib实现可视化字体轮廓(从路径数据到矢量图形)

《使用Python和Matplotlib实现可视化字体轮廓(从路径数据到矢量图形)》字体设计和矢量图形处理是编程中一个有趣且实用的领域,通过Python的matplotlib库,我们可以轻松将字体轮廓... 目录背景知识字体轮廓的表示实现步骤1. 安装依赖库2. 准备数据3. 解析路径指令4. 绘制图形关键

解决mysql插入数据锁等待超时报错:Lock wait timeout exceeded;try restarting transaction

《解决mysql插入数据锁等待超时报错:Lockwaittimeoutexceeded;tryrestartingtransaction》:本文主要介绍解决mysql插入数据锁等待超时报... 目录报错信息解决办法1、数据库中执行如下sql2、再到 INNODB_TRX 事务表中查看总结报错信息Lock

使用C#删除Excel表格中的重复行数据的代码详解

《使用C#删除Excel表格中的重复行数据的代码详解》重复行是指在Excel表格中完全相同的多行数据,删除这些重复行至关重要,因为它们不仅会干扰数据分析,还可能导致错误的决策和结论,所以本文给大家介绍... 目录简介使用工具C# 删除Excel工作表中的重复行语法工作原理实现代码C# 删除指定Excel单元

Linux lvm实例之如何创建一个专用于MySQL数据存储的LVM卷组

《Linuxlvm实例之如何创建一个专用于MySQL数据存储的LVM卷组》:本文主要介绍使用Linux创建一个专用于MySQL数据存储的LVM卷组的实例,具有很好的参考价值,希望对大家有所帮助,... 目录在Centos 7上创建卷China编程组并配置mysql数据目录1. 检查现有磁盘2. 创建物理卷3. 创

Nacos日志与Raft的数据清理指南

《Nacos日志与Raft的数据清理指南》随着运行时间的增长,Nacos的日志文件(logs/)和Raft持久化数据(data/protocol/raft/)可能会占用大量磁盘空间,影响系统稳定性,本... 目录引言1. Nacos 日志文件(logs/ 目录)清理1.1 日志文件的作用1.2 是否可以删除

使用Python获取JS加载的数据的多种实现方法

《使用Python获取JS加载的数据的多种实现方法》在当今的互联网时代,网页数据的动态加载已经成为一种常见的技术手段,许多现代网站通过JavaScript(JS)动态加载内容,这使得传统的静态网页爬取... 目录引言一、动态 网页与js加载数据的原理二、python爬取JS加载数据的方法(一)分析网络请求1