rhr

Committer:
lawliet
Date:
Thu Nov 14 09:39:58 2013 +0000
Revision:
0:a5ae94727346
Child:
1:642a8dbe076c
initial 0.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lawliet 0:a5ae94727346 1 /*
lawliet 0:a5ae94727346 2 IOT_Mbed.h
lawliet 0:a5ae94727346 3 2013 Copyright (c) Seeed Technology Inc. All right reserved.
lawliet 0:a5ae94727346 4
lawliet 0:a5ae94727346 5 Author:lawliet.zou@gmail.com
lawliet 0:a5ae94727346 6 2013-11-14
lawliet 0:a5ae94727346 7
lawliet 0:a5ae94727346 8 This library is free software; you can redistribute it and/or
lawliet 0:a5ae94727346 9 modify it under the terms of the GNU Lesser General Public
lawliet 0:a5ae94727346 10 License as published by the Free Software Foundation; either
lawliet 0:a5ae94727346 11 version 2.1 of the License, or (at your option) any later version.
lawliet 0:a5ae94727346 12
lawliet 0:a5ae94727346 13 This library is distributed in the hope that it will be useful,
lawliet 0:a5ae94727346 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
lawliet 0:a5ae94727346 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
lawliet 0:a5ae94727346 16 Lesser General Public License for more details.
lawliet 0:a5ae94727346 17
lawliet 0:a5ae94727346 18 You should have received a copy of the GNU Lesser General Public
lawliet 0:a5ae94727346 19 License along with this library; if not, write to the Free Software
lawliet 0:a5ae94727346 20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
lawliet 0:a5ae94727346 21 */
lawliet 0:a5ae94727346 22
lawliet 0:a5ae94727346 23 #ifndef __GPRS_H__
lawliet 0:a5ae94727346 24 #define __GPRS_H__
lawliet 0:a5ae94727346 25
lawliet 0:a5ae94727346 26 #include "mbed.h"
lawliet 0:a5ae94727346 27
lawliet 0:a5ae94727346 28 class gprs{
lawliet 0:a5ae94727346 29
lawliet 0:a5ae94727346 30 public:
lawliet 0:a5ae94727346 31 int init(void);
lawliet 0:a5ae94727346 32 int readBuffer(char *buffer,int count);
lawliet 0:a5ae94727346 33 void sendCmd(char *cmd);
lawliet 0:a5ae94727346 34 int waitForResp(char *resp, int timeout);
lawliet 0:a5ae94727346 35 int sendCmdAndWaitForResp(char *cmd, char *resp, int timeout);
lawliet 0:a5ae94727346 36 int checkSIMStatus(void);
lawliet 0:a5ae94727346 37 int checkSignalStrength(void);
lawliet 0:a5ae94727346 38 int networkInit(void);
lawliet 0:a5ae94727346 39 int sendSMS(char *number, char *data);
lawliet 0:a5ae94727346 40 int sendSMS(void);
lawliet 0:a5ae94727346 41 int readSMS(char *buffer, char *message, bool check);
lawliet 0:a5ae94727346 42 int deleteSMS(int index);
lawliet 0:a5ae94727346 43 int callUp(char *number);
lawliet 0:a5ae94727346 44 int answerWithCheck(char *gprsBuffer, bool check);
lawliet 0:a5ae94727346 45 int loop(bool check);
lawliet 0:a5ae94727346 46 int connectTCP(char *ip, char *port);
lawliet 0:a5ae94727346 47 int sendTCPData(char *data);
lawliet 0:a5ae94727346 48 int closeTCP(void);
lawliet 0:a5ae94727346 49 int shutTCP(void);
lawliet 0:a5ae94727346 50 void serialDebug(void);
lawliet 0:a5ae94727346 51
lawliet 0:a5ae94727346 52 };
lawliet 0:a5ae94727346 53
lawliet 0:a5ae94727346 54 //extern gprs GPRS;
lawliet 0:a5ae94727346 55 #endif