+ APP2_Initialize();
+
+
+ Remarks:
+ This routine must be called from the SYS_Initialize function.
+*/
+
+void APP2_Initialize ( void );
+
+
+/*******************************************************************************
+ Function:
+ void APP2_Tasks ( void )
+
+ Summary:
+ MPLAB Harmony Demo application tasks function
+
+ Description:
+ This routine is the Harmony Demo application's tasks function. It
+ defines the application's state machine and core logic.
+
+ Precondition:
+ The system and application initialization ("SYS_Initialize") should be
+ called before calling this.
+
+ Parameters:
+ None.
+
+ Returns:
+ None.
+
+ Example:
+
+ APP2_Tasks();
+
+
+ Remarks:
+ This routine must be called from SYS_Tasks() routine.
+ */
+
+void APP2_Tasks( void );
+
+
+#endif /* _APP2_H */
+
+//DOM-IGNORE-BEGIN
+#ifdef __cplusplus
+}
+#endif
+//DOM-IGNORE-END
+
+/*******************************************************************************
+ End of File
+ */
+
diff --git a/software/aws-iot-ethernet/firmware/src/app_insight_support.c b/software/aws-iot-ethernet/firmware/src/app_insight_support.c
new file mode 100644
index 0000000..2116175
--- /dev/null
+++ b/software/aws-iot-ethernet/firmware/src/app_insight_support.c
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ MPLAB Harmony Application Header File
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ app2.h
+
+ Summary:
+ This header file provides prototypes and definitions for the application.
+
+ Description:
+ This header file provides function prototypes and data type definitions for
+ the application. Some of these are required by the system (such as the
+ "APP_Initialize" and "APP_Tasks" prototypes) and some of them are only used
+ internally by the application (such as the "APP_STATES" definition). Both
+ are defined here for convenience.
+*******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+*******************************************************************************/
+//DOM-IGNORE-END
+
+/* ************************************************************************** */
+/* ************************************************************************** */
+/* Section: Included Files */
+/* ************************************************************************** */
+/* ************************************************************************** */
+#include "app_insight_support.h"
+#include "stdlib.h"
+#include "stdbool.h"
+#include "string.h"
+
+/* ************************************************************************** */
+/* ************************************************************************** */
+/* Section: File Scope or Global Data */
+/* ************************************************************************** */
+/* ************************************************************************** */
+
+/* ************************************************************************** */
+/* ************************************************************************** */
+// Section: Local Functions */
+/* ************************************************************************** */
+/* ************************************************************************** */
+
+/* ************************************************************************** */
+/* ************************************************************************** */
+// Section: Interface Functions */
+/* ************************************************************************** */
+/* ************************************************************************** */
+
+int APP_ParseCommand(char * pReadBuffer)
+{
+ if(pReadBuffer == NULL)
+ return COMMAND_BAD_POINTER;
+ JSON_Value *rootValue = json_parse_string(pReadBuffer);
+ if (json_value_get_type(rootValue) != JSONObject)
+ return COMMAND_BAD_JSON;
+ JSON_Object * tObject = json_value_get_object(rootValue);
+
+ if(json_object_dotget_string(tObject, "message.command") != NULL)
+ {
+ if(strcmp(json_object_dotget_string(tObject, "message.command"), "hello") == 0)
+ {
+ return COMMAND_HELLO;
+ }
+ else if (strcmp(json_object_dotget_string(tObject, "message.command"), "configuration") == 0)
+ {
+ return COMMAND_CONFIGURE;
+ }
+ else if (strcmp(json_object_dotget_string(tObject, "message.command"), "debug_set") == 0)
+ {
+ return COMMAND_DEBUG_SET;
+ }
+ else
+ {
+ return COMMAND_INVALID;
+ }
+ }
+ else
+ {
+ return COMMAND_INVALID;
+ }
+ return COMMAND_INVALID;
+}
+
+void BuildAckNackMessage(JSON_Object *rootObject, char * command, char * msg)
+{
+ json_object_dotset_string(rootObject, "message.command", command);
+ json_object_dotset_string(rootObject, "message.ack_nack_message", msg);
+}
+
+int APP_CheckForMessage(char * pMessage)
+{
+ if(pMessage == NULL)
+ return MESSAGE_BAD_POINTER;
+ if(strchr(pMessage, DELIMITER))
+ {
+ return MESSAGE_DELIMITER;
+ }
+ else
+ {
+ return MESSAGE_NO_DELIMITER;
+ }
+
+}
+
+void APP_BuildDebugString(char * messageBuffer, int sizeMessageBuffer, int command)
+{
+ if(messageBuffer == NULL)
+ return;
+
+
+}
+
+const char* APP_ReturnDebugCodeToString(int debugCommand)
+{
+ switch(debugCommand)
+ {
+ case DEBUG_UPDATE:
+ return "Debug update";
+ case DEBUG_NVM_WRITE_SUCCESS:
+ return "Configuration successfully written to NVM";
+ case DEBUG_NVM_WRITE_FAILED:
+ return "Configuration failed to write to NVM, reset and try again";
+ case DEBUG_NO_IP_ADDRESS:
+ return "Not getting an IP address, check connection";
+ case DEBUG_SOCKET_CHANGE:
+ return "Change socket state";
+ case DEBUG_MQTT_CHANGE:
+ return "Change mqtt state";
+ case DEBUG_GOT_IP_ADDRESS:
+ return "Got IP address";
+ case DEBUG_ERROR_CLOSING_SOCKET:
+ return "Error, closing socket and retrying";
+ case DEBUG_FATAL_ERROR:
+ return "Fatal Error, requires board reset";
+
+ }
+ return "Unknown debug command";
+}
+
+/* *****************************************************************************
+ End of File
+ */
diff --git a/software/aws-iot-ethernet/firmware/src/app_insight_support.h b/software/aws-iot-ethernet/firmware/src/app_insight_support.h
new file mode 100644
index 0000000..01763dd
--- /dev/null
+++ b/software/aws-iot-ethernet/firmware/src/app_insight_support.h
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ MPLAB Harmony Application Header File
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ app2.h
+
+ Summary:
+ This header file provides prototypes and definitions for the application.
+
+ Description:
+ This header file provides function prototypes and data type definitions for
+ the application. Some of these are required by the system (such as the
+ "APP_Initialize" and "APP_Tasks" prototypes) and some of them are only used
+ internally by the application (such as the "APP_STATES" definition). Both
+ are defined here for convenience.
+*******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+//DOM-IGNORE-END
+
+#include "parson.h"
+
+#ifndef _APP_INSIGHT_SUPPORT_H /* Guard against multiple inclusion */
+#define _APP_INSIGHT_SUPPORT_H
+
+#define DELIMITER '\r'
+
+enum ErrorCodes
+{
+ MESSAGE_DELIMITER,
+ MESSAGE_NO_DELIMITER,
+ MESSAGE_BAD_POINTER
+};
+
+enum CommandCodes
+{
+ COMMAND_BAD_POINTER,
+ COMMAND_BAD_JSON,
+ COMMAND_INVALID,
+ COMMAND_HELLO,
+ COMMAND_CONFIGURE,
+ COMMAND_WIFI_CONFIGURE,
+ COMMAND_DEBUG_MSG,
+ COMMAND_DISCOVERY,
+ COMMAND_ACK,
+ COMMAND_NACK,
+ COMMAND_DEBUG_SET
+};
+
+enum DebugCodes
+{
+ DEBUG_UPDATE,
+ DEBUG_NVM_WRITE_FAILED,
+ DEBUG_NVM_WRITE_SUCCESS,
+ DEBUG_NO_IP_ADDRESS,
+ DEBUG_SOCKET_CHANGE,
+ DEBUG_MQTT_CHANGE,
+ DEBUG_GOT_IP_ADDRESS,
+ DEBUG_ERROR_CLOSING_SOCKET,
+ DEBUG_FATAL_ERROR
+};
+
+int APP_ParseCommand(char * pReadBuffer);
+int APP_CheckForMessage(char * pMessage);
+void BuildAckNackMessage(JSON_Object *rootObject, char * command, char * msg);
+const char* APP_ReturnDebugCodeToString(int return_code);
+
+#endif /* _APP_INSIGHT_SUPPORT_H */
+
+/* *****************************************************************************
+ End of File
+ */
diff --git a/software/aws-iot-ethernet/firmware/src/app_nvm_support.c b/software/aws-iot-ethernet/firmware/src/app_nvm_support.c
index 61924f6..984fe05 100644
--- a/software/aws-iot-ethernet/firmware/src/app_nvm_support.c
+++ b/software/aws-iot-ethernet/firmware/src/app_nvm_support.c
@@ -47,113 +47,47 @@ extern APP_DATA appData;
bool APP_NVM_Erase(uint32_t nvm_dest_address)
{
int tmp;
-
- appData.nvmHandle = DRV_NVM_Open(0, DRV_IO_INTENT_READWRITE);
- if(DRV_HANDLE_INVALID == appData.nvmHandle)
- {
- return false;
- }
-
- appData.gAppNVMMediaGeometry = DRV_NVM_GeometryGet(appData.nvmHandle);
- if(NULL ==appData. gAppNVMMediaGeometry)
- {
- return false;
- }
-
tmp = nvm_dest_address * (appData.gAppNVMMediaGeometry->geometryTable[2].numBlocks) / (DRV_NVM_MEDIA_SIZE * 1024);
- DRV_NVM_Erase(appData.nvmHandle, &appData.nvmCommandHandle, tmp, 1);
+ DRV_NVM_Erase(appData.nvmHandle, &appData.nvmCommandHandle[0], tmp, 1);
if(appData.nvmCommandHandle == DRV_NVM_COMMAND_HANDLE_INVALID)
{
return false;
}
- while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle))
+ while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle[0]))
{
;
}
- DRV_NVM_Close(appData.nvmHandle);
return true;
}
bool APP_NVM_Write(uint32_t nvm_dest_address, uint8_t * data)
{
- int i, tmp;
- uint8_t NVM_DATA_READ_BUFF_local[DRV_NVM_ROW_SIZE];
- uint8_t NVM_DATA_BUFF_local[DRV_NVM_ROW_SIZE];
-
- for (i = 0; i < DRV_NVM_ROW_SIZE; i++)
- NVM_DATA_BUFF_local[i] = data[i];
-
- appData.nvmHandle = DRV_NVM_Open(0, DRV_IO_INTENT_READWRITE);
- if(DRV_HANDLE_INVALID == appData.nvmHandle){
- return false;
- }
-
- appData.gAppNVMMediaGeometry = DRV_NVM_GeometryGet(appData.nvmHandle);
- if(NULL == appData. gAppNVMMediaGeometry){
- return false;
- }
-
- DRV_NVM_Read (appData.nvmHandle, &appData.nvmCommandHandle, NVM_DATA_READ_BUFF_local, nvm_dest_address, DRV_NVM_ROW_SIZE);
- if (DRV_NVM_COMMAND_HANDLE_INVALID == appData.nvmCommandHandle) {
- return false;;
- }
-
- tmp = nvm_dest_address * (appData.gAppNVMMediaGeometry->geometryTable[2].numBlocks) / (DRV_NVM_MEDIA_SIZE * 1024);
- DRV_NVM_Erase(appData.nvmHandle, &appData.nvmCommandHandle, tmp, 1);
- if(appData.nvmCommandHandle == DRV_NVM_COMMAND_HANDLE_INVALID){
- return false;
- }
-
-
- while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle))
- {
- ;
- }
-
+ int tmp;
tmp = nvm_dest_address * (appData.gAppNVMMediaGeometry->geometryTable[1].numBlocks) / (DRV_NVM_MEDIA_SIZE * 1024);
- DRV_NVM_Write(appData.nvmHandle, &appData.nvmCommandHandle, (uint8_t *)NVM_DATA_BUFF_local, tmp, 1);
- if(DRV_NVM_COMMAND_HANDLE_INVALID == appData.nvmCommandHandle)
+ DRV_NVM_EraseWrite(appData.nvmHandle, &appData.nvmCommandHandle[0], (uint8_t *)data, tmp, 1);
+ if(DRV_NVM_COMMAND_HANDLE_INVALID == appData.nvmCommandHandle[0])
{
return false;
}
- while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle))
- {
- ;
- }
- DRV_NVM_Close(appData.nvmHandle);
return true;
}
bool APP_NVM_Read(uint32_t nvm_dest_address, uint8_t * buffer, uint32_t bufferLength)
{
- appData.nvmHandle = DRV_NVM_Open(0, DRV_IO_INTENT_READWRITE);
- if(DRV_HANDLE_INVALID == appData.nvmHandle)
- {
- return false;
- }
-
- appData.gAppNVMMediaGeometry = DRV_NVM_GeometryGet(appData.nvmHandle);
- if(NULL == appData.gAppNVMMediaGeometry)
- {
- return false;
- }
-
- DRV_NVM_Read(appData.nvmHandle, &appData.nvmCommandHandle, buffer, nvm_dest_address, bufferLength);
- if(DRV_NVM_COMMAND_HANDLE_INVALID == appData.nvmCommandHandle)
+ DRV_NVM_Read(appData.nvmHandle, &appData.nvmCommandHandle[0], buffer, nvm_dest_address, bufferLength);
+ if(DRV_NVM_COMMAND_HANDLE_INVALID == appData.nvmCommandHandle[0])
{
return false;
}
- while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle))
+ while(DRV_NVM_COMMAND_COMPLETED != DRV_NVM_CommandStatus(appData.nvmHandle, appData.nvmCommandHandle[0]))
{
;
}
- DRV_NVM_Close(appData.nvmHandle);
return true;
-
-}
\ No newline at end of file
+}
diff --git a/software/aws-iot-ethernet/firmware/src/ca-certs.h b/software/aws-iot-ethernet/firmware/src/ca-certs.h
index 99dfd97..c7d4b21 100644
--- a/software/aws-iot-ethernet/firmware/src/ca-certs.h
+++ b/software/aws-iot-ethernet/firmware/src/ca-certs.h
@@ -4,6 +4,7 @@
#define CERTS_H
#ifdef USE_CERT_BUFFERS_2048
+
/* ./rootCA.der, 2048-bit */
static const unsigned char caCert[] =
{
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_http.c b/software/aws-iot-ethernet/firmware/src/configuration_http.c
deleted file mode 100644
index 60d917f..0000000
--- a/software/aws-iot-ethernet/firmware/src/configuration_http.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- Application to Demo HTTP Server
-
- Summary:
- Support for HTTP module in Microchip TCP/IP Stack
-
- Description:
- -Implements the application
- -Reference: RFC 1002
-*******************************************************************************/
-
-/*******************************************************************************
-File Name: configuration_http.c
-Copyright (C) 2012 released Microchip Technology Inc. All rights
-reserved.
-
-Microchip licenses to you the right to use, modify, copy and distribute
-Software only when embedded on a Microchip microcontroller or digital signal
-controller that is integrated into your product or third party product
-(pursuant to the sublicense terms in the accompanying license agreement).
-
-You should refer to the license agreement accompanying this Software for
-additional information regarding your rights and obligations.
-
-SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
-EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
-MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
-IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
-CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
-OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
-INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
-CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
-SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
-(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
-*******************************************************************************/
-
-#define __CUSTOMHTTPAPP_C
-
-#include "system_config.h"
-
-#if defined(TCPIP_STACK_USE_HTTP_SERVER)
-
-#include "tcpip/tcpip.h"
-#include "system/tmr/sys_tmr.h"
-#include "system/random/sys_random.h"
-#include "tcpip/src/common/helpers.h"
-#include "tcpip/src/tcpip_private.h"
-
-#include "app.h"
-#include "app_nvm_support.h"
-
-
-/****************************************************************************
- Section:
- Definitions
- ***************************************************************************/
-extern APP_DATA appData;
-
-/****************************************************************************
- Section:
- Function Prototypes and Memory Globalizers
- ***************************************************************************/
-static HTTP_IO_RESULT HTTPPostConfig(HTTP_CONN_HANDLE connHandle);
-
-// Sticky status message variable.
-// This is used to indicated whether or not the previous POST operation was
-// successful. The application uses these to store status messages when a
-// POST operation redirects. This lets the application provide status messages
-// after a redirect, when connection instance data has already been lost.
-//static bool lastSuccess = false;
-
-// Stick status message variable. See lastSuccess for details.
-static bool lastFailure = false;
-
-/****************************************************************************
- Section:
- GET Form Handlers
- ***************************************************************************/
-
-/*****************************************************************************
- Function:
- HTTP_IO_RESULT TCPIP_HTTP_GetExecute(HTTP_CONN_HANDLE connHandle)
-
- Internal:
- See documentation in the TCP/IP Stack API or HTTP.h for details.
- ***************************************************************************/
-HTTP_IO_RESULT TCPIP_HTTP_GetExecute(HTTP_CONN_HANDLE connHandle)
-{
- uint8_t filename[20];
- //uint8_t* httpDataBuff;
-
- // Load the file name
- // Make sure uint8_t filename[] above is large enough for your longest name
- SYS_FS_FileNameGet(TCPIP_HTTP_CurrentConnectionFileGet(connHandle), filename, 20);
-
-TCPIP_HTTP_CurrentConnectionDataBufferGet(connHandle);
-
- // Example of how to process a GET request call
- // If its the forms.htm page
-// if(!memcmp(filename, "forms.htm", 9))
-// {
-//
-// }
- return HTTP_IO_DONE;
-}
-
-/****************************************************************************
- Section:
- POST Form Handlers
- ***************************************************************************/
-#if defined(TCPIP_HTTP_USE_POST)
-
-/*****************************************************************************
- Function:
- HTTP_IO_RESULT TCPIP_HTTP_PostExecute(HTTP_CONN_HANDLE connHandle)
-
- Internal:
- See documentation in the TCP/IP Stack API or HTTP.h for details.
- ***************************************************************************/
-HTTP_IO_RESULT TCPIP_HTTP_PostExecute(HTTP_CONN_HANDLE connHandle)
-{
- // Resolve which function to use and pass along
- uint8_t filename[20];
-
- // Load the file name
- // Make sure uint8_t filename[] above is large enough for your longest name
- SYS_FS_FileNameGet(TCPIP_HTTP_CurrentConnectionFileGet(connHandle), filename, sizeof(filename));
-
- if(!memcmp(filename, "index.htm", 9))
- return HTTPPostConfig(connHandle) /*HTTPPostConfig()*/;
-
-
- return HTTP_IO_DONE;
-}
-
-
-/*****************************************************************************
- Function:
- static HTTP_IO_RESULT HTTPPostConfig(HTTP_CONN_HANDLE connHandle)
-
- Summary:
- Processes the configuration form on index.htm
-
- Description:
- Accepts configuration parameters from the form, saves them to a
- temporary location in RAM, then eventually saves the data to EEPROM or
- external Flash.
-
- When complete, this function redirects to reconnect.htm, which will
- display information on the board connecting to the amazon server.
-
- If an error occurs, error.htm will be seen.
-
- Precondition:
- None
-
- Parameters:
- connHandle - HTTP connection handle
-
- Return Values:
- HTTP_IO_DONE - all parameters have been processed
- HTTP_IO_NEED_DATA - data needed by this function has not yet arrived
- ***************************************************************************/
-
-static HTTP_IO_RESULT HTTPPostConfig(HTTP_CONN_HANDLE connHandle)
-{
- uint8_t i;
-
- uint8_t* httpDataBuff = 0;
- bool bConfigFailure = false;
- uint32_t byteCount;
- TCP_SOCKET sktHTTP;
-
- byteCount = TCPIP_HTTP_CurrentConnectionByteCountGet(connHandle);
- sktHTTP = TCPIP_HTTP_CurrentConnectionSocketGet(connHandle);
- if(byteCount > TCPIP_TCP_GetIsReady(sktHTTP) + TCPIP_TCP_FifoRxFreeGet(sktHTTP))
- { // Configuration Failure
- lastFailure = true;
- TCPIP_HTTP_CurrentConnectionStatusSet(connHandle, HTTP_REDIRECT);
- return HTTP_IO_DONE;
- }
-
- // Ensure that all data is waiting to be parsed. If not, keep waiting for
- // all of it to arrive.
- if(TCPIP_TCP_GetIsReady(sktHTTP) < byteCount)
- return HTTP_IO_NEED_DATA;
-
- // Use current config in non-volatile memory as defaults
- httpDataBuff = TCPIP_HTTP_CurrentConnectionDataBufferGet(connHandle);
-
- // Read all browser POST data
- while(TCPIP_HTTP_CurrentConnectionByteCountGet(connHandle))
- {
- // Read a form field name
- if(TCPIP_HTTP_PostNameRead(connHandle, httpDataBuff, 6) != HTTP_READ_OK)
- {
- bConfigFailure = true;
- break;
- }
-
- // Read a form field value
- if(TCPIP_HTTP_PostValueRead(connHandle, httpDataBuff + 6, TCPIP_HTTP_MAX_DATA_LEN-6-2) != HTTP_READ_OK)
- {
- bConfigFailure = true;
- break;
- }
-
- // Parse the value that was read
- if(!strcmp((char*)httpDataBuff, (const char*)"rs"))
- {
- memcpy((uint8_t *)appData.host, (void*)(httpDataBuff+6), strlen((char*)(httpDataBuff+6)));
- appData.host[strlen((char*)(httpDataBuff+6))] = 0; /* Terminate string */
- }
- else if(!strcmp((char*)httpDataBuff, (const char*)"cc"))
- {
- memcpy((uint8_t *)appData.clientCert, (void*)(httpDataBuff+6), strlen((char*)(httpDataBuff+6)));
- appData.clientCert[strlen((char*)(httpDataBuff+6))] = 0; /* Terminate string */
- }
- else if(!strcmp((char*)httpDataBuff, (const char*)"ck"))
- {
- memcpy((uint8_t *)appData.clientKey, (void*)(httpDataBuff+6), strlen((char*)(httpDataBuff+6)));
- appData.clientKey[strlen((char*)(httpDataBuff+6))] = 0; /* Terminate string */
- }
-
- }
-
- if(bConfigFailure == false)
- {
- // All parsing complete! Save new settings and force an interface restart
- // Set the interface to restart and display reconnecting information
- strcpy((char*)httpDataBuff, "reconnect.htm?");
- httpDataBuff[20+16] = 0x00; // Force null termination
- for(i = 20; i < 20u+16u; i++)
- {
- if(httpDataBuff[i] == ' ')
- httpDataBuff[i] = 0x00;
- }
-
- }
- else
- { // Configuration error
-
- lastFailure = true;
- if(httpDataBuff)
- {
- strcpy((char*)httpDataBuff, "error.htm");
- }
- }
-
- TCPIP_HTTP_CurrentConnectionStatusSet(connHandle, HTTP_REDIRECT);
-
- return HTTP_IO_DONE;
-}
-
-#endif
-
-
-/****************************************************************************
- Section:
- Dynamic Variable Callback Functions
- ***************************************************************************/
-/****************************************************************************
- Section:
- Dynamic Variable Callback Functions
- ***************************************************************************/
-
-/*****************************************************************************
- Function:
- void TCPIP_HTTP_Print_varname(void)
-
- Internal:
- See documentation in the TCP/IP Stack API or HTTP.h for details.
- ***************************************************************************/
-void TCPIP_HTTP_Print_remoteServer(HTTP_CONN_HANDLE connHandle)
-{
- TCP_SOCKET sktHTTP;
- sktHTTP = TCPIP_HTTP_CurrentConnectionSocketGet(connHandle);
- TCPIP_TCP_StringPut(sktHTTP, (const uint8_t*)appData.host);
-}
-
-void TCPIP_HTTP_Print_uuid(HTTP_CONN_HANDLE connHandle)
-{
- TCP_SOCKET sktHTTP;
- sktHTTP = TCPIP_HTTP_CurrentConnectionSocketGet(connHandle);
- TCPIP_TCP_StringPut(sktHTTP, (const uint8_t*)appData.uuid); //nextSSID
-}
-
-
-#endif
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/DynRcrd.bin b/software/aws-iot-ethernet/firmware/src/configuration_webpage/DynRcrd.bin
deleted file mode 100644
index b797d3f..0000000
Binary files a/software/aws-iot-ethernet/firmware/src/configuration_webpage/DynRcrd.bin and /dev/null differ
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/FileRcrd.bin b/software/aws-iot-ethernet/firmware/src/configuration_webpage/FileRcrd.bin
deleted file mode 100644
index 88bf41c..0000000
Binary files a/software/aws-iot-ethernet/firmware/src/configuration_webpage/FileRcrd.bin and /dev/null differ
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp-min.css b/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp-min.css
deleted file mode 100644
index 3fa1657..0000000
--- a/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp-min.css
+++ /dev/null
@@ -1 +0,0 @@
-body{font-family:Verdana,Arial,sans-serif;margin:0 auto;padding:0 0 20px;width:700px}#page{background:#fff;padding:20px;font-size:12pt}#page td{font-size:10pt}#title{padding:4px;font-weight:700;color:#000;margin-bottom:15px;height:16px}#title .left{float:left;text-align:left}#footer{height:16px;padding-top:3px;padding-left:5px;padding-right:5px;color:#888;font-size:.75em}#menu{float:left;width:150px;padding-right:20px}#content{width:660px}#content a{color:#c00;text-decoration:none}#content a:hover{color:#d33;text-decoration:underline}#content h1{margin-top:0}fieldset{margin:10px 40px;padding:8px;border:1px dotted #333;background:#ddd}fieldset div{padding:2px 0 2px 150px}fieldset div label{margin-left:-140px;padding-top:2px;width:135px;font-weight:700;position:absolute}fieldset input{width:250px}fieldset input.sm{width:auto}fieldset textarea{width:250px}.rounded_container{display:block;position:relative;border-width:2px;border-style:solid;border-color:#000;border-radius:15px;margin:2px;font-size:12pt;-webkit-transition:height .5s;padding:10px 10px 5px}#column_wrap{float:left;width:100%}#column1{padding:10px;margin-left:30px;float:left}#column2{padding:10px;float:right;width:45%}.join_button{text-indent:0;font-family:Arial;font-style:normal;text-align:center;margin-left:280px;margin-bottom:5px}.join_button:active{position:relative;top:1px}.ssid1{width:213px}.sec1{width:222px}
\ No newline at end of file
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp.css b/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp.css
deleted file mode 100644
index ccfb842..0000000
--- a/software/aws-iot-ethernet/firmware/src/configuration_webpage/css/mchp.css
+++ /dev/null
@@ -1,146 +0,0 @@
-body {
- font-family: Verdana, Arial, sans-serif;
- margin: 0px auto;
- padding: 0 0 20px 0;
- width: 700px;
-}
-
-#page {
- background: #fff;
- padding: 20px;
- font-size: 12pt;
-}
-
-#page td {
- font-size: 10pt;
-}
-
-#title {
- padding: 4px;
- font-weight: bold;
- color: #000;
- margin-bottom: 15px;
- height: 16px;
-}
-
-#title .left {
- float: left;
- text-align: left;
-}
-
-#footer{
- height: 16px; /* Total hight is 20 less border and padding*/
- padding-top: 3px;
- padding-left: 5px;
- padding-right: 5px;
- color: #888888;
- font-size: 0.750em;
-}
-#menu {
- float: left;
- width: 150px;
- padding-right: 20px;
-}
-
-#content {
- width: 660px;
-}
-
-#content a {
- color: #c00;
- text-decoration: none;
-}
-
-#content a:hover {
- color: #d33;
- text-decoration: underline;
-}
-
-#content h1 {
- margin-top: 0px;
-}
-
-fieldset {
- margin:10px 40px 10px 40px;
- padding: 8px;
- border: 1px dotted #333;
- background:#ddd;
-}
-
-fieldset div {
- padding: 2px 0px 2px 150px;
-}
-
-fieldset div label {
- margin-left: -140px;
- padding-top: 2px;
- width: 135px;
- font-weight: bold;
- position: absolute;
-}
-
-fieldset input {
- width: 250px;
-}
-
-fieldset input.sm {
- width: auto;
-}
-
-fieldset textarea {
- width: 250px;
-}
-
-.rounded_container{
- /*height: 180px;*/
- display: block;
- position: relative;
- border-width: 2px;
- border-style: solid;
- border-color: #000;
- border-radius: 15px;
- margin: 2px;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 10px;
- padding-bottom: 5px;
- font-size: 12pt;
- -webkit-transition: height .5s;
-}
-
-#column_wrap{
- float: left;
- width: 100%;
-}
-#column1{
- padding: 10px;
- margin-left: 30px;
- float: left;
-}
-#column2{
- padding: 10px;
- float: right;
- width: 45%;
-}
-
-.join_button {
- text-indent:0;
- font-family:Arial;
- font-style:normal;
- text-align:center;
- margin-left: 280px;
- margin-bottom: 5px;
-}
-
-.join_button:active {
- position:relative;
- top:1px;
-}
-
-.ssid1 {
- width: 213px;
-}
-
-.sec1 {
- width: 222px;
-}
\ No newline at end of file
diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/error.htm b/software/aws-iot-ethernet/firmware/src/configuration_webpage/error.htm
deleted file mode 100644
index 2c11f41..0000000
--- a/software/aws-iot-ethernet/firmware/src/configuration_webpage/error.htm
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- - Future home of Mchp error notification. -
- - \ No newline at end of file diff --git a/software/aws-iot-ethernet/firmware/src/configuration_webpage/footer.inc b/software/aws-iot-ethernet/firmware/src/configuration_webpage/footer.inc deleted file mode 100644 index 016fac4..0000000 --- a/software/aws-iot-ethernet/firmware/src/configuration_webpage/footer.inc +++ /dev/null @@ -1,4 +0,0 @@ - - -