Menu

#1 StackOverflow

open
nobody
5
2008-08-06
2008-08-06
Michela
No

Hi.
As you the describe in GPS_Comm class i creeated an application that implements GPS_DataListener, the code is as you tell:

public gps(){
inizio();
}
public void GPS_SatelliteDataChanged(GPS_SatelliteData data){
data.getElevation();
}

public void inizio(){
GPS_Comm comm = new GPS_Comm();
gps g=new gps();
comm.add_GPS_DataListener(this);
ArrayList<NMEA_Provider> providers = comm.get_NMEA_Providers("/Users/martarodolfi/Downloads/WIGSGPSComm2/drivers/");
for (NMEA_Provider provider : providers) {
String providerName = provider.getName();
if (providerName.equals("Serial port (RS-232)")) {
NMEA_ProviderConfigParameterArray config = provider.getConfiguration();
config.resetIterator();
while (config.hasNext()) {
NMEA_ProviderConfigParameter param = config.next();
if (param.getName().equals("serialPort")) {
param.setValue("COM7");
} else if (param.getName().equals("baudRate")) {
param.setValue("4800");
} else if (param.getName().equals("dataBit")) {
param.setValue("8");
} else if (param.getName().equals("stopBit")) {
param.setValue("1");
} else if (param.getName().equals("parity")) {
param.setValue("None");
}
}
try{
provider.setConfiguration(config);
}catch (Exception e){
e.printStackTrace();

      \}
          comm.open\(provider\);
      \}
   \}

}

/\*\*
 \* @param args
 \*/
public static void main\(String\[\] args\) \{
    new gps\(\);

}

}

However when I execute it this error appears from the console:

Exception in thread "main" java.lang.StackOverflowError
at no.whitestone.wigs.api.gps.GPS_Comm.<init>(GPS_Comm.java:69)
at gps.inizio(gps.java:33)
at gps.<init>(gps.java:19)

What I wrong?

Thanks for your help

Mike

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.