Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1820 HighSpeedAnalogIn devices mbed
modem.h
00001 //#include "main.h" 00002 #ifndef _modem_h_ 00003 #define _modem_h_ 00004 00005 #include "serialModem.h" 00006 #include "serialPC.h" 00007 #include "funcoesSDCard.h" 00008 #include "cmsis_os.h" //Nucleo do Real Time Operational System 00009 #include "diversos.h" 00010 00011 #define maxTamFileSend 1048576 00012 00013 #define dadosStatus 1 00014 #define dadosArmazenados 2 00015 00016 #define maxTimeEnvioDados 700 //Significarão 70 segundos. 00017 00018 #define xereta_modem 00019 00020 typedef struct{ 00021 uint32_t sent; 00022 uint32_t received; 00023 uint16_t buff_in; 00024 uint16_t ack_waiting; 00025 }socket_info; 00026 00027 typedef struct{ 00028 char commandMode; 00029 char RSSI; 00030 char dnsError; 00031 char serverConnected; 00032 char associated; 00033 char operadora; 00034 char OK; 00035 char SEND_OK; 00036 char ERROR; 00037 char ServerAck; 00038 char STAIP[16]; 00039 char subnetmask[16]; 00040 char gateway[16]; 00041 char MAC[20]; 00042 char IMSI[30]; 00043 char ssid[40]; 00044 char password[50]; 00045 char serverIP[50]; 00046 char port[6]; 00047 char host[50]; 00048 uint32_t periodo; 00049 uint32_t periodoConfiguracao; 00050 char SRINGsockEntrante; 00051 char ping; 00052 char socketBufferPending; 00053 uint16_t socketBufferPendingLength; 00054 uint16_t socketBuffer_ack_waiting; 00055 bool emComunicacao; 00056 char PROMPT_ENVIO_COMMAND_MODE; 00057 uint8_t timeOut; 00058 uint8_t recebendoArquivoDoServer; 00059 bool exibeBufModem; 00060 bool socketEntranteAtivo; 00061 char CLOSED; 00062 char busy; 00063 char modemResponse; 00064 uint8_t connIDWebServer; 00065 uint8_t connIDServerCommand; 00066 uint8_t connIDSendData; 00067 socket_info socketInfo[2]; 00068 bool ALREADY_CONNECTED; 00069 char wifi_connected; 00070 }modemStatus; 00071 00072 extern int16_t numeroDeBytesPorEnvio; 00073 extern uint8_t connID; 00074 extern uint16_t IPDNumBytes; 00075 extern bool enviaSendData; 00076 extern char *bufInPtr; 00077 extern bool mudaRede; 00078 extern char webServerBuff[256]; 00079 00080 namespace modemCom{ 00081 extern modemStatus status; //Struct que comporta os status do modem 00082 extern char* bufIn; //Ponteiro para buffer de entrada do modem; 00083 extern uint32_t timeOutModem; 00084 extern uint16_t timeOutEnvioDados; 00085 extern bool exibeEntradaPacote; 00086 extern bool atendendoWebServer; 00087 //Funções 00088 uint8_t sendToModem(char *,uint8_t,char *,char *,uint16_t,uint8_t,uint16_t); //Função que envia strings ao modem 00089 void processaPacote(void const *); //Função que processa pacotes entrantes do modem 00090 uint8_t inicializaModem(void); 00091 uint8_t enviaDados(); 00092 //void sendEscapeSequence(void); 00093 char aguardaFlush(uint8_t); //connection id 1 a 6 atualmente 1 a 2 00094 //uint8_t sendFileCommandMode(FILE *,bool *,char *,uint32_t,char *); 00095 uint8_t postFileCommandMode(char *,char *,char *,arquivoSD *); 00096 bool montaStatus(void); 00097 void leMAC(void); 00098 void atendeSRING(uint8_t); 00099 bool sendBufferCommandMode(uint8_t, char *, uint16_t); 00100 char closeConnection(uint8_t*); 00101 void webServer(uint8_t); 00102 char cipSend(uint8_t,char *,uint16_t); 00103 bool conectaWiFi(void); 00104 bool leParametrosConexaoSDCard(); 00105 int16_t getRSSI(void); 00106 bool writeStatusToSD(void); 00107 bool verificaConexao(void); 00108 bool leIP(void); 00109 } 00110 #endif
Generated on Wed Jul 13 2022 12:46:24 by
 1.7.2
 1.7.2