Comment envoyer des donnees via GSM (GSM Data) ?
Bonjour,
je suis en train de travaillé sur une application qui utilise une architacture contenant un client, 2 modems et un serveur les donnees sont envoyés entre les 2 modems via GSM (ni gprs, ni sms et ni WAP).
Est qu'il y a une solution?
Merci d'avance.
:D
Code essai de l'application
Bonjour,
je suis entrain de teste un code mais ca n'a pas marché. voici le code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SendData {
static Enumeration portList;
static CommPortIdentifier portId;
static SerialPort serialPort;
static OutputStream outputStream;
static InputStream inputStream;
static String messageString1 = "DATA to send:xxx!"; //overwritten later
static String destinationAddress = "+49172xxxxxxxx";
static String commandString1 = "AT+ATDT=\"" + destinationAddress + "\",145\r" + messageString1 + "\u001A\u005A";
public static void main(String[] args) {
try{portList = CommPortIdentifier.getPortIdentifiers();}
catch(Exception e){
System.out.println("ERROR:"+e.toString()+"\n");
System.exit(1);
};
while (portList.hasMoreElements()) {
{
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")) { //selects the port
try {
serialPort = (SerialPort)
portId.open("", 2000); //opens the port
}
catch (PortInUseException e) {
System.out.println("port in use:");
System.out.println(e.toString());
}
try {
outputStream = serialPort.getOutputStream();
}
catch (IOException e) {}
try {
serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
}
catch (UnsupportedCommOperationException e) {}
try {
outputStream.write(commandString1.getBytes());
System.out.println(commandString1);
serialPort.close();
}
catch (IOException e)
{
System.out.println("could not write to outputstream:");
System.out.println(e.toString());
}
}
}
}
}
}
} |
j'utilise le lib javaComm (javax.comm) mais ca n'a pas marche.
L'erreur est:
Code:
1 2
| Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: libLinuxSerialParallel: libLinuxSerialParallel.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou répertoire de ce type
Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink |
materiel utilisé est 2 modems Maestro connecte avec 2 pc via cable serie.
Est ce qu'il y a une solution?
Merci.
:D