B4R Question GSM to B4A

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.
 

thetahsk

Active Member
Licensed User
The example above includes already everthing you need.
Look inside GSM.bas
B4X:
'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
 
Top