I need your help in this topic:
I want to send text messages from a phone that is connected with USB to a laptop and sending the text should be write from a Java form. I tried to do some code using JSSC library, but something it doesn't work because the SMS is not sent. Connection is good, communication is good too, but the text message is not sent. Can either of you help me with this?
public static void main(String[] args) {
SerialPort port = new SerialPort("COM3");
char enter = 13;
char control_z=26;
char comilla = 34;
try {
System.out.println("Port open: " + port.openPort());
System.out.println("Params setted: " + port.setParams(9600, 8, 1, 0));
System.out.println("Set to SMS: " + port.writeBytes(("AT+CMGF=1"+enter).getBytes()));
System.out.println("Set the destinatar: " + port.writeBytes(("AT+CMGS"+comilla+"+phone_number"+comilla+enter).getBytes()));
System.out.println("Set the text: " + port.writeBytes(("text"+control_z).getBytes()));
System.out.println("Port closed: " + port.closePort());
}
catch (SerialPortException ex){
System.out.println(ex);
}
}