亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? strength.c

?? 802.11仿真源碼 對分析RSSI很有用的
?? C
字號:
/*strength.cBase code written by: Dylan Syme, for Tele4363.Edited and addapted by: Peter TzannesCompilegcc -o <object file> strength.cRun<object file> <A number which corresponds to the number of inputs>INPUT          ->    OUTPUTstrength'i'    ->    strength'i'.txt  This program takes as input all strength'i' files (where 'i' indicates a number)  The program then proceeds to analyse each strength'i' file and produces a   form'i'.txt file in the format PER, room, mp, number of excess packets, the   number of total pacekts and then the average RSSI value.   The main principle of this function is to scan in a line from the 'strength'    file. Then using a while loop as a comparison loop, data is compared/altered/   set or extracted on a charcter by character basis. If statememnts are then    used as error detection, and if errors are found, they are skip over    as described below.Note: - A double is used instead of a float for an increase in accuracy of results- Flagging errors:  A flag counter has been used to detect when less than 10 packets have been   received at a single room. These measurements are dropped, due to the RSSI   needing at least 10 packets for a correct mesurement.   An ignore counter has also been used to detect when packets are less than   10, but are within a 30-second collection phase, this line will also be   ignored for RSSI calculations.  The confidence measurement printed to the output file   is an integer counter that counts the number of lines within a 30-second   period where the number of packets received is greater than 101. - The output file does not include any measurement points that received no   packets. - An END line identifies the last line of the experiment.A bug in Moors program with the first line of all MP. The first line of all MP has a large number of received packets, because the number of packets after on the previous line is the same as the number of packets before on the current line. Due to this bug, it makes it extremely difficult in determining the number of packets > 101 for this line.To remedy this, the first line of all MP is excluded. */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <math.h>#include <stdio.h>#define MAX_LINE_SIZE 65  //maximum length of a line in the input file#define MAX_FIELD_SIZE 8  //maximum size of the field, ie.max digits between comma'sint empty(char *tmp){  int j;  for(j = 0 ; j<= MAX_FIELD_SIZE; j++)     tmp[j] = 0;    return(0);}intweather(FILE *in, FILE *out, int seconds){  //int mint = 60;  int hourt = 3600;  int dayt = 86400;  int thir_1_day = 2678400;  int thir_ty_day = 2592000;  int months = 3, day = 1, hour = 0;  //min = 0;  FILE *humidity;  const char *final = "weather";  char line[MAX_LINE_SIZE];  char created[20];  char first[20], second[10];  int found = 0;  seconds = seconds - 1111104000;   //seconds till start of March  if(seconds >= thir_1_day) //March;  {    seconds = seconds - thir_1_day;    months++;  }  if(seconds >= thir_ty_day) //April;  {    seconds = seconds - thir_ty_day;    months++;  }  if(seconds >= thir_1_day) //May;  {    seconds = seconds - thir_1_day;    months++;  }  if(seconds >= thir_ty_day) //June;  {    seconds = seconds - thir_ty_day;    months++;  }  while(seconds >=dayt)  {    seconds = seconds - dayt;    day++;  }  while(seconds >=hourt)  {    seconds = seconds - hourt;    hour++;  }  if((months < 10) && (day < 10) && (hour < 10))    sprintf(created, "20050%d0%d:0%d0000\n",months, day, hour);  else if ((months < 10) && (day < 10))    sprintf(created, "20050%d0%d:%d0000\n",months, day, hour);  else if ((months < 10) && (hour < 10))    sprintf(created, "20050%d%d:0%d0000\n",months, day, hour);  else if ((day < 10) && (hour < 10))    sprintf(created, "2005%d0%d:0%d0000\n",months, day, hour);  else if (months < 10)    sprintf(created, "20050%d%d:%d0000\n",months, day, hour);  else    sprintf(created, "2005%d%d:%d0000\n",months, day, hour);  empty(line);  sprintf(line,"%s.txt",final);  humidity = fopen(line, "r");    if ((humidity) == NULL)    {      printf("fopen failed filename: weather.txt\n");      exit(1);    }  empty(line);    while(!feof(humidity))  {    fgets(line, MAX_LINE_SIZE, humidity);    sscanf(line, "%s %s", first,second);	    first[15] = '\0';    if((first[4] == created[4]) && (first[5] == created[5]) && (first[6] == created[6]) && (first[7] == created[7]) && (first[9] == created[9]) && (first[10] == created[10])) // strcmp doesn't work    {      found++;      fprintf(out,"%s\n",second);            return(0);    }  }  if(found == 0)  {    printf(" Empty Strength File ");    fprintf(out,"-9\n"); //empty strength files  }  return(0);}int extract_data(FILE *in, FILE *out) {  unsigned int length = MAX_LINE_SIZE;  char *line;  int i = 0, j;  int flag = 0, ignore = 0, flag_pkt = 0;  unsigned int room = 1;  // we assume there's no room 0  unsigned int room_last = 0;  unsigned int mp = 0;  unsigned int mp_last = 0;  unsigned int pkt_recv = 0;  unsigned int pkt_lost = 0;  unsigned int qual = 0;  unsigned int pkt_before = 0;  unsigned int pkt_after = 0;  unsigned int pkt_interval = 0;  unsigned int pkt_total = 0;  unsigned int pkt_line = 0;  unsigned int linecnt = 0;  unsigned int pkt_over;   int count = 1;  int sig_lvl = 0, noise_lvl = 0;  float sig_lvl_avg, noise_lvl_avg, fer;  double snr;  //double qual_avg;  line = (char *)malloc(length);  while(!feof(in)) //checks for the EOF character  {        //printf("beginning of file\n");    fgets(line, MAX_LINE_SIZE, in);    char *tmp;           //use a re-usable temporary variable to save memory                      tmp = (char *)malloc(MAX_LINE_SIZE); /*no field should exceed 8 digits,					          this pointer is used to store all accesses variables*/    //printf("nine = %s\n", nine);    if(strcmp(line,"EMPTY") == 0)      {	fprintf(out,"EMPTY");	return(1);      }    flag = 0; // used for errors on a line    empty(tmp);    j=0;	    while(line[i] != ' ')       i++;    i++;    while(line[i] != ',')       {	tmp[j] = line[i];	j++;	i++;      }       //printf("%s\n",tmp);     room = atoi(tmp);    //printf("%d ", room);    empty(tmp);  // We need to re-initialize tmp every time we read data     j=0;       while(line[i] != ' ')      i++;    i++;    while(line[i] != ',')       {	tmp[j] = line[i];	j++;	i++;      }    mp = atoi(tmp);    //printf("%d ", mp);                if((mp != mp_last) || (room != room_last)) //measurements are in a different room -> reinitialise everything      {	if(count != 0)	{	  sig_lvl_avg = ((double) sig_lvl/count);	  noise_lvl_avg = (noise_lvl/count);	}	if(pkt_recv != 0)	{	  fer = ((double)pkt_lost/(pkt_recv + pkt_lost));	}	  	snr = (sig_lvl_avg - noise_lvl_avg);	if(!isnan(fer) && (pkt_total != 0))	 	  {	    fprintf(out,"%g,%d,%d,%d,%d,%f\n",fer, room_last, mp_last, pkt_over, pkt_total, sig_lvl_avg);//no space between the last \n and digit	  }	pkt_recv = 0;	pkt_lost = 0;	qual = 0;	sig_lvl = 0;	noise_lvl = 0;	count = 0;	ignore = 0;	flag_pkt = 0;	pkt_total = 0;	pkt_line = 0;	pkt_interval = 0;	linecnt = 0;	pkt_over = 0;      }    empty(tmp);    j=0;    while(line[i] != ' ')       i++;    i++;    while(line[i] != ',')       {	tmp[j] = line[i];	j++;	i++;      }    if((atoi(tmp) < 10) && (count > 0)) //less than 10 packets received and less than two line of data      flag ++;    else if ((atoi(tmp) < 10) && (count == 0)) //ignore data altotgether, as < 10 packets and on a single line as has       ignore++;    else    {      pkt_line = atoi(tmp); //packets received on a line      pkt_recv = pkt_recv + pkt_line;    }       empty(tmp);    j=0;	    while(line[i] != ' ')      i++;         i++;    while(line[i] != ',')      {	tmp[j] = line[i];	j++;	i++;      }    if(flag == 0)      pkt_lost = (pkt_lost + atoi(tmp));	    empty(tmp);	    j=0;	    while(line[i] != ' ')      i++;	    i++;    while(line[i] != ',')      {	tmp[j] = line[i];	j++;	i++;      }    pkt_before = atoi(tmp);;    empty(tmp);    j=0;    while(line[i] != ' ')       i++;    i++;      while(line[i] != ',')      {	tmp[j] = line[i];	j++;	i++;      }    pkt_after = atoi(tmp);    pkt_interval = pkt_before - pkt_after - pkt_line;    //Don't count the number of packets received at a measurment points when:    //- the packet after field is not 0 (occurs for the first MP of all experiments)    //- flag counter has been set (described above)    //- the current room and mp differ to the next room and mp, that is skip the     //- it is the first line of a MP.     if((pkt_after != 0) && (flag == 0) && (mp == mp_last) && (room == room_last))    {      linecnt++; //lines that are included      pkt_over = pkt_over + pkt_interval; //number of packets that are over the limit      pkt_total = pkt_total + pkt_line; //total number of packets included     }    empty(tmp);    j=0;    while(line[i] != ' ')       i++;    i++;    while(line[i] != ',')       {	tmp[j] = line[i];	j++;	i++;      }    qual = (qual + atoi(tmp));    empty(tmp);    j=0;        while(line[i] != ' ')       i++;    i++;    while(line[i] != ',')       {	tmp[j] = line[i];	j++;	i++;      }    if ((flag == 0) && (linecnt > 0))      sig_lvl = (sig_lvl + (atoi(tmp))); //sub 256 to put it in dBm    empty(tmp);    j=0;	    while(line[i] != ' ')       i++;    i++;        while(line[i] != '\n')       {	tmp[j] = line[i];	j++;	i++;      }    if ((flag == 0) && (linecnt > 0))      noise_lvl = (noise_lvl + (atoi(tmp) - 256)); //sub 256 to put it in dBm        empty(tmp);    j = 0;        i = 0;    pkt_line = 0;    if ((flag == 0) && (linecnt > 0))      count++;    room_last = room;    mp_last = mp;     pkt_before = 0;    pkt_after = 0;  }  // all data has been found  fprintf(out,"END");  return(0);}int main(int argc, char *argv[]) {  FILE *in;  FILE *out;  char file[6], line[MAX_LINE_SIZE], time[MAX_LINE_SIZE];   int seconds;   const char *final = "strength";  const char *strength = "strength";  int max, i;  if(argc != 2)    printf("Need correct arguments: ./a.out <number of forms that which to be opened>");  else    {      max = atoi(argv[1]); //integer representing maximum number of forms      printf("Number of files to analyse is: %d\n", max);      for(i = 1; i<=max ; i++) //step through all forms which are in the arguments      {	  	sprintf(file,"%s%d",final,i);	printf("%s  ", file);		in = fopen(file, "r");  	if ((in) == NULL)	  {	    printf("fopen failed filename: %s\n",file);	    exit(1);	  }      	sprintf(file,"%s%d.txt",strength,i);	out = fopen(file, "w");  	if ((out) == NULL)	  {	    printf("fopen failed filename: %s\n",file);	    exit(1);	  }	rewind(in);	fgets(line, MAX_LINE_SIZE, in);	sscanf(line, "%s", time);			time[10] = '\0';	seconds = atoi(time);	weather(in, out, seconds);	rewind(in);	extract_data(in, out);	printf("Complete\n");		fclose(in);	fclose(out);      }	printf("\n\n  %d forms analysed and created...", --i);    }  return(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩电影一区| 精品成人一区二区| 日韩一区二区三区视频| 日本一区二区在线不卡| 亚洲自拍都市欧美小说| 国内外成人在线视频| 在线观看亚洲a| 亚洲国产精品黑人久久久| 亚洲成av人片www| 成人av免费在线观看| 日韩欧美国产成人一区二区| 亚洲在线中文字幕| 91美女视频网站| 欧美激情综合五月色丁香小说| 日本最新不卡在线| 欧美亚洲一区二区在线观看| 中文字幕在线一区免费| 国产精品888| 26uuu欧美日本| 久久99国内精品| 日韩一级完整毛片| 秋霞电影网一区二区| 欧美三区在线视频| 亚洲一区在线视频| 91婷婷韩国欧美一区二区| 亚洲国产成人在线| 东方aⅴ免费观看久久av| 久久日一线二线三线suv| 久久疯狂做爰流白浆xx| 日韩欧美国产三级电影视频| 免费在线成人网| 日韩视频免费直播| 精品在线视频一区| 欧美大肚乱孕交hd孕妇| 麻豆freexxxx性91精品| 欧美一级二级三级乱码| 日韩福利视频网| 中文字幕在线观看一区| 国产91露脸合集magnet| 国产午夜精品久久久久久免费视| 激情久久五月天| 国产亚洲综合在线| 99久久er热在这里只有精品15| 中文字幕在线不卡一区| 91在线视频网址| 亚洲第一福利视频在线| 欧美日韩一区二区欧美激情| 婷婷综合在线观看| 亚洲精品一区二区三区精华液 | 色综合视频在线观看| 1024国产精品| 欧美性大战久久| 美腿丝袜亚洲综合| 国产人成亚洲第一网站在线播放 | 在线观看www91| 亚洲6080在线| 久久婷婷国产综合国色天香| 成人精品国产福利| 亚洲国产成人av网| 精品国产sm最大网站免费看| 成人综合激情网| 亚洲一区二区欧美| 精品国产一区二区精华| 99riav久久精品riav| 午夜激情久久久| 久久久亚洲精品石原莉奈| 一本一本久久a久久精品综合麻豆| 亚洲国产精品久久人人爱 | 欧美视频一区在线| 久久99精品久久久久久| 亚洲欧美在线视频| 这里只有精品99re| 成人福利视频网站| 毛片av一区二区三区| 亚洲欧洲成人精品av97| 精品日本一线二线三线不卡| av激情成人网| 精品制服美女久久| 亚洲成人自拍网| 国产精品美女久久久久久久网站| 欧美日韩精品电影| 91在线看国产| 国产麻豆成人传媒免费观看| 亚洲国产一区二区a毛片| 国产欧美日产一区| 日韩一区二区三区视频| 在线亚洲免费视频| 国产91精品一区二区麻豆网站| 爽好久久久欧美精品| 日韩一区日韩二区| 国产日韩欧美综合一区| 在线播放国产精品二区一二区四区| 大尺度一区二区| 麻豆91在线观看| 日韩高清欧美激情| 亚洲国产精品久久久男人的天堂| 日本一区二区在线不卡| 亚洲精品一区二区三区99| 欧美高清dvd| 欧美一a一片一级一片| 91色综合久久久久婷婷| 成人动漫在线一区| 成人综合婷婷国产精品久久 | 日韩欧美黄色影院| 欧美人体做爰大胆视频| 精品国产在天天线2019| 日韩一区二区三区电影在线观看 | 亚洲日本在线a| 国产精品私房写真福利视频| 久久欧美中文字幕| 国产亚洲自拍一区| 久久久亚洲欧洲日产国码αv| 欧美成人女星排行榜| 欧美一个色资源| 91精品国产日韩91久久久久久| 欧美午夜电影网| 日本福利一区二区| 日本韩国欧美在线| 在线观看视频欧美| 欧美日韩国产影片| 欧美顶级少妇做爰| 日韩欧美一级二级三级久久久| 制服.丝袜.亚洲.另类.中文| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲精品在线三区| 欧美三级中文字| 欧美日韩成人综合| 91精品国产综合久久久久久漫画 | 日韩欧美一区二区三区在线| 日韩欧美一二区| 精品成人a区在线观看| www欧美成人18+| 国产精品你懂的在线| 亚洲婷婷综合色高清在线| 一区二区三区在线观看国产| 国产福利视频一区二区三区| 波多野结衣中文字幕一区二区三区 | 成人短视频下载| 97se亚洲国产综合自在线| 色老头久久综合| 4438x亚洲最大成人网| 精品人伦一区二区色婷婷| 日本一区二区成人| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲成av人片一区二区梦乃| 美女在线视频一区| 成人av电影在线| 欧美男同性恋视频网站| 久久精品人人做人人爽人人| 亚洲天堂精品在线观看| 日本在线不卡视频一二三区| 国产不卡视频在线播放| 欧美视频一二三区| 欧美男男青年gay1069videost| 久久女同互慰一区二区三区| 亚洲三级在线观看| 看电视剧不卡顿的网站| 91香蕉视频污| 日韩欧美国产一区二区三区| ㊣最新国产の精品bt伙计久久| 天天av天天翘天天综合网| 成人午夜激情影院| 日韩丝袜美女视频| 一区二区在线观看免费视频播放| 久久成人免费日本黄色| 91麻豆文化传媒在线观看| 日韩精品一区国产麻豆| 日韩毛片视频在线看| 精品一区二区久久久| 欧美日韩一区 二区 三区 久久精品| 久久这里只有精品首页| 亚洲午夜成aⅴ人片| 成熟亚洲日本毛茸茸凸凹| 91精品在线免费观看| 亚洲女同一区二区| 成人黄色小视频在线观看| 日韩三级视频在线看| 亚洲三级电影全部在线观看高清| 日韩中文字幕1| 色婷婷综合久久久中文一区二区 | 色综合久久久久久久久久久| 久久色在线视频| 久久精品二区亚洲w码| 欧美在线观看18| 亚洲欧美日韩在线不卡| 国产成人免费9x9x人网站视频| 69精品人人人人| 亚洲欧洲综合另类| 成人a级免费电影| 日本一区二区视频在线观看| 国产在线精品一区二区| 日韩欧美国产综合| 美女国产一区二区| 欧美一区二区三区精品| 亚洲成人自拍网| 欧美浪妇xxxx高跟鞋交| 亚洲成人av电影在线| 欧美色综合久久| 丝袜诱惑亚洲看片| 91精品在线一区二区|