teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Committer:
brunofgc
Date:
Tue Jul 11 11:55:56 2017 +0000
Revision:
7:ae9c47f62946
Parent:
1:0e0967c88590
Child:
9:cf406384efd9
Vers?o UCSal piloto 1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
brunofgc 0:1c0a769988ee 1 //#include "main.h"
brunofgc 0:1c0a769988ee 2 #ifndef _modem_h_
brunofgc 0:1c0a769988ee 3 #define _modem_h_
brunofgc 0:1c0a769988ee 4
brunofgc 0:1c0a769988ee 5 #include "serialModem.h"
brunofgc 0:1c0a769988ee 6 #include "serialPC.h"
brunofgc 0:1c0a769988ee 7 #include "funcoesSDCard.h"
brunofgc 0:1c0a769988ee 8 #include "cmsis_os.h" //Nucleo do Real Time Operational System
brunofgc 0:1c0a769988ee 9 #include "diversos.h"
brunofgc 0:1c0a769988ee 10
brunofgc 0:1c0a769988ee 11 #define dadosStatus 1
brunofgc 0:1c0a769988ee 12 #define dadosArmazenados 2
brunofgc 0:1c0a769988ee 13
brunofgc 0:1c0a769988ee 14 #define xereta_modem
brunofgc 0:1c0a769988ee 15
brunofgc 0:1c0a769988ee 16 typedef struct{
brunofgc 0:1c0a769988ee 17 uint32_t sent;
brunofgc 0:1c0a769988ee 18 uint32_t received;
brunofgc 0:1c0a769988ee 19 uint16_t buff_in;
brunofgc 0:1c0a769988ee 20 uint16_t ack_waiting;
brunofgc 0:1c0a769988ee 21 }socket_info;
brunofgc 0:1c0a769988ee 22
brunofgc 0:1c0a769988ee 23 typedef struct{
brunofgc 0:1c0a769988ee 24 char commandMode;
brunofgc 1:0e0967c88590 25 char RSSI;
brunofgc 0:1c0a769988ee 26 char serverConnected;
brunofgc 0:1c0a769988ee 27 char associated;
brunofgc 0:1c0a769988ee 28 char modemIP[17];
brunofgc 0:1c0a769988ee 29 char operadora;
brunofgc 0:1c0a769988ee 30 char OK;
brunofgc 0:1c0a769988ee 31 char SEND_OK;
brunofgc 0:1c0a769988ee 32 char ERROR;
brunofgc 0:1c0a769988ee 33 char NO_CARRIER;
brunofgc 0:1c0a769988ee 34 char ServerAck;
brunofgc 0:1c0a769988ee 35 char STAIP[16];
brunofgc 0:1c0a769988ee 36 char MAC[20];
brunofgc 0:1c0a769988ee 37 char IMSI[30];
brunofgc 0:1c0a769988ee 38 char ssid[40];
brunofgc 0:1c0a769988ee 39 char password[50];
brunofgc 0:1c0a769988ee 40 char serverIP[17];
brunofgc 0:1c0a769988ee 41 char port[6];
brunofgc 0:1c0a769988ee 42 char SRINGsockEntrante;
brunofgc 0:1c0a769988ee 43 char ping;
brunofgc 0:1c0a769988ee 44 char socketBufferPending;
brunofgc 0:1c0a769988ee 45 uint16_t socketBufferPendingLength;
brunofgc 0:1c0a769988ee 46 uint16_t socketBuffer_ack_waiting;
brunofgc 0:1c0a769988ee 47 bool emComunicacao;
brunofgc 0:1c0a769988ee 48 char PROMPT_ENVIO_COMMAND_MODE;
brunofgc 0:1c0a769988ee 49 uint8_t timeOut;
brunofgc 0:1c0a769988ee 50 bool recebendoArquivoDoServer;
brunofgc 0:1c0a769988ee 51 bool exibeBufModem;
brunofgc 0:1c0a769988ee 52 bool socketEntranteAtivo;
brunofgc 0:1c0a769988ee 53 char CLOSED;
brunofgc 0:1c0a769988ee 54 char busy;
brunofgc 7:ae9c47f62946 55 char modemResponse;
brunofgc 0:1c0a769988ee 56 socket_info socketInfo[2];
brunofgc 0:1c0a769988ee 57 }modemStatus;
brunofgc 0:1c0a769988ee 58
brunofgc 0:1c0a769988ee 59 extern int16_t numeroDeBytesPorEnvio;
brunofgc 0:1c0a769988ee 60 extern uint8_t connID;
brunofgc 0:1c0a769988ee 61 extern uint16_t IPDNumBytes;
brunofgc 0:1c0a769988ee 62 extern bool enviaSendData;
brunofgc 0:1c0a769988ee 63 extern char *bufInPtr;
brunofgc 0:1c0a769988ee 64 extern bool mudaRede;
brunofgc 0:1c0a769988ee 65
brunofgc 0:1c0a769988ee 66 namespace modemCom{
brunofgc 0:1c0a769988ee 67 extern modemStatus status; //Struct que comporta os status do modem
brunofgc 0:1c0a769988ee 68 extern char* bufIn; //Ponteiro para buffer de entrada do modem;
brunofgc 0:1c0a769988ee 69 extern uint32_t timeOutModem;
brunofgc 0:1c0a769988ee 70 extern bool exibeEntradaPacote;
brunofgc 0:1c0a769988ee 71 extern bool atendendoWebServer;
brunofgc 0:1c0a769988ee 72
brunofgc 7:ae9c47f62946 73
brunofgc 0:1c0a769988ee 74
brunofgc 7:ae9c47f62946 75 //Funções
brunofgc 7:ae9c47f62946 76 uint8_t sendToModem(char *,uint8_t,char *,char *,uint16_t,uint8_t,uint16_t); //Função que envia strings ao modem
brunofgc 0:1c0a769988ee 77 void processaPacote(void const *); //Função que processa pacotes entrantes do modem
brunofgc 0:1c0a769988ee 78 uint8_t inicializaModem(void);
brunofgc 0:1c0a769988ee 79 uint8_t enviaDados(char);
brunofgc 0:1c0a769988ee 80 //void sendEscapeSequence(void);
brunofgc 0:1c0a769988ee 81 char aguardaFlush(uint8_t); //connection id 1 a 6 atualmente 1 a 2
brunofgc 0:1c0a769988ee 82 //uint8_t sendFileCommandMode(FILE *,bool *,char *,uint32_t,char *);
brunofgc 0:1c0a769988ee 83 uint8_t postFileCommandMode(char *,char *,arquivoSD *);
brunofgc 0:1c0a769988ee 84 bool montaStatus(void);
brunofgc 0:1c0a769988ee 85 void leMAC(void);
brunofgc 7:ae9c47f62946 86 void atendeSRING(uint8_t);
brunofgc 0:1c0a769988ee 87 bool sendBufferCommandMode(uint8_t, char *, uint16_t);
brunofgc 0:1c0a769988ee 88 bool closeConnection(uint8_t);
brunofgc 0:1c0a769988ee 89 void webServer(void);
brunofgc 0:1c0a769988ee 90 char cipSend(uint8_t,char *,uint16_t);
brunofgc 0:1c0a769988ee 91 void conectaWiFi(void);
brunofgc 1:0e0967c88590 92 int16_t getRSSI(void);
brunofgc 1:0e0967c88590 93 bool writeStatusToSD(void);
brunofgc 7:ae9c47f62946 94 bool verificaConexao(void);
brunofgc 7:ae9c47f62946 95 bool leIP(void);
brunofgc 0:1c0a769988ee 96 }
brunofgc 0:1c0a769988ee 97 #endif