so i said, what the he..., lets rest old than, so lets do it all by
myself,
my code is something like this
static Enumeration portList;
public static void main(String[] args) {
defaultPort = "COM7"; //in widnows appears nokia 3500c modem
USB in com7
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals(defaultPort)) {
System.out.println("Found port: "+defaultPort);
portFound = true;
SerialModemGateway gateway = new SerialModemGateway
("modem.com7", "COM7", 9600, "Nokia", "3500c"); //here i think may be
a mistake, correct if im wrong
try{
System.out.println(" Model: " + gateway.getModel());//
it should print nokia 3500c
}
catch(Exception e){
e.printStackTrace();
}
}
}
}
i might have skipped some vars decl. ^ ^
throws this:
run:
Set default port to COM7
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Found port: COM7
java.lang.NullPointerException
at org.smslib.modem.AModemDriver.write(AModemDriver.java:264)
at org.smslib.modem.athandler.ATHandler.getModel
(ATHandler.java:215)
at org.smslib.modem.ModemGateway.getModel(ModemGateway.java:
863)
at examples.modem.nulltest.main(nulltest.java:63)
AGAIN NULL POINTER EXCEPTION D'ARGGGGGGGGHHHHHHH
any clue anyone?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SMSLib for Java User Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/smslib?hl=en
-~----------~----~----~----~------~----~------~--~---