From 1cd243f1f449960bbecdfa54d7c92ce99a19a0cb Mon Sep 17 00:00:00 2001 From: Mark Lesha Date: Tue, 19 Feb 2008 14:19:26 +1100 Subject: [PATCH] Added uploading of server parameters srv_xxx in order to allow SICS to control various server features and access/release its control and configuration features. r2362 | mle | 2008-02-19 14:19:26 +1100 (Tue, 19 Feb 2008) | 2 lines --- site_ansto/anstohttp.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/site_ansto/anstohttp.c b/site_ansto/anstohttp.c index c8d57b71..bad01df4 100644 --- a/site_ansto/anstohttp.c +++ b/site_ansto/anstohttp.c @@ -35,6 +35,8 @@ static char statusdaq[] = {"/admin/textstatus.egi"}; static char gethm[] = {"/admin/readhmdata.egi"}; static char configure[] = {"/admin/configure.egi"}; static char preset[] = {"/admin/presethm.egi"}; +static char dynamicsrvmodify[] = {"/admin/selectdynamicsrvmodify.egi?dynamicSRVmodifyparamname=%s&dynamicSRVmodifyparamvalue=%s"}; +static char dynamicfatmodify[] = {"/admin/selectdynamicfatmodify.egi?dynamicFATmodifyparamname=%s&dynamicFATmodifyparamvalue=%s"}; /*==================================================================== error codes ======================================================================*/ @@ -293,18 +295,19 @@ static int AnstoHttpConfigure(pHistDriver self, SConnection *pCon, pItem=StringDictGetNext(pOpt,pValue,256); if (pItem) { + // Make special http request to set the SRV or FAT parameter + char modify_http_request[1024]=""; + if (strncasecmp(pItem,"SRV_",4)==0) + sprintf(modify_http_request,dynamicsrvmodify,pItem+4,pValue); if (strncasecmp(pItem,"FAT_",4)==0) + sprintf(modify_http_request,dynamicfatmodify,pItem+4,pValue); + // Try committing the setting to the histogram server + if (*modify_http_request) { - // Try committing the setting to the histogram server - // Make special http request to set the FAT parameter - char modify_FAT_http_request[1024]; - sprintf(modify_FAT_http_request, - "/admin/selectdynamicfatmodify.egi?dynamicFATmodifyparamname=%s&dynamicFATmodifyparamvalue=%s", - pItem+4,pValue); - // Send the request. When one doesn't work, drop out of the loop. - int status = anstoHttpGet(pPriv,modify_FAT_http_request); - if(status != 1) - return 0; + // Send the request. When one doesn't work, drop out of the loop. + int status = anstoHttpGet(pPriv,modify_http_request); + if(status != 1) + return 0; } } } while(pItem);