Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不穿格子衫的农民
TencentOS Tiny
提交
772d714a
T
TencentOS Tiny
项目概览
不穿格子衫的农民
/
TencentOS Tiny
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TencentOS Tiny
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
772d714a
编写于
8月 11, 2020
作者:
M
mculover666
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve m26 driver for multi module support
上级
dd3de2db
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
19 deletion
+30
-19
devices/m26/m26.c
devices/m26/m26.c
+22
-11
devices/m26/m26.h
devices/m26/m26.h
+8
-8
未找到文件。
devices/m26/m26.c
浏览文件 @
772d714a
/**
* @brief Quectel M26 GSM/GPRS Module
* @author Mculover666 <2412828003@qq.com>
* @date 2020/05/07
*/
/*----------------------------------------------------------------------------
* Tencent is pleased to support the open source community by making TencentOS
* available.
*
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* If you have downloaded a copy of the TencentOS binary from Tencent, please
* note that the TencentOS binary is licensed under the BSD 3-Clause License.
*
* If you have downloaded a copy of the TencentOS source code from Tencent,
* please note that TencentOS source code is licensed under the BSD 3-Clause
* License, except for the third-party components listed below which are
* subject to different license terms. Your integration of TencentOS into your
* own projects may require compliance with the BSD 3-Clause License, as well
* as the other licenses applicable to the third-party components included
* within TencentOS.
*---------------------------------------------------------------------------*/
#include "m26.h"
#include "tos_at.h"
...
...
@@ -154,7 +165,7 @@ static int m26_close_apn(void)
return
0
;
}
static
int
m26_send_mode_set
(
sal
_send_mode_t
mode
)
static
int
m26_send_mode_set
(
m26
_send_mode_t
mode
)
{
int
try
=
0
;
at_echo_t
echo
;
...
...
@@ -162,7 +173,7 @@ static int m26_send_mode_set(sal_send_mode_t mode)
while
(
try
++
<
10
)
{
tos_at_echo_create
(
&
echo
,
NULL
,
0
,
NULL
);
tos_at_cmd_exec
(
&
echo
,
300
,
"AT+QIMODE=%d
\r\n
"
,
mode
==
SAL
_SEND_MODE_NORMAL
?
0
:
1
);
tos_at_cmd_exec
(
&
echo
,
300
,
"AT+QIMODE=%d
\r\n
"
,
mode
==
M26
_SEND_MODE_NORMAL
?
0
:
1
);
if
(
echo
.
status
==
AT_ECHO_STATUS_OK
)
{
return
0
;
...
...
@@ -171,7 +182,7 @@ static int m26_send_mode_set(sal_send_mode_t mode)
return
-
1
;
}
static
int
m26_multilink_set
(
sal
_multilink_state_t
state
)
static
int
m26_multilink_set
(
m26
_multilink_state_t
state
)
{
int
try
=
0
;
at_echo_t
echo
;
...
...
@@ -179,7 +190,7 @@ static int m26_multilink_set(sal_multilink_state_t state)
while
(
try
++
<
10
)
{
tos_at_echo_create
(
&
echo
,
NULL
,
0
,
NULL
);
tos_at_cmd_exec
(
&
echo
,
300
,
"AT+QIMUX=%d
\r\n
"
,
state
==
SAL
_MULTILINK_STATE_ENABLE
?
1
:
0
);
tos_at_cmd_exec
(
&
echo
,
300
,
"AT+QIMUX=%d
\r\n
"
,
state
==
M26
_MULTILINK_STATE_ENABLE
?
1
:
0
);
if
(
echo
.
status
==
AT_ECHO_STATUS_OK
)
{
return
0
;
...
...
@@ -284,14 +295,14 @@ static int m26_init(void)
return
-
1
;
}
#else
if
(
m26_multilink_set
(
SAL
_MULTILINK_STATE_ENABLE
)
!=
0
)
if
(
m26_multilink_set
(
M26
_MULTILINK_STATE_ENABLE
)
!=
0
)
{
printf
(
"multilink set FAILED
\n
"
);
return
-
1
;
}
#endif
if
(
m26_send_mode_set
(
SAL
_SEND_MODE_NORMAL
)
!=
0
)
if
(
m26_send_mode_set
(
M26
_SEND_MODE_NORMAL
)
!=
0
)
{
printf
(
"send mode set FAILED
\n
"
);
return
-
1
;
...
...
devices/m26/m26.h
浏览文件 @
772d714a
...
...
@@ -20,15 +20,15 @@
#include "tos_hal.h"
typedef
enum
sal
_send_mode
{
SAL
_SEND_MODE_NORMAL
,
SAL
_SEND_MODE_TRANSPARENT
,
}
sal
_send_mode_t
;
typedef
enum
m26
_send_mode
{
M26
_SEND_MODE_NORMAL
,
M26
_SEND_MODE_TRANSPARENT
,
}
m26
_send_mode_t
;
typedef
enum
sal
_multilink_state
{
SAL
_MULTILINK_STATE_ENABLE
,
SAL
_MULTILINK_STATE_DISABLE
,
}
sal
_multilink_state_t
;
typedef
enum
m26
_multilink_state
{
M26
_MULTILINK_STATE_ENABLE
,
M26
_MULTILINK_STATE_DISABLE
,
}
m26
_multilink_state_t
;
int
m26_sal_init
(
hal_uart_port_t
uart_port
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录