GEOVISION INC. CBA520 사용자 설명서

다운로드
페이지 75
 
Sample code => 
Unsigned int wext_version; 
sprintf(wrq.ifr_name, "ra0"); 
wrq.u.data.pointer = (caddr_t) & wext_version; 
wrq.u.data.flags = 
RT_OID_WE_VERSION_COMPILED
ioctl(socket_id, 
RT_PRIV_IOCTL
, &wrq); 
 
9.2  How to display rate, BW: 
HTTRANSMIT_SETTING HTSetting; 
Double Rate; 
double b_mode[] ={1, 2, 5.5, 11}; 
float g_Rate[] = { 6,9,12,18,24,36,48,54}; 
switch(HTSetting.field.MODE) 
{  
case 0: 
if (HTSetting.field.MCS >=0 && HTSetting.field.MCS<=3) 
   
 
Rate = b_mode[HTSetting.field.MCS]; 
   
else if (HTSetting.field.MCS >=8 && HTSetting.field.MCS<=11) 
   
 
Rate = b_mode[HTSetting.field.MCS-8]; 
   
else 
   
 
Rate = 0; 
   
break; 
  case 1: 
   
if ((HTSetting.field.MCS >= 0) && (HTSetting.field.MCS < 8)) 
   
 
Rate = g_Rate[HTSetting.field.MCS]; 
       
else 
   
 
Rate = 0; 
   
break; 
  case 2: 
  case 3: 
   
if (0 == bGetHTTxRateByBW_GI_MCS(HTSetting.field.BW, HTSetting.field.ShortGI,   
HTSetting.field.MCS,  
&Rate)) 
Rate = 0; 
   
break; 
  default: 
   
Rate = 0; 
   
break; 
 
char bGetHTTxRateByBW_GI_MCS(int nBW, int nGI, int nMCS, double* dRate) 
double HTTxRate20_800[16]={6.5, 13.0, 19.5, 26.0, 39.0, 52.0, 58.5, 65.0, 13.0, 26.0, 39.0, 52.0, 78.0, 104.0, 117.0, 
130.0}; 
double HTTxRate20_400[16]={7.2, 14.4, 21.7, 28.9, 43.3, 57.8, 65.0, 72.2, 14.444, 28.889, 43.333, 57.778, 86.667, 
115.556, 130.000, 144.444}; 
double HTTxRate40_800[18]={13.5, 27.0, 40.5, 54.0, 81.0, 108.0, 121.5, 135.0, 27.0, 54.0, 81.0, 108.0, 162.0, 216.0, 
243.0, 270.0, 6.0, 39.0}; 
double HTTxRate40_400[18]={15.0, 30.0, 45.0, 60.0, 90.0, 120.0, 135.0, 150.0, 30.0, 60.0, 90.0, 120.0, 180.0, 240.0, 
270.0, 300.0, 6.7, 43.3}; 
 
// no TxRate for (BW = 20, GI = 400, MCS = 32) & (BW = 20, GI = 400, MCS = 32) 
if (((nBW == BW_20) && (nGI == GI_400) && (nMCS == 32)) ||  
((nBW == BW_20) && (nGI == GI_800) && (nMCS == 32))) 
return 0; //false 
 
if( nBW == BW_20 && nGI == GI_800) 
*dRate = HTTxRate20_800[nMCS]; 
else if( nBW == BW_20 && nGI == GI_400) 
*dRate = HTTxRate20_400[nMCS]; 
else if( nBW == BW_40 && nGI == GI_800) 
*dRate = HTTxRate40_800[nMCS]; 
else if( nBW == BW_40 && nGI == GI_400) 
74/75