/*** Beginheader */ #ifndef __AIT_NET_LIB #define __AIT_NET_LIB typedef unsigned char BYTE; /*** Endheader */ /* START LIBRARY DESCRIPTION ********************************************* AIT_GENERAL.LIB Copyright (c) 2003, Adaptive Internet Technologies DESCRIPTION: AIT General Network utilities SUPPORT LIBS: REVISION HISTORY: 1.1 12/04/03 Original Issue END DESCRIPTION **********************************************************/ //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// /*** BeginHeader AIT_EflushRx, AIT_htob, AIT_PrintTime */ /*** EndHeader */ /* START _FUNCTION DESCRIPTION ******************************************** AIT_EflushRx SYNTAX: cofunc int AIT_EflushRx(int Wait, int Show) DESCRIPTION: Waits for pending TX chars to send and then flushes all Response characters PARAMETER1: Period to wait (mS) for incoming charaters before aborting PARAMETER2: Flag to display Rx Characters. 1= Show, 0=NoShow RETURN VALUE: Total characters flushed from RX buffer SEE ALSO: END DESCRIPTION **********************************************************/ char * NET_BuildACSURL(char * User, char * Passwd, SENSOR * Devices) { strcpy(URL, "GET /go/acs_url?U="); strcat(URL, WEB_USER); strcat(URL, "&P="); strcat(URL, WEB_PASSWORD); // Build the time variables mktm(&Time, read_rtc()); sprintf(DateText, "%02d/%02d/%04d", Time.tm_mon,Time.tm_mday,Time.tm_year + 1900); sprintf(TimeText, "%02d:%02d:%02d", Time.tm_hour,Time.tm_min,Time.tm_sec); // Build Value List strcat(URL, "&V="); strcat(URL, DateText); strcat(URL, ","); strcat(URL, TimeText); strcat(URL, ","); for (D=0; D < SENSORS; D++) { Devices[D].Scaled = (Devices[D].Raw * DeviceData[D].Scale) + DeviceData[D].Offset ; sprintf(Work, "%.1f,", Devices[D].Scaled); strcat(URL, Work); tcp_tick(NULL); } // Build Signal List strcat(URL, "&S=Date,Time,"); for (D=0; D < SENSORS; D++) { strcat(URL, DeviceData[D].Name); strcat(URL, ","); } strcat(URL, " HTTP/1.0\r\n\r\n "); /*** BeginHeader */ #endif /*** EndHeader */