This is my Notify_Incoming_Messages



/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package midletehs8sms; import com.cinterion.io.ATCommand; import com.cinterion.io.ATCommandListener; /** * * @author Morten */ public class Notify_Incoming_Messages { //--------------------------------------------------------- // AT^SCFG="Userware/Autostart","","1" //--------------------------------------------------------- public ATCommandListener listener; public ATCommand nim_atcommand; public MidletEHS8SMS parent; public Process_Message pm; public Subrutine subrutine; public Reader reader; //--------------------------------------------------------- public String response = null; public String get_the_response_code_as_a_string = null; //--------------------------------------------------------- boolean exception_bool = false; //--------------------------------------------------------- public void Notify_Incoming_Messages( final MidletEHS8SMS parent ,Reader reader ){ //--------------------------------------------------------- this.parent = parent; this.reader = reader; //--------------------------------------------------------- System.out.println("Notify_Incoming_Messages(BEGIN)"); //--------------------------------------------------------- /*****************************************************************************/ /*****************************************************************************/ System.out.println("Start Notify() "); //----------------------------------------------------------------------------- listener = new ATCommandListener() { //----------------------------------------------------------------------------- public void RINGChanged(boolean SignalState) { System.out.println("Notify RINGChanged -> " + SignalState); } //----------------------------------------------------------------------------- public void DCDChanged(boolean SignalState) { System.out.println("Notify DCDChanged -> " + SignalState); } //----------------------------------------------------------------------------- public void DSRChanged(boolean SignalState) { System.out.println("Notify DSRChanged -> " + SignalState); } //----------------------------------------------------------------------------- public void CONNChanged(boolean SignalState) { System.out.println("Notify CONNChanged -> " + SignalState); } //----------------------------------------------------------------------------- public void ATEvent(String Event) { //----------------------------------------------------------------------------- System.out.println("ATEvent Begin"); //----------------------------------------------------------------------------- if (Event.indexOf( "+CMTI:") != -1 ) { System.out.println("ATEvent: " + Event.trim()); parent.reader.event_read = Event.trim(); parent.reader.Handle_Message(); }//if (Event.indexOf("+CMTI:") //----------------------------------------------------------------------------- // System.out.println("ATEvent End"); //----------------------------------------------------------------------------- }//ATEvent /*---------------------------------------------------------------------------*/ }; // ATCommandListener //----------------------------------------------------------------------------- parent.atcommand.addListener(listener); parent.SendCommand("at+cmgf=1 \r"); parent.SendCommand("at+cnmi=2,1 \r"); /*****************************************************************************/ // System.out.println("Notify_Incoming_Messages(END)"); /*****************************************************************************/ /*****************************************************************************/ // System.out.println("Notify_Incoming_Messages(END)"); /*****************************************************************************/ }//End of public void Notify_Incoming_Messages /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ }//End of "public class Notify_Incoming_Messages" /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/