Initial import of NFC GNSS SDK project

This commit is contained in:
chenjintao
2026-09-15 16:10:12 +08:00
commit 2746cc3d4e
3070 changed files with 892062 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
#-------------------------------------------------------------------------------
# Configure variable
#-------------------------------------------------------------------------------
TOP_DIR:=${TOP_DIR}
MAKEFILE_PATH :=$(subst $(strip \),/,$(abspath $(lastword $(MAKEFILE_LIST))))
#-------------------------------------------------------------------------------
# Configure source code files
#-------------------------------------------------------------------------------
SRC_FILES+= \
ql_secota_pubkey.c \
quec_secota_filesys.c \
#-------------------------------------------------------------------------------
# the include directories
#-------------------------------------------------------------------------------
INC_DIRS+= \
-I${TOP_DIR}\ \
-I${TOP_DIR}\common\include \
#-------------------------------------------------------------------------------
# Configure compile flag for C
#-------------------------------------------------------------------------------
ifneq (,$(findstring 1606,${ASR_PLATFORM}))
U_FLAGS+= \
endif
ifneq (,$(findstring 1602,${ASR_PLATFORM}))
U_FLAGS+= \
endif
ifneq (,$(findstring 1605,${ASR_PLATFORM}))
U_FLAGS+= \
endif
#-------------------------------------------------------------------------------
# Configure compile flag for C++
#-------------------------------------------------------------------------------
U_CPPFLAGS+=
#-------------------------------------------------------------------------------
# Configure default macro define
#-------------------------------------------------------------------------------
ifneq (,$(findstring 1606,${ASR_PLATFORM}))
DFLAGS+= \
-D"NO_APLP=0" \
-D"GPRS_MULTISLOT_CLASS=12" \
-D"EGPRS_MULTISLOT_CLASS=12" \
endif
ifneq (,$(findstring 1602,${ASR_PLATFORM}))
DFLAGS+= \
-D"NO_APLP=0" \
-D"GPRS_MULTISLOT_CLASS=12" \
-D"EGPRS_MULTISLOT_CLASS=12" \
endif
ifneq (,$(findstring 1605,${ASR_PLATFORM}))
DFLAGS+= \
-D"NO_APLP=0" \
-D"GPRS_MULTISLOT_CLASS=12" \
-D"EGPRS_MULTISLOT_CLASS=12" \
endif
#-------------------------------------------------------------------------------
# Configure link library
#-------------------------------------------------------------------------------
U_LIBS:=
#-------------------------------------------------------------------------------
# include mk file
#-------------------------------------------------------------------------------
include ${TOP_DIR}\config\common\makefile.mk
+26
View File
@@ -0,0 +1,26 @@
// Auto-generated by pubkey2c
#pragma once
const unsigned char ql_secota_pubkey[] = {
0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
0x00, 0xc2, 0x5c, 0x02, 0x47, 0x45, 0x1d, 0x8a, 0xee, 0xff, 0x41, 0xf8, 0xbe, 0x87, 0x68, 0x71,
0xc7, 0xfd, 0x94, 0x2b, 0xa1, 0x93, 0x7b, 0x6e, 0x23, 0xaf, 0xcf, 0x43, 0x17, 0xb1, 0x49, 0x31,
0x7b, 0x98, 0x40, 0x60, 0x11, 0x73, 0xdf, 0x6b, 0xf3, 0x0b, 0x35, 0xef, 0x61, 0xf0, 0x1f, 0x2f,
0x7c, 0xe7, 0xdb, 0xfc, 0x36, 0x91, 0xde, 0xa5, 0x07, 0xc5, 0xf2, 0x70, 0x49, 0xc7, 0xc0, 0x78,
0x46, 0x3a, 0x73, 0x6a, 0xf5, 0x8d, 0x6d, 0x44, 0x7d, 0x50, 0xb7, 0x28, 0xb2, 0x49, 0xd4, 0x6c,
0x4f, 0xee, 0x30, 0x95, 0xbd, 0xbb, 0x1a, 0x7e, 0xaa, 0x66, 0x7f, 0xa1, 0xa8, 0x70, 0x4a, 0x4f,
0x49, 0x61, 0xdd, 0xe0, 0xa9, 0xbb, 0xc8, 0x95, 0xdc, 0xbd, 0x45, 0x73, 0x57, 0x5f, 0x60, 0x79,
0xec, 0x9b, 0xe6, 0xc8, 0x7d, 0xcf, 0x0a, 0x8e, 0xb5, 0x2d, 0xb5, 0x06, 0x11, 0xec, 0x63, 0x70,
0xe3, 0xe5, 0x99, 0xc8, 0x54, 0x72, 0x54, 0xdb, 0xf0, 0xa8, 0x31, 0x31, 0x7e, 0x62, 0x24, 0x5c,
0x6c, 0xbd, 0xc4, 0xaf, 0x9c, 0xf4, 0xfe, 0xe6, 0x59, 0x6b, 0xae, 0x5c, 0x85, 0x8a, 0x13, 0xc2,
0x26, 0x43, 0x6e, 0xad, 0xcc, 0x27, 0x16, 0x0d, 0x09, 0x27, 0x23, 0x95, 0xf6, 0x5c, 0x2c, 0x2e,
0x52, 0x6b, 0x2c, 0xf7, 0x07, 0x15, 0xc3, 0x72, 0xef, 0x98, 0x23, 0x0e, 0x7f, 0xdd, 0xbd, 0xa6,
0xfb, 0xe0, 0x8f, 0x29, 0x76, 0x7d, 0xfd, 0xe2, 0x3d, 0x63, 0x5c, 0x11, 0xaa, 0x17, 0x11, 0x24,
0x90, 0x26, 0xcf, 0x3f, 0x52, 0xb6, 0x66, 0xf5, 0x79, 0x19, 0x24, 0xdc, 0xd5, 0x99, 0x7c, 0xe7,
0xed, 0x65, 0xe9, 0xd1, 0x61, 0x0e, 0xf8, 0xc1, 0xff, 0xc7, 0x1d, 0x25, 0xcb, 0x57, 0x43, 0x16,
0xde, 0x55, 0x91, 0x25, 0xec, 0x2e, 0xa8, 0x69, 0x93, 0xfb, 0xbc, 0x36, 0x82, 0x85, 0x8c, 0x4e,
0x71, 0x02, 0x03, 0x01, 0x00, 0x01
};
const unsigned int ql_secota_pubkey_len = sizeof(ql_secota_pubkey);
@@ -0,0 +1,155 @@
#include "stdio.h"
#include "stdlib.h"
#include "quec_secota_filesys.h"
#include "quec_include.h"
#include "quec_common.h"
#include "quec_cust_feature.h"
#ifdef QUECTEL_OPEN_CPU
#include "ql_fs.h"
#endif
#include "FDI_FILE.h"
#define QUEC_SECOTA_FILE_LOG(fmt, ...) quec_log("[QUEC][SECOTA_FILE][%s][%d]:" fmt "\r\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#ifdef QUECTEL_OPEN_CPU
static int secota_filesys_type = QUEC_SECOTA_QLLFS;
#else
static int secota_filesys_type = QUEC_SECOTA_FDIFS;
#endif
void quec_secota_filesys_init(quec_secota_filesys_t type)
{
secota_filesys_type = type;
QUEC_SECOTA_FILE_LOG("quec_secota_filesys_init type:%d", type);
}
static quec_secota_filesys_t quec_secota_filesys_get_type(void)
{
return secota_filesys_type;
}
quec_secota_std_fhandle_t quec_secota_fopen(const char *path, const char *mode)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_open(path, mode);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return (quec_secota_std_fhandle_t)ql_fopen(path, mode);
#endif
return quec_secota_std_fopen(path, mode);
}
int quec_secota_fclose(quec_secota_std_fhandle_t fd)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_close(fd);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_fclose((QFILE* )fd);
#endif
return quec_secota_std_fclose(fd);
}
int quec_secota_fread(void *ptr, int size, int count, quec_secota_std_fhandle_t fd)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_read(ptr, size, count, fd);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_fread(ptr, size, count, (QFILE* )fd);
#endif
return quec_secota_std_fread(ptr, size, count, fd);
}
int quec_secota_fwrite(const void *ptr, int size, int count, quec_secota_std_fhandle_t fd)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_write(ptr, size, count, fd);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_fwrite(ptr, size, count, (QFILE* )fd);
#endif
return quec_secota_std_fwrite(ptr, size, count, fd);
}
int quec_secota_fseek(quec_secota_std_fhandle_t fd, int offset, int whence)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_lseek(fd, offset, whence);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_fseek((QFILE* )fd, offset, whence);
#endif
return quec_secota_std_fseek(fd, offset, whence);
}
int quec_secota_remove(const char *path)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_unlink(path);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_remove(path);
#endif
return quec_secota_std_remove(path);
}
int quec_secota_ftell(quec_secota_std_fhandle_t fd)
{
#ifdef QL_NAND_YAFFS
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
return ql_yaffs_ftell(fd);
#endif
#ifdef QUECTEL_OPEN_CPU
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
return ql_ftell((QFILE* )fd);
#endif
return quec_secota_std_ftell(fd);
}
int quec_secota_fd_check_valid(quec_secota_std_fhandle_t fd)
{
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLYAFS)
{
if(fd < 0)
return 0;
else
return 1;
}
if(quec_secota_filesys_get_type() == QUEC_SECOTA_QLLFS)
{
if(fd == NULL)
return 0;
else
return 1;
}
if(fd < 0)
return 0;
else
return 1;
}