aaaa

Dependencies:   SeeedStudioTFTv2 TFT_fonts mbed

Fork of Seeed_TFT_Touch_Shield by Bhavik Bhuta

Committer:
bhavk11
Date:
Mon Nov 03 06:23:16 2014 +0000
Revision:
13:331f8235ea72
Parent:
12:f27b67e10b0c
Added report and gerber files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
uswickra 5:c1af1f8fa026 1 #pragma once
uswickra 5:c1af1f8fa026 2 #include "mbed.h"
uswickra 5:c1af1f8fa026 3 #include "SeeedStudioTFTv2.h"
uswickra 5:c1af1f8fa026 4
uswickra 5:c1af1f8fa026 5 extern SeeedStudioTFTv2 TFT;
uswickra 5:c1af1f8fa026 6 //extern Serial pc;
uswickra 5:c1af1f8fa026 7 enum GSM_MESSAGE {
uswickra 7:5cf5aeae1954 8 MESSAGE_NONE = 0 ,
uswickra 7:5cf5aeae1954 9 MESSAGE_RING = 1,
uswickra 7:5cf5aeae1954 10 MESSAGE_SMS = 2,
uswickra 5:c1af1f8fa026 11 MESSAGE_ERROR
uswickra 5:c1af1f8fa026 12 };
uswickra 5:c1af1f8fa026 13
uswickra 5:c1af1f8fa026 14 #define BUF_SIZE 100
uswickra 12:f27b67e10b0c 15 #define SMS_MAX_LENGTH 300
uswickra 5:c1af1f8fa026 16 class Modem{
uswickra 5:c1af1f8fa026 17
uswickra 5:c1af1f8fa026 18 public:
uswickra 5:c1af1f8fa026 19 Modem(PinName tx, PinName rx, int baudRate,char *default_number);
uswickra 5:c1af1f8fa026 20 int init();
uswickra 5:c1af1f8fa026 21 int call_phone(char* number);
uswickra 5:c1af1f8fa026 22 void recv_phone();
uswickra 5:c1af1f8fa026 23 void hangup_phone();
uswickra 5:c1af1f8fa026 24 int send_sms(char* number, char* msg);
uswickra 5:c1af1f8fa026 25 void recv_sms(char* msg, int msg_size, int index);
uswickra 5:c1af1f8fa026 26 void get_clck(char* msg, int size);
uswickra 5:c1af1f8fa026 27 void cls();
uswickra 5:c1af1f8fa026 28 Serial serial_modem;
uswickra 5:c1af1f8fa026 29 Timer timeCnt;
uswickra 5:c1af1f8fa026 30 int loopHandle(void);
uswickra 5:c1af1f8fa026 31 char messageBuffer[SMS_MAX_LENGTH];
uswickra 7:5cf5aeae1954 32 char messageCopyBuffer[SMS_MAX_LENGTH];
uswickra 7:5cf5aeae1954 33 int updateBuffer(char c);
uswickra 11:575dfd388778 34 void copy_msg();
uswickra 7:5cf5aeae1954 35 int mIndex ;
uswickra 7:5cf5aeae1954 36 int mTypeState ;
uswickra 5:c1af1f8fa026 37
uswickra 5:c1af1f8fa026 38 protected:
uswickra 5:c1af1f8fa026 39 int sendCmdWaitResp(char* cmd, char* response, int timeout);
uswickra 5:c1af1f8fa026 40 int write_device(char c);
uswickra 5:c1af1f8fa026 41 int write_device_str(char* str);
uswickra 5:c1af1f8fa026 42 bool read_device_ready();
uswickra 5:c1af1f8fa026 43 char read_device();
uswickra 5:c1af1f8fa026 44
uswickra 5:c1af1f8fa026 45 int check_AT();
uswickra 5:c1af1f8fa026 46 int check_PIN();
uswickra 5:c1af1f8fa026 47 int setup_SMS();
uswickra 5:c1af1f8fa026 48
uswickra 5:c1af1f8fa026 49 char read_buffer[BUF_SIZE+1];
uswickra 5:c1af1f8fa026 50 int buffer_p;
uswickra 5:c1af1f8fa026 51 void clean_buffer();
uswickra 5:c1af1f8fa026 52 void reset_buffer();
uswickra 5:c1af1f8fa026 53
uswickra 5:c1af1f8fa026 54
uswickra 5:c1af1f8fa026 55 private:
uswickra 5:c1af1f8fa026 56
uswickra 5:c1af1f8fa026 57 char* default_number;
uswickra 5:c1af1f8fa026 58 bool read_trail;
uswickra 5:c1af1f8fa026 59 void debug_cmd_buffer();
uswickra 5:c1af1f8fa026 60 int find_pattern_end(char *pattern, char *buffer, int size);
uswickra 5:c1af1f8fa026 61
uswickra 5:c1af1f8fa026 62
uswickra 5:c1af1f8fa026 63 };