Skip to content

Commit

Permalink
Merge pull request Tencent#1127 from Tencent/cooper/master/net_type
Browse files Browse the repository at this point in the history
nettype 5g
  • Loading branch information
garryyan committed May 16, 2023
2 parents c16b07e + 3be5c67 commit a300ac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mars/comm/objc/platform_comm.mm
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ int getNetTypeForStatistics(){
return (int)mars::comm::NetTypeForStatistics::NETTYPE_3G;
}else if(rani.Is4G()){
return (int)mars::comm::NetTypeForStatistics::NETTYPE_4G;
}else if(rani.IsNR()){
return (int)mars::comm::NetTypeForStatistics::NETTYPE_5G;
}

return (int)mars::comm::NetTypeForStatistics::NETTYPE_NON;
Expand Down Expand Up @@ -509,6 +511,10 @@ bool getCurRadioAccessNetworkInfo(mars::comm::RadioAccessNetworkInfo& _raninfo)

return true;
}

bool RadioAccessNetworkInfo::IsNR() const {
return radio_access_network == NR || radio_access_network == NRNSA;
}
#else
bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo)
{
Expand Down
3 changes: 3 additions & 0 deletions mars/comm/platform_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ __CXX11_CONSTEXPR__ static const char* const HSPA = "HSPA";
__CXX11_CONSTEXPR__ static const char* const IDEN = "IDEN";
__CXX11_CONSTEXPR__ static const char* const HSPAP = "HSPA+";
__CXX11_CONSTEXPR__ static const char* const G5 = "5G";
__CXX11_CONSTEXPR__ static const char* const NR = "NR";
__CXX11_CONSTEXPR__ static const char* const NRNSA = "NRNSA";
__CXX11_CONSTEXPR__ static const char* const WIFI = "WIFI";


Expand Down Expand Up @@ -203,6 +205,7 @@ struct RadioAccessNetworkInfo {
bool Is4G() const { return radio_access_network == LTE;}
bool Is5G() const { return radio_access_network == G5;}
bool IsUnknown() const { return !Is2G() && !Is3G() && !Is4G() && !Is5G();}
bool IsNR() const;
};

bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo);
Expand Down

0 comments on commit a300ac4

Please sign in to comment.