char *_hscan(int client, const char *reqStr, const char *msg, const char *inputstr) { char *qpath = getQueryPath(reqStr); char *qparam = getQueryParam(reqStr, "q"); FDPRINTF(client, OTAGA(form, action = "%s") "%s%s" STAG(input, type = "submit") CTAG(form), qpath, msg, inputstr); free(qpath); return qparam; }
void gzw_sendHeadersFromString(gzwRequest gzwr,const char *headerString) { int client=gzwr.request.client; if (gzwr.gzenabled) { FDPRINTF(client, "Content-Encoding: %s\r\n", ENCODING_GZIP,0); } FDPRINTF(client, "%s", headerString,0); STATIC_SEND(client, "\r\n", 0); }
void sendHeadersTypeEncoding(Request request,const char *type, const char * encoding) { int client=request.client; STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0); STATIC_SEND(client, SERVER_STRING, 0); FDPRINTF(client, "Content-Type: %s\r\n", type,0); if (encoding!=NULL) { FDPRINTF(client, "Content-Encoding: %s\r\n", encoding,0); } STATIC_SEND(client, "\r\n", 0); }
void gzw_sendHeadersType(gzwRequest gzwr,const char *type) { int client=gzwr.request.client; STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0); STATIC_SEND(client, SERVER_STRING, 0); FDPRINTF(client, "Content-Type: %s\r\n", type,0); if (gzwr.gzenabled) { FDPRINTF(client, "Content-Encoding: %s\r\n", ENCODING_GZIP,0); } STATIC_SEND(client, "Vary: Accept-Encoding\r\n", 0); STATIC_SEND(client, "\r\n", 0); }
void SetupOSD() { //put in startup screen string FDPRINTF(TTY,"\033X"); PrintOSD(); FDPRINTF(TTY,"\033\\"); //set boot script and flash FDPRINTF(TTY,"\033[8v"); FDPRINTF(TTY,"\033[1v"); }
void PrintOSD() { //Clear Screen FDPRINTF(TTY,"\033[2J"); //Set Aurora Splash Screen FDPRINTF(TTY,"\033[0z"); FDPRINTF(TTY,"\033[5;7H"); FDPRINTF(TTY,"AURORA FLIGHT SCIENCES\r\n"); FDPRINTF(TTY,"\033[6z"); FDPRINTF(TTY," Skate UAS"); FDPRINTF(TTY,"\033[0z"); FDPRINTF(TTY,"\033[10,0H"); FDPRINTF(TTY," Waiting for GCS connection"); //Wait 1 second or until keypress FDPRINTF(TTY,"\033[1;2|"); }
/* Serve downloadable file. */ void serveDownloadableFile(int client, const char *filename, const char *displayFilename, const char * type) { FILE *resource = NULL; STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0); STATIC_SEND(client, SERVER_STRING, 0); FDPRINTF(client, "Content-Type: %s\r\n",type); FDPRINTF(client, "Content-Disposition: attachment; filename=\"%s\"\r\n",displayFilename); STATIC_SEND(client, "\r\n", 0); resource = fopen(filename, "r"); if (resource == NULL) { not_found(client); } else { cat(client, resource); } fclose(resource); }
char *_hscanIfEmpty(int client, const char *reqStr, const char *msg, const char *inputstr) { char *qpath = getQueryPath(reqStr); char *qparam = getQueryParam(reqStr, "q"); if (strcmp(qparam, UNDEFINED) == 0) { FDPRINTF(client, OTAGA(form, action = "%s") "%s%s" STAG(input, type = "submit") CTAG(form), qpath, msg, inputstr); } free(qpath); return qparam; }
/* Serve and entire file. */ void serveFile(int client, const char *filename, const char * type) { FILE *resource = NULL; FDPRINT(client, "HTTP/1.0 200 OK\r\n"); FDPRINT(client, SERVER_STRING); FDPRINTF(client, "Content-Type: %s\r\n",type); FDPRINT(client, "\r\n"); resource = fopen(filename, "r"); if (resource == NULL) { not_found(client); } else { cat(client, resource); } fclose(resource); }
void sendHeadersFromString(Request request, const char *headerString) { int client = request.client; FDPRINTF(client, "%s", headerString, 0); STATIC_SEND(client, "\r\n", 0); }