• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using indexOf(), how to just take the RSSI value and display it ?

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TYPE=WIFI|TIME=1263867796390|ID=00:1e:c1:4c:c5:ce|NAME=3Com|RSSI=-87|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867796390|ID=00:1f:27:55:f7:70|NAME=USMHotspot|RSSI=-76|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867796390|ID=00:24:c3:31:0f:e0|NAME=csusm|RSSI=-92|WEP=true|INFR=true


The above is part of log file.
Im new in Java, so using indexOf(), how can i just take the RSSI value and display it ?
How to calculate the average signal strength for different wireless access point ?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why don't you take a look at all the methods of the java.lang.String class? Surely, there are other methods along with indexOf() that could be useful?

Henry
 
motress zlting
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:
Why don't you take a look at all the methods of the java.lang.String class? Surely, there are other methods along with indexOf() that could be useful?

Henry


TYPE=WIFI|TIME=1263867778390|ID=00:24:c3:31:2b:e0|NAME=csusm|RSSI=-93|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:12:17:7b:33:04|NAME=csusm|RSSI=-80|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:1f:27:55:f7:70|NAME=USMHotspot|RSSI=-70|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:1e:13:ee:3e:40|NAME=USMHotspot|RSSI=-85|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:24:c3:31:b8:80|NAME=csusm|RSSI=-91|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:90:4c:60:04:02|NAME=csusm|RSSI=-94|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:1b:0d:d6:6d:50|NAME=USMHotspot|RSSI=-70|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:1a:a2:dc:a0:60|NAME=USMHotspot|RSSI=-86|WEP=true|INFR=true
TYPE=WIFI|TIME=1263867778390|ID=00:1e:c1:4c:c5:ce|NAME=3Com|RSSI=-94|WEP=true|INFR=true

Acually how can i read the data line by line and categorize them with ID and its own RSSI value, after that i need to calculate the average value for specific ID ?
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

motress zlting wrote:
Acually how can i read the data line by line and categorize them with ID and its own RSSI value, after that i need to calculate the average value for specific ID ?




To read the file into your program, you can start with the IO tutorial....

http://java.sun.com/docs/books/tutorial/essential/io/

Once you have the data read, you can either parse it with methods from the java.lang.String class, mention earlier. Or if you are more adventurous, you can take a look at the regular expressions tutorial...

http://java.sun.com/docs/books/tutorial/essential/regex/

And once you parsed the values, you can take a look at the java.lang.Integer class to convert it to values that you can use to calculate the averages.

Henry
 
motress zlting
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

motress zlting wrote:
Acually how can i read the data line by line and categorize them with ID and its own RSSI value, after that i need to calculate the average value for specific ID ?




To read the file into your program, you can start with the IO tutorial....

http://java.sun.com/docs/books/tutorial/essential/io/

Once you have the data read, you can either parse it with methods from the java.lang.String class, mention earlier. Or if you are more adventurous, you can take a look at the regular expressions tutorial...

http://java.sun.com/docs/books/tutorial/essential/regex/

And once you parsed the values, you can take a look at the java.lang.Integer class to convert it to values that you can use to calculate the averages.

Henry




Actually i want to the following step :
1.scan line -> find ID -> new ID -> get ID -> scan its own RSSI value -> get RSSI value
2.scan line -> find next ID -> match previous ID
-> if same with previous ID -> get the RSSI value
-> if not same -> create a place to store new ID and its RSSI value
 
reply
    Bookmark Topic Watch Topic
  • New Topic