This is a demonstration program that shows operation of SMS using the WNC Interface.

Dependencies:   WNCInterface mbed-rtos mbed

This example program demonstrates the use of SMS with the AT&T IoT Kit which is sold by Avnet.

NOTE: Using SMS messages in conjunction with the AT&T IoT Kit are not standard SMS messages. These messages are intended to send messages between IoT devices and services such as FLOW (https://flow.att.com/). The SMS capability does not allow for interaction with a standard cellular phone number, instead, it uses a 15 digit MSIDN. This 15 digit MSIDN is displayed to the user when the program starts.

DESCRIPTION

The SMS example program generates a static SMS message and increasing sequence number that is sent every 30 seconds to 5277 (this is the default number for the AT&T SIM Control Center). Additionally, if a message is sent from the AT&T SIM Control Center it is displayed on the users console. The typical use case for SMS is that messages are sent via the provided via the AT&T APIs (https://starterkit.att.com/docs#sms-resource). For details on how and to-whom to send / receive SMS messages, please contact AT&T.

Discussion

The SMS example program defines two threads of operation. One thread—main—simply sends a SMS message every 20 seconds. The second thread is started when the WNCSms object is initialized. The initialization allows the user to specify a time period (in seconds) to check for messages and a function to call when a message is received. In the example program, incoming messages are checked for every second and if one is received, the function msg_rcvd() is called.

The msg_rcvd() function expect to be passed a single parameter—WNCSmsMsg&. This will contain all the information associated with the incoming SMS.

Expected execution outcome

Once the program is compiled and downloaded to the IoT Kit, perform the following steps:

1. Using a terminal program such as Hyperterm or Putty, connect to the Kit (select comm parameters of 115200-N81)

2. Press the `reset` button, then you should see the program start running! When it runs, the output will look similar to:

Sample Ouput

=Sample Output=

STARTING WNC SMS Test

Toggling Wakeup...
Toggling complete.
 WNC Initialized
 SMS Initialized
get my number: 882350201419599
sending SMS #1 to 5277..GO; waiting...
msg_rcvd called, msg from: '5277'
msg_rcvd from: '16/11/14'
msg_rcvd at '13:17:20-32'
msg_rcvd contained '"16/11/14,13:17:20-32",0'
sending SMS #2 to 5277..GO; msg_rcvd called, msg from: '5277'
msg_rcvd from: '16/11/14'
msg_rcvd at '13:17:41-32'
msg_rcvd contained '"16/11/14,13:17:41-32",0'
waiting...
sending SMS #3 to 5277..GO; waiting...
msg_rcvd called, msg from: '5277'
msg_rcvd from: '16/11/14'
msg_rcvd at '13:18:02-32'
msg_rcvd contained '"16/11/14,13:18:02-32",0'
.
.
.
sending SMS #64 to 5277..GO; waiting...
msg_rcvd called, msg from: '5277'
msg_rcvd from: '16/11/14'
msg_rcvd at '13:39:43-32'
msg_rcvd contained '"16/11/14,13:39:43-32",0'
msg_rcvd called, msg from: '5277'
msg_rcvd from: '16/11/14'
msg_rcvd at '13:39:46-32'
msg_rcvd contained 'This is a test...'

The message received at *13:39:46-32* was sent from the AT&T SIM Control Center to show receipt of an SMS.

License

This library is released under the Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License and may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

.hgtags

Committer:
JMF
Date:
2016-12-06
Revision:
6:8b680309328e
Parent:
2:d3e7b0b9f60a

File content as of revision 6:8b680309328e:

09f0433c50db7d7105bdd2c22f6858d684a6ab40 att_cellular_K64_wnc_14A2A_20161117