CCS News

Tech Note - TCP/IP Project Wizard: New HTTP Client!

Wednesday 24 September, 2014

The TCP/IP Project Wizard, within any of the CCS C-Aware IDE Compilers, now enable HTTP Client applications in a snap! Get your Internet ready project started quickly, in the Project Wizard, by using an Internet capable PIC® MCU and setting up the device as an HTTP Client. This frees the device to communicate with an HTTP Server over a Network or Internet.

Kickoff your TCP/IP project with just 3 simple steps: First, click over to the HTTP Client tab to specify the IP address or hostname of the server. Second, designate a URL, or file, for access with an additional custom header - if needed. Third, enable CGI format and a CGI key/value pair to send in the GET/POST request - if required. Setup is now complete! The Project Wizard will now generate a base code framework with helpful 'TODOs'. These 'TODOs' mark where specified tasks need to be handled in the project code. The TCP/IP stack, automatically included in the project, is tailored to the options you have chosen through this Project Wizard. It's that simple!

Sample Project Code:

while(TRUE)
{

... ... ... ...

if (0) // todo: specify action condition, like a button press
{
g_MyHttpSending = TRUE;
MyHttpSend();
}
else if (!HttpClientIsBusy() && g_MyHttpSending)
{
g_MyHttpSending = FALSE;

// todo: if you want to see the pass/fail of the request,
//       use HttpClientGetResult()

// todo: if you want to see the data read from the server,
//       look at the g_MyHttpResponse[] string
}

... ... ... ...

}




Like us on Facebook. Follow us on Twitter.

About CCS:

CCS is a leading worldwide supplier of embedded software development tools that enable companies to develop premium products based on Microchip PIC® MCU and dsPIC® DSC devices. Complete proven tool chains from CCS include a code optimizing C compiler, application specific hardware platforms and software development kits. CCS' products accelerate development of energy saving industrial automation, wireless and wired communication, automotive, medical device and consumer product applications. Established in 1992, CCS is a Microchip Premier 3rd Party Partner. For more information, please visit http://www.ccsinfo.com.

PIC® MCU, MPLAB® IDE, MPLAB® ICD2, MPLAB® ICD3 and dsPIC® are registered trademarks of Microchip Technology Inc. in the U.S. and other countries.