B4R Question GSM to B4A

Discussion in 'B4R Questions' started by Beja, May 21, 2019.

  1. Beja

    Beja Expert Licensed User

    Hello guys,
    In this example, Android device sends SMS to a GSM connected to Arduino. I am looking for the other way round, that the GSM module sends SMS message to B4A application (one way only).

    Any hint or direction to a related post appreciated.. I couldn't find one.
     
  2. tigrot

    tigrot Well-Known Member Licensed User

    Beja likes this.
  3. thetahsk

    thetahsk Active Member Licensed User

    The example above includes already everthing you need.
    Look inside GSM.bas
    Code:
    'PhoneNumber - should start with + and include country code.
    Public Sub SendSMS(PhoneNumber() As Byte, message() As Byte) As Boolean
       
    If busy Then Return False
       busy = 
    True
       astream.Write(
    "AT+CMGS=""").Write(PhoneNumber).Write("""").Write(EOL)
       
    'copy the message to the global variable
       bc.ArrayCopy(message, messageToSend)
       
    Return True
    End Sub
     
    Beja likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice