📄 main.java
字号:
//Ejemplo muy b醩ico de como enviar y recibir datos por un socket TCP utilizando la clase ATCommand
//Se utiliza el servidor de Google.es y el puerto 80 para esccribir y leer datos.
package src;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import com.siemens.icm.io.ATCommand;
import com.siemens.icm.io.ATCommandFailedException;
import com.siemens.icm.io.ATCommandListener;
public class main extends MIDlet
{
ATCommand ATC;
ATCommandListener LIS;
int hemosRecibidoDatos=0;
protected void startApp() throws MIDletStateChangeException
{
//Inicializamos la clase ATCommand y el Listener
try
{
LIS = new ATListener();
ATC=new ATCommand(false);
ATC.addListener(LIS);
}
catch (IllegalStateException e){e.printStackTrace();}
catch (ATCommandFailedException e) {e.printStackTrace();}
//Iniciamos una conexi髇 TCP
iniciaConexion();
}
//Defimos nuestra clase ATListener
class ATListener implements ATCommandListener
{
//S髄o controlaremos un URC en este ejemplo
//y ser
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -