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

相关文章

MyBatis-plus处理存储json数据过程

《MyBatis-plus处理存储json数据过程》文章介绍MyBatis-Plus3.4.21处理对象与集合的差异:对象可用内置Handler配合autoResultMap,集合需自定义处理器继承F... 目录1、如果是对象2、如果需要转换的是List集合总结对象和集合分两种情况处理,目前我用的MP的版本

GSON框架下将百度天气JSON数据转JavaBean

《GSON框架下将百度天气JSON数据转JavaBean》这篇文章主要为大家详细介绍了如何在GSON框架下实现将百度天气JSON数据转JavaBean,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录前言一、百度天气jsON1、请求参数2、返回参数3、属性映射二、GSON属性映射实战1、类对象映

C# LiteDB处理时间序列数据的高性能解决方案

《C#LiteDB处理时间序列数据的高性能解决方案》LiteDB作为.NET生态下的轻量级嵌入式NoSQL数据库,一直是时间序列处理的优选方案,本文将为大家大家简单介绍一下LiteDB处理时间序列数... 目录为什么选择LiteDB处理时间序列数据第一章:LiteDB时间序列数据模型设计1.1 核心设计原则

Java+AI驱动实现PDF文件数据提取与解析

《Java+AI驱动实现PDF文件数据提取与解析》本文将和大家分享一套基于AI的体检报告智能评估方案,详细介绍从PDF上传、内容提取到AI分析、数据存储的全流程自动化实现方法,感兴趣的可以了解下... 目录一、核心流程:从上传到评估的完整链路二、第一步:解析 PDF,提取体检报告内容1. 引入依赖2. 封装

MySQL中查询和展示LONGBLOB类型数据的技巧总结

《MySQL中查询和展示LONGBLOB类型数据的技巧总结》在MySQL中LONGBLOB是一种二进制大对象(BLOB)数据类型,用于存储大量的二进制数据,:本文主要介绍MySQL中查询和展示LO... 目录前言1. 查询 LONGBLOB 数据的大小2. 查询并展示 LONGBLOB 数据2.1 转换为十

使用SpringBoot+InfluxDB实现高效数据存储与查询

《使用SpringBoot+InfluxDB实现高效数据存储与查询》InfluxDB是一个开源的时间序列数据库,特别适合处理带有时间戳的监控数据、指标数据等,下面详细介绍如何在SpringBoot项目... 目录1、项目介绍2、 InfluxDB 介绍3、Spring Boot 配置 InfluxDB4、I

Java整合Protocol Buffers实现高效数据序列化实践

《Java整合ProtocolBuffers实现高效数据序列化实践》ProtocolBuffers是Google开发的一种语言中立、平台中立、可扩展的结构化数据序列化机制,类似于XML但更小、更快... 目录一、Protocol Buffers简介1.1 什么是Protocol Buffers1.2 Pro

Python实现数据可视化图表生成(适合新手入门)

《Python实现数据可视化图表生成(适合新手入门)》在数据科学和数据分析的新时代,高效、直观的数据可视化工具显得尤为重要,下面:本文主要介绍Python实现数据可视化图表生成的相关资料,文中通过... 目录前言为什么需要数据可视化准备工作基本图表绘制折线图柱状图散点图使用Seaborn创建高级图表箱线图热

MySQL数据脱敏的实现方法

《MySQL数据脱敏的实现方法》本文主要介绍了MySQL数据脱敏的实现方法,包括字符替换、加密等方法,通过工具类和数据库服务整合,确保敏感信息在查询结果中被掩码处理,感兴趣的可以了解一下... 目录一. 数据脱敏的方法二. 字符替换脱敏1. 创建数据脱敏工具类三. 整合到数据库操作1. 创建服务类进行数据库

MySQL中处理数据的并发一致性的实现示例

《MySQL中处理数据的并发一致性的实现示例》在MySQL中处理数据的并发一致性是确保多个用户或应用程序同时访问和修改数据库时,不会导致数据冲突、数据丢失或数据不一致,MySQL通过事务和锁机制来管理... 目录一、事务(Transactions)1. 事务控制语句二、锁(Locks)1. 锁类型2. 锁粒