A library for talking to Multi-Tech's Cellular SocketModem Devices.

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

Committer:
kranjan
Date:
Sat Jan 04 05:28:45 2014 +0000
Revision:
141:571e0ef6c8dc
Parent:
124:6d964b4343c8
Child:
143:c7d8fe37981b
Added licensing header to all files in the library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kranjan 141:571e0ef6c8dc 1 /* Universal Socket Modem Interface Library
kranjan 141:571e0ef6c8dc 2 * Copyright (c) 2013 Multi-Tech Systems
kranjan 141:571e0ef6c8dc 3 *
kranjan 141:571e0ef6c8dc 4 * Licensed under the Apache License, Version 2.0 (the "License");
kranjan 141:571e0ef6c8dc 5 * you may not use this file except in compliance with the License.
kranjan 141:571e0ef6c8dc 6 * You may obtain a copy of the License at
kranjan 141:571e0ef6c8dc 7 *
kranjan 141:571e0ef6c8dc 8 * http://www.apache.org/licenses/LICENSE-2.0
kranjan 141:571e0ef6c8dc 9 *
kranjan 141:571e0ef6c8dc 10 * Unless required by applicable law or agreed to in writing, software
kranjan 141:571e0ef6c8dc 11 * distributed under the License is distributed on an "AS IS" BASIS,
kranjan 141:571e0ef6c8dc 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
kranjan 141:571e0ef6c8dc 13 * See the License for the specific language governing permissions and
kranjan 141:571e0ef6c8dc 14 * limitations under the License.
kranjan 141:571e0ef6c8dc 15 */
kranjan 141:571e0ef6c8dc 16
mfiore 124:6d964b4343c8 17 #include "mbed.h"
mfiore 124:6d964b4343c8 18 #include "include_me.h"
mfiore 124:6d964b4343c8 19
mfiore 124:6d964b4343c8 20 // uncomment only the header corresponding to the test you want to run
mfiore 124:6d964b4343c8 21 //#include "test_ping.h"
mfiore 124:6d964b4343c8 22 //#include "test_SMS.h"
mfiore 124:6d964b4343c8 23 //#include "test_TCP_Socket.h"
mfiore 124:6d964b4343c8 24 //#include "test_TCP_Socket_Echo.h"
mfiore 124:6d964b4343c8 25 //#include "test_MTS_Circular_Buffer.h"
mfiore 124:6d964b4343c8 26
mfiore 124:6d964b4343c8 27
mfiore 124:6d964b4343c8 28 //int main() {
mfiore 124:6d964b4343c8 29 // uncomment only one test at a time
mfiore 124:6d964b4343c8 30
mfiore 124:6d964b4343c8 31 // PING TEST
mfiore 124:6d964b4343c8 32 //testPing();
mfiore 124:6d964b4343c8 33
mfiore 124:6d964b4343c8 34 /*
mfiore 124:6d964b4343c8 35 // SMS TEST
mfiore 124:6d964b4343c8 36 for (int i = 30; i >= 0; i = i - 2) {
mfiore 124:6d964b4343c8 37 wait(2);
mfiore 124:6d964b4343c8 38 printf("Waiting %d seconds...\n\r", i);
mfiore 124:6d964b4343c8 39 }
mfiore 124:6d964b4343c8 40 Transport::setTransport(Transport::CELLULAR);
mfiore 124:6d964b4343c8 41 MTSSerialFlowControl* serial = new MTSSerialFlowControl(PTD3, PTD2, PTA12, PTC8);
mfiore 124:6d964b4343c8 42 serial->baud(115200);
mfiore 124:6d964b4343c8 43 Cellular* cell = Cellular::getInstance();
mfiore 124:6d964b4343c8 44 cell->init(serial);
mfiore 124:6d964b4343c8 45 while (cell->getRegistration() != Cellular::REGISTERED);
mfiore 124:6d964b4343c8 46 while (cell->setApn("wap.cingular") != SUCCESS);
mfiore 124:6d964b4343c8 47
mfiore 124:6d964b4343c8 48 sendSms();
mfiore 124:6d964b4343c8 49 while (true) {
mfiore 124:6d964b4343c8 50 receiveSms();
mfiore 124:6d964b4343c8 51 wait(15);
mfiore 124:6d964b4343c8 52 }
mfiore 124:6d964b4343c8 53 */
mfiore 124:6d964b4343c8 54
mfiore 124:6d964b4343c8 55 // TCP SOCKET TEST
mfiore 124:6d964b4343c8 56 //testTcpSocket();
mfiore 124:6d964b4343c8 57
mfiore 124:6d964b4343c8 58 // TCP SOCKET ECHO TEST
mfiore 124:6d964b4343c8 59 //testTcpSocketEcho();
mfiore 124:6d964b4343c8 60
mfiore 124:6d964b4343c8 61 // CIRCULAR BUFFER TEST
mfiore 124:6d964b4343c8 62 //testMTSCircularBuffer();
kranjan 141:571e0ef6c8dc 63 //}