added codes about AndroidVersion and SOC

This commit is contained in:
2023-07-12 19:14:51 +08:00
parent 151401f105
commit 37fa338586
5 changed files with 287 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#pragma once
namespace hgl
{
struct AndroidVersion
{
unsigned int major;
unsigned int minor;
unsigned int patch;
char postfix;
};
/**
* 根据版本号取得Android的APILevel,如若出错返回-1
*/
const int GetAndroidAPILevel(const AndroidVersion &);
}//namespace hgl

35
inc/hgl/platform/SOC.h Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
#include<hgl/TypeFunc.h>
namespace hgl
{
enum class SOCVendor
{
Unknow=0,
Qualcomm, ///<高通
Hisilicon, ///<海思
Samsung, ///<三星
MediaTek, ///<联发科
//Rockchip, ///<瑞芯微
//Intel, ///<英特尔
Unisoc, ///<展锐
Spreadtrum, ///<展讯
JLQ, ///<瓴盛
//TI, ///<德州仪器
ENUM_CLASS_RANGE(Unknow,JLQ)
};
struct SOCInfo
{
SOCVendor vendor;
char model[16];
};
/**
* 根据收集到的SOC信息解晰具体的SOC厂商和主要型号
*/
bool ParseSOCInfo(SOCInfo &,const char *);
}//namespace hgl