teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Committer:
brunofgc
Date:
Fri Jun 08 22:14:21 2018 +0000
Revision:
38:07d3907b74e5
Parent:
33:a60abda630f7
teste de publish para compilar no mbed-cli

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 30:8a06a85d8807 11 #define maxTamFileSend 1048576
brunofgc 30:8a06a85d8807 12
brunofgc 0:1c0a769988ee 13 #define dadosStatus 1
brunofgc 0:1c0a769988ee 14 #define dadosArmazenados 2
brunofgc 0:1c0a769988ee 15
brunofgc 33:a60abda630f7 16 #define maxTimeEnvioDados 700 //Significarão 70 segundos.
brunofgc 33:a60abda630f7 17
brunofgc 0:1c0a769988ee 18 #define xereta_modem
brunofgc 0:1c0a769988ee 19
brunofgc 0:1c0a769988ee 20 typedef struct{
brunofgc 0:1c0a769988ee 21 uint32_t sent;
brunofgc 0:1c0a769988ee 22 uint32_t received;
brunofgc 0:1c0a769988ee 23 uint16_t buff_in;
brunofgc 0:1c0a769988ee 24 uint16_t ack_waiting;
brunofgc 0:1c0a769988ee 25 }socket_info;
brunofgc 0:1c0a769988ee 26
brunofgc 0:1c0a769988ee 27 typedef struct{
brunofgc 0:1c0a769988ee 28 char commandMode;
brunofgc 1:0e0967c88590 29 char RSSI;
brunofgc 11:631bea162800 30 char dnsError;
brunofgc 0:1c0a769988ee 31 char serverConnected;
brunofgc 21:b9315cdd9275 32 char associated;
brunofgc 0:1c0a769988ee 33 char operadora;
brunofgc 0:1c0a769988ee 34 char OK;
brunofgc 0:1c0a769988ee 35 char SEND_OK;
brunofgc 0:1c0a769988ee 36 char ERROR;
brunofgc 0:1c0a769988ee 37 char ServerAck;
brunofgc 21:b9315cdd9275 38 char STAIP[16];
brunofgc 21:b9315cdd9275 39 char subnetmask[16];
brunofgc 21:b9315cdd9275 40 char gateway[16];
brunofgc 0:1c0a769988ee 41 char MAC[20];
brunofgc 0:1c0a769988ee 42 char IMSI[30];
brunofgc 0:1c0a769988ee 43 char ssid[40];
brunofgc 0:1c0a769988ee 44 char password[50];
brunofgc 18:1eefda1f7736 45 char serverIP[50];
brunofgc 0:1c0a769988ee 46 char port[6];
brunofgc 9:cf406384efd9 47 char host[50];
brunofgc 9:cf406384efd9 48 uint32_t periodo;
brunofgc 18:1eefda1f7736 49 uint32_t periodoConfiguracao;
brunofgc 0:1c0a769988ee 50 char SRINGsockEntrante;
brunofgc 0:1c0a769988ee 51 char ping;
brunofgc 0:1c0a769988ee 52 char socketBufferPending;
brunofgc 0:1c0a769988ee 53 uint16_t socketBufferPendingLength;
brunofgc 0:1c0a769988ee 54 uint16_t socketBuffer_ack_waiting;
brunofgc 0:1c0a769988ee 55 bool emComunicacao;
brunofgc 0:1c0a769988ee 56 char PROMPT_ENVIO_COMMAND_MODE;
brunofgc 0:1c0a769988ee 57 uint8_t timeOut;
brunofgc 17:9b0eecbacbaa 58 uint8_t recebendoArquivoDoServer;
brunofgc 0:1c0a769988ee 59 bool exibeBufModem;
brunofgc 0:1c0a769988ee 60 bool socketEntranteAtivo;
brunofgc 0:1c0a769988ee 61 char CLOSED;
brunofgc 0:1c0a769988ee 62 char busy;
brunofgc 7:ae9c47f62946 63 char modemResponse;
brunofgc 9:cf406384efd9 64 uint8_t connIDWebServer;
brunofgc 9:cf406384efd9 65 uint8_t connIDServerCommand;
brunofgc 33:a60abda630f7 66 uint8_t connIDSendData;
brunofgc 25:a6da63ed025b 67 socket_info socketInfo[2];
brunofgc 25:a6da63ed025b 68 bool ALREADY_CONNECTED;
brunofgc 33:a60abda630f7 69 char wifi_connected;
brunofgc 0:1c0a769988ee 70 }modemStatus;
brunofgc 0:1c0a769988ee 71
brunofgc 0:1c0a769988ee 72 extern int16_t numeroDeBytesPorEnvio;
brunofgc 0:1c0a769988ee 73 extern uint8_t connID;
brunofgc 0:1c0a769988ee 74 extern uint16_t IPDNumBytes;
brunofgc 0:1c0a769988ee 75 extern bool enviaSendData;
brunofgc 0:1c0a769988ee 76 extern char *bufInPtr;
brunofgc 0:1c0a769988ee 77 extern bool mudaRede;
brunofgc 9:cf406384efd9 78 extern char webServerBuff[256];
brunofgc 0:1c0a769988ee 79
brunofgc 0:1c0a769988ee 80 namespace modemCom{
brunofgc 0:1c0a769988ee 81 extern modemStatus status; //Struct que comporta os status do modem
brunofgc 14:c0162ab2a951 82 extern char* bufIn; //Ponteiro para buffer de entrada do modem;
brunofgc 33:a60abda630f7 83 extern uint32_t timeOutModem;
brunofgc 33:a60abda630f7 84 extern uint16_t timeOutEnvioDados;
brunofgc 0:1c0a769988ee 85 extern bool exibeEntradaPacote;
brunofgc 14:c0162ab2a951 86 extern bool atendendoWebServer;
brunofgc 7:ae9c47f62946 87 //Funções
brunofgc 7:ae9c47f62946 88 uint8_t sendToModem(char *,uint8_t,char *,char *,uint16_t,uint8_t,uint16_t); //Função que envia strings ao modem
brunofgc 0:1c0a769988ee 89 void processaPacote(void const *); //Função que processa pacotes entrantes do modem
brunofgc 0:1c0a769988ee 90 uint8_t inicializaModem(void);
brunofgc 10:263c093f8977 91 uint8_t enviaDados();
brunofgc 0:1c0a769988ee 92 //void sendEscapeSequence(void);
brunofgc 0:1c0a769988ee 93 char aguardaFlush(uint8_t); //connection id 1 a 6 atualmente 1 a 2
brunofgc 0:1c0a769988ee 94 //uint8_t sendFileCommandMode(FILE *,bool *,char *,uint32_t,char *);
brunofgc 18:1eefda1f7736 95 uint8_t postFileCommandMode(char *,char *,char *,arquivoSD *);
brunofgc 0:1c0a769988ee 96 bool montaStatus(void);
brunofgc 0:1c0a769988ee 97 void leMAC(void);
brunofgc 7:ae9c47f62946 98 void atendeSRING(uint8_t);
brunofgc 0:1c0a769988ee 99 bool sendBufferCommandMode(uint8_t, char *, uint16_t);
brunofgc 33:a60abda630f7 100 char closeConnection(uint8_t*);
brunofgc 15:0f78bf9c13ec 101 void webServer(uint8_t);
brunofgc 0:1c0a769988ee 102 char cipSend(uint8_t,char *,uint16_t);
brunofgc 15:0f78bf9c13ec 103 bool conectaWiFi(void);
brunofgc 15:0f78bf9c13ec 104 bool leParametrosConexaoSDCard();
brunofgc 1:0e0967c88590 105 int16_t getRSSI(void);
brunofgc 1:0e0967c88590 106 bool writeStatusToSD(void);
brunofgc 7:ae9c47f62946 107 bool verificaConexao(void);
brunofgc 7:ae9c47f62946 108 bool leIP(void);
brunofgc 0:1c0a769988ee 109 }
brunofgc 0:1c0a769988ee 110 #endif