Lab 4: Add HTTP Web Server to Visualize Data

Step 8: Add code to WIFI application task

The application is already developed and is available in the following files.

  • app_sensor.c, app_sensor.h
  • app_usb.c, app_usb.h
  • app_sdcard.c, app_sdcard.h
  • app_wifi.c, app_wifi.h
  • custom_http_net_app.c

They are available under <your unzipped folder path>\getting_started_pic32_wfi32e\Lab4\dev_files.

The application file contains the application logic. It also contains placeholders that you will populate with the necessary code.

1

Go to the <your unzipped folder path>\getting_started_pic32_wfi32e\Lab4\dev_files folder and copy the pre-developed files:

  • app_sensor.c
  • app_sensor.h
  • app_usb.c
  • app_usb.h
  • app_sdcard.c
  • app_sdcard.h
  • app_wifi.c
  • app_wifi.h
  • custom_http_net_app.c

Paste and replace (overwrite) the files of your project at <your harmony 3 project folder path>\PIC32_WFI32E\firmware\src with the copied files.

Tip: Search for the string "Step #" in target file to locate the position where you are supposed to write the code.

2

Open http_net_print.h.

Add #include "definitions.h" below the following code:

3

Open app_wifi.c and follow the steps below.

Search for Step #1.

  • Use the function SYS_STATUS TCPIP_STACK_Status( SYS_MODULE_OBJ object ) to get the current status of the TCP IP Stack.
    • Pass in argument the tcpip module object sysObj.tcpip.
  • When the TCP IP Stack status is equal to SYS_STATUS_READY:
    • Initialize the HTTPNET Server with a call to HTTP_APP_Initialize().
    • Move the application state machine to APP_WIFI_STATE_IDLE.



Next Step >

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.