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.