资源简介
Air720模块是一款带分集接收功能的4G多模无线通信模块,其中Air720D支持LTE-TDD/GPRS双模,Air720H支持LTE-TDD/LTE-FDD/TD-SCDMA/WCDMA/GPRS五模,二者硬件封装和软件完全兼容,几乎能够满足所有的M2M的需求,包括汽车及个人追踪服务、无线POS机、智能计量、工业级PDA以及其它M2M的应用。
代码片段和文件信息
/* //device/system/reference-ril/atchannel.c
**
** Copyright 2006 The Android Open Source Project
**
** Licensed under the Apache License Version 2.0 (the “License“);
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing software
** distributed under the License is distributed on an “AS IS“ BASIS
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include “atchannel.h“
#include “at_tok.h“
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LOG_NDEBUG 0
#define LOG_TAG “AT“
#include “ril_log.h“
#undef HAVE_ANDROID_OS
#ifdef HAVE_ANDROID_OS
/* for IOCTL‘s */
#include
#endif /*HAVE_ANDROID_OS*/
#include “misc.h“
#ifdef HAVE_ANDROID_OS
#define USE_NP 1
#endif /* HAVE_ANDROID_OS */
#define NUM_ELEMS(x) (sizeof(x)/sizeof(x[0]))
#define MAX_AT_RESPONSE (8 * 1024)
#define HANDSHAKE_RETRY_COUNT 8
#define HANDSHAKE_TIMEOUT_MSEC 1000
static pthread_t s_tid_reader;
static int s_fd = -1; /* fd of the AT channel */
static ATUnsolHandler s_unsolHandler;
/* for input buffering */
static char s_ATBuffer[MAX_AT_RESPONSE+1];
static char *s_ATBufferCur = s_ATBuffer;
static int s_ackPowerIoctl; /* true if TTY has android byte-count
handshake for low power*/
static int s_readCount = 0;
#if AT_DEBUG
void AT_DUMP(const char* prefix const char* buff int len)
{
if (len < 0)
len = strlen(buff);
LOGD(“%.*s“ len buff);
}
#endif
/*
* for current pending command
* these are protected by s_commandmutex
*/
static pthread_mutex_t s_commandmutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t s_commandcond = PTHREAD_COND_INITIALIZER;
static ATCommandType s_type;
static const char *s_responsePrefix = NULL;
static const char *s_smsPDU = NULL;
static ATResponse *sp_response = NULL;
static void (*s_onTimeout)(void) = NULL;
static void (*s_onReaderClosed)(void) = NULL;
static int s_readerClosed;
static void onReaderClosed();
static int writeCtrlZ (const char *s);
static int writeline (const char *s);
#ifndef USE_NP
static void setTimespecRelative(struct timespec *p_ts long long msec)
{
struct timeval tv;
gettimeofday(&tv (struct timezone *) NULL);
/* what‘s really funny about this is that I know
pthread_cond_timedwait just turns around and makes this
a relative time again */
p_ts->tv_sec = tv.tv_sec + (msec / 1000);
p_ts->tv_nsec = (tv.tv_usec + (msec % 1000) * 1000L ) * 1000L;
if (p_ts->tv_nsec > 1000000000) {
p_ts->tv_sec += 1;
p_ts->tv_nsec -= 1000000000;
}
}
#endi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-11-14 19:32 air720\
文件 21776 2019-11-14 19:16 air720\chat
文件 9432 2019-11-14 18:19 air720\ip-down
文件 9432 2019-11-14 18:19 air720\ip-up
文件 38236 2019-11-14 18:31 air720\libreference-ril-air720.so
目录 0 2019-11-14 19:32 air720\reference-ril-Air720H\
文件 2140 2019-11-14 18:31 air720\reference-ril-Air720H\Android.mk
文件 3660 2019-11-14 18:31 air720\reference-ril-Air720H\at_tok.c
文件 974 2019-11-14 18:31 air720\reference-ril-Air720H\at_tok.h
文件 24834 2019-11-14 18:31 air720\reference-ril-Air720H\atchannel.c
文件 4212 2019-11-14 18:31 air720\reference-ril-Air720H\atchannel.h
文件 35035 2019-11-14 18:31 air720\reference-ril-Air720H\chat.c
文件 9130 2019-11-14 18:31 air720\reference-ril-Air720H\diagsaver.c
文件 600 2019-11-14 18:31 air720\reference-ril-Air720H\ip-down.c
文件 844 2019-11-14 18:31 air720\reference-ril-Air720H\ip-up.c
文件 945 2019-11-14 18:31 air720\reference-ril-Air720H\misc.c
文件 775 2019-11-14 18:31 air720\reference-ril-Air720H\misc.h
文件 15074 2019-11-14 18:31 air720\reference-ril-Air720H\pppd.c
文件 219 2019-11-14 18:31 air720\reference-ril-Air720H\pppd.h
文件 91053 2019-11-14 18:31 air720\reference-ril-Air720H\reference-ril.c
文件 60 2019-11-14 18:31 air720\reference-ril-Air720H\ril.h
文件 277 2019-11-14 18:31 air720\reference-ril-Air720H\ril_log.h
文件 4132 2019-11-14 18:31 air720\reference-ril-Air720H\usb_find.c
文件 234 2019-11-14 18:31 air720\reference-ril-Air720H\usb_find.h
文件 12472 2019-11-14 18:31 air720\reference-ril-Air720H\usim-fcp.c
- 上一篇:c0编译器源码
- 下一篇:GigE调试笔记_已经可以读取到数据和对摄像机进行设置
评论
共有 条评论