Advertisement
Guest User

Untitled

a guest
Sep 13th, 2014
833
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None
  1. protected void sendSMS()
  2. {
  3. try {
  4. String Response = m_Cmd.send("AT+cmgf = 1\r");
  5. System.out.println(Response);
  6. Response = m_Cmd.send("AT+CMGS=\"041415603\"\r"); //here you put your nummber
  7. System.out.println(Response);
  8. Response = m_Cmd.send("Prekinitev napajanje na GSM modulu!" + (char) 26); //here you put text that is inside the SMS
  9. System.out.println(Response);
  10. String ctrlZ = (char)26 + "";
  11. m_Cmd.send(ctrlZ, new RspListener()); //escapse character, that marks end of SMS content
  12. } catch (ATCommandFailedException ex) {
  13. ex.printStackTrace();
  14. } catch (IllegalStateException ex) {
  15. ex.printStackTrace();
  16. } catch (IllegalArgumentException ex) {
  17. ex.printStackTrace();
  18. }
  19. }
Advertisement
RAW Paste Data Copied
Advertisement