diff --git a/20200806_retired_release.zip b/20200806_retired_release.zip deleted file mode 100644 index 8d512a4..0000000 Binary files a/20200806_retired_release.zip and /dev/null differ diff --git a/20201230_0411_retired.zip b/20201230_0411_retired.zip deleted file mode 100644 index 1147399..0000000 Binary files a/20201230_0411_retired.zip and /dev/null differ diff --git a/Network Module Manual - Code Rev 20210220 2350.docx b/Network Module Manual - Code Rev 20210221 1826.docx similarity index 97% rename from Network Module Manual - Code Rev 20210220 2350.docx rename to Network Module Manual - Code Rev 20210221 1826.docx index 2a824f5..6f01c3d 100644 Binary files a/Network Module Manual - Code Rev 20210220 2350.docx and b/Network Module Manual - Code Rev 20210221 1826.docx differ diff --git a/Network Module Manual - Code Rev 20210220 2350.odt b/Network Module Manual - Code Rev 20210221 1826.odt similarity index 97% rename from Network Module Manual - Code Rev 20210220 2350.odt rename to Network Module Manual - Code Rev 20210221 1826.odt index 931d985..ccde996 100644 Binary files a/Network Module Manual - Code Rev 20210220 2350.odt and b/Network Module Manual - Code Rev 20210221 1826.odt differ diff --git a/Network Module Manual - Code Rev 20210220 2350.pdf b/Network Module Manual - Code Rev 20210221 1826.pdf similarity index 99% rename from Network Module Manual - Code Rev 20210220 2350.pdf rename to Network Module Manual - Code Rev 20210221 1826.pdf index f3bca8a..348a4d9 100644 Binary files a/Network Module Manual - Code Rev 20210220 2350.pdf and b/Network Module Manual - Code Rev 20210221 1826.pdf differ diff --git a/NetworkModule/.Idea_Groups/Vector_File.grp b/NetworkModule/.Idea_Groups/Vector_File.grp index 0ff34d9..5e9643c 100644 --- a/NetworkModule/.Idea_Groups/Vector_File.grp +++ b/NetworkModule/.Idea_Groups/Vector_File.grp @@ -1,5 +1,5 @@ # Group File Created by IDEA # Project: -# Sat Feb 20 16:53:40 2021 +# Sun Feb 21 11:31:10 2021 # "networkmodule_vector.o" diff --git a/NetworkModule/.Idea_Temp/IDEA.ERR b/NetworkModule/.Idea_Temp/IDEA.ERR index e69de29..2660c11 100644 --- a/NetworkModule/.Idea_Temp/IDEA.ERR +++ b/NetworkModule/.Idea_Temp/IDEA.ERR @@ -0,0 +1,83 @@ +- NetworkModule_vector.o +- crts0.sm8 +- ds18b20.o +- enc28j60.o +- gpio.o +- httpd.o +- main.o +- mqtt.o +- mqtt_pal.o +- spi.o +- timer.o +- uart.o +- uip.o +- uip_arp.o +- uip_tcpapphub.o +- libisl0.sm8 +- libm0.sm8 +- NetworkModule_vector.o +- crts0.sm8 +- ds18b20.o +- enc28j60.o +- gpio.o +- httpd.o +- main.o +- mqtt.o +- mqtt_pal.o +- spi.o +- timer.o +- uart.o +- uip.o +- uip_arp.o +- uip_tcpapphub.o +- libisl0.sm8 +- libm0.sm8 +NetworkModule_vector.o: +C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\crts0.sm8: +ds18b20.o: +enc28j60.o: +gpio.o: +httpd.o: +main.o: +mqtt.o: +mqtt_pal.o: +spi.o: +timer.o: +uart.o: +uip.o: +uip_arp.o: +uip_tcpapphub.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)isxdig0.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)memmov.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)strcat0.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libisl0.sm8)strlen0.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)bmulx.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)eeprom.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)fmul.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ftol.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)imul.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)itolx.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)itoly.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladc.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ladd.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lcmp.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgadc.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgadd.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lglsh.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgor.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgsbc.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgursh.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lreg.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ltor.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ludiv.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)ldiv.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lgneg.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lneg.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lumod.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)lzmp.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)rtol.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)sdivx.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)uitof.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)utolx.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)xreg.o: +(C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\lib\libm0.sm8)yreg.o: diff --git a/NetworkModule/.Idea_Temp/IDEABLD.BAT b/NetworkModule/.Idea_Temp/IDEABLD.BAT index 0e4b913..e700607 100644 --- a/NetworkModule/.Idea_Temp/IDEABLD.BAT +++ b/NetworkModule/.Idea_Temp/IDEABLD.BAT @@ -1,5 +1,5 @@ REM COMMAND FILE BUILT BY IDEA -REM Sat Feb 20 16:53:36 2021 +REM Sun Feb 21 11:31:06 2021 REM cxstm8 -v -l +strict +debug +modsl0 +split +warn "networkmodule_vector.c" cxstm8 -v -l +strict +debug +modsl0 +split +warn "ds18b20.c" "enc28j60.c" "gpio.c" "httpd.c" "main.c" "mqtt.c" "mqtt_pal.c" "spi.c" "timer.c" "uart.c" "uip.c" "uip_arp.c" "uip_tcpapphub.c" diff --git a/NetworkModule/Main.c b/NetworkModule/Main.c index be3af98..a57ab05 100644 --- a/NetworkModule/Main.c +++ b/NetworkModule/Main.c @@ -49,7 +49,7 @@ //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// -const char code_revision[] = "20210220 2350"; +const char code_revision[] = "20210221 1826"; //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// diff --git a/NetworkModule/httpd.c b/NetworkModule/httpd.c index 94c82e1..b69cd4b 100644 --- a/NetworkModule/httpd.c +++ b/NetworkModule/httpd.c @@ -1611,14 +1611,6 @@ static uint16_t CopyHttpData(uint8_t* pBuffer, const char** ppData, uint16_t* pD // If the loop terminates and there is still data left to transmit (as // indicated by pDataLeft > 0) the calling routine will call the function // again. - // - // Normally one pass of this loop copies one character from the webpage - // template to the transmission buffer. However, up to ~75 bytes can be - // copied to the transmission buffer (for instance when one of the - // "replacement strings" (like %y00) is processed. For this reason nBytes - // might exceed nMaxBytes by up to 75 bytes if the code does not pre - // compensate for it. This is why nMaxBytes is set well below MAXFRAME. - // if (*pDataLeft > 0) { // If pDataLeft > 0 then we are (or are still) processing a page @@ -2453,12 +2445,13 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) // "\r\n\r\n" sequence, and we need to be able to handle TCP fragmentation // during that search. // - // If we are parsing a fragment then pSocket->nState may have been restored - // to a state further down in the process. + // If we are parsing a TCP fragment then pSocket->nState may have been + // restored to STATE_PARSEPOST or STATE_PARSEGET. If so the parse code will + // run but won't do anything. + { // use the structure defined on the top of this function to process - // the GET ans the POST - uint8_t found = 0; + // the GET and the POST // loop trough the table and identify the current state (pSocket->nState) for (i=0; i<=AUTO_PARSE_ELEMENTS ; i++) { // current table element is our current state? @@ -2472,18 +2465,77 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) nBytes--; pBuffer++; // signals a match found - found = 1; } } } - // if we tested all possibilities without find a match - // move to next character in buffer - if (!found) { - nBytes--; - pBuffer++; - } } +/* +// This is the old, less efficient parse code that was used to find the POST +// or GET phrases. The "parse_table" code above replaced this. + + if (pSocket->nState == STATE_CONNECTED) { + if (nBytes == 0) return; + if (*pBuffer == 'G') { + pSocket->nState = STATE_GET_G; + } + else if (*pBuffer == 'P') { + pSocket->nState = STATE_POST_P; + } + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_GET_G) { + if (nBytes == 0) return; + if (*pBuffer == 'E') pSocket->nState = STATE_GET_GE; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_GET_GE) { + if (nBytes == 0) return; + if (*pBuffer == 'T') pSocket->nState = STATE_GET_GET; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_GET_GET) { + if (nBytes == 0) return; + if (*pBuffer == ' ') pSocket->nState = STATE_GOTGET; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_POST_P) { + if (nBytes == 0) return; + if (*pBuffer == 'O') pSocket->nState = STATE_POST_PO; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_POST_PO) { + if (nBytes == 0) return; + if (*pBuffer == 'S') pSocket->nState = STATE_POST_POS; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_POST_POS) { + if (nBytes == 0) return; + if (*pBuffer == 'T') pSocket->nState = STATE_POST_POST; + nBytes--; + pBuffer++; + } + + if (pSocket->nState == STATE_POST_POST) { + if (nBytes == 0) return; + if (*pBuffer == ' ') pSocket->nState = STATE_GOTPOST; + nBytes--; + pBuffer++; + } +*/ + if (pSocket->nState == STATE_GOTPOST) { //Search for \r\n\r\n saved_nstate = STATE_GOTPOST; @@ -3075,7 +3127,7 @@ void HttpDCall(uint8_t* pBuffer, uint16_t nBytes, struct tHttpD* pSocket) break; // Exit parsing } } - } // end of "while(nBytes != 0)" loop + } // end of "while(1)" loop // If nParseLeft == 0 we should enter STATE_SENDHEADER204, but we // clean up the fragment tracking pointers first.