gsmSendSMS (Function) |
Top Previous Next |
This function sends an SMS message by using the GSM module. It will return status of the send command (see below). The number can contain "-" and " " (dash and space) as part of the number to send the message to.
Please note that you should always check the return value from this function. There are a number of reasons why this function could fail such as too much traffic on the GSM network etc., so always check the return value, and based on that it is possible to make a strategy for resending a message.
This function can also send GSM network SMS messages during an active mobile network session. The mobile network session will simply be suspended during the transmission of the SMS message and automatically be resumed after the operation has ended.
Input: phonenumber : STRING (max length is 20, excluding " " and "-") Number to send the SMS message to (if "9999" is used, the message will be sent to a connected PC - either through a cable connection or via an active data connection).
If the number is prefixed with an "@", the message is sent through the RTCU Communication Hub to the specified node number after the "@" character (only supported on network-enabled devices).
In case the device is not connected to the GSM network, the return value will be 1.
message : STRING The actual message to send (maximum of 160 characters).
Returns: INT
For GSM SMS messages:
For RTCU Communication Hub VSMS messages:
Declaration: FUNCTION gsmSendSMS : INT;
Example: INCLUDE rtcu.inc |