FACT++  1.0
bool setFeeProperty ( FeeProperty *  prop)

– NEW FEATURE V. 0.9.1 [Set FeeServer Properies in CE] (2007-08-17) – ///

Definition at line 4185 of file feeserver.c.

References createBenchmark(), createLogMessage(), and sprintf().

4185  {
4186  bool retVal = false;
4187  if (state != INITIALIZING) {
4188  createLogMessage(MSG_WARNING,
4189  "Trying to change a FeeProperty during wrong FeeServer state, ignoring ...",
4190  0);
4191 # ifdef __DEBUG
4192  printf("Trying to change a FeeProperty during wrong FeeServer state, ignoring ...\n");
4193  fflush(stdout);
4194 # endif
4195  return retVal;
4196  }
4197 
4198  if (prop == 0) {
4199 # ifdef __DEBUG
4200  printf("Received NULL pointer in setting FeeProperty, ignoring...\n");
4201  fflush(stdout);
4202 # endif
4203  // No log message: in "INITIALIZING" state are no DIM channels available
4204  return retVal;
4205  }
4206 
4207  switch (prop->flag) {
4208  case (PROPERTY_UPDATE_RATE):
4209  if (prop->uShortVal > 0) {
4210  updateRate = prop->uShortVal;
4211  retVal = true;
4212 # ifdef __DEBUG
4213  printf("FeeProperty changed: new update rate (%d).\n",
4214  updateRate);
4215  fflush(stdout);
4216 # endif
4217  } else {
4218 # ifdef __DEBUG
4219  printf("Received invalid value for setting update rate (%d), ignoring...\n",
4220  prop->uShortVal);
4221  fflush(stdout);
4222 # endif
4223  }
4224  break;
4225 
4226  case (PROPERTY_LOGWATCHDOG_TIMEOUT):
4227  if (prop->uIntVal > 0) {
4228  logWatchDogTimeout = prop->uIntVal;
4229  retVal = true;
4230 # ifdef __DEBUG
4231  printf("FeeProperty changed: new log watchdog timeout (%d).\n",
4233  fflush(stdout);
4234 # endif
4235  } else {
4236 # ifdef __DEBUG
4237  printf("Received invalid value for setting log watchdog timeout (%d), ignoring...\n",
4238  prop->uIntVal);
4239  fflush(stdout);
4240 # endif
4241  }
4242  break;
4243 
4244  case (PROPERTY_ISSUE_TIMEOUT):
4245  if (prop->uLongVal > 0) {
4246  issueTimeout = prop->uLongVal;
4247  retVal = true;
4248 # ifdef __DEBUG
4249  printf("FeeProperty changed: new issue timeout (%ld).\n",
4250  issueTimeout);
4251  fflush(stdout);
4252 # endif
4253  } else {
4254 # ifdef __DEBUG
4255  printf("Received invalid value for setting issue timeout (%ld), ignoring...\n",
4256  prop->uLongVal);
4257  fflush(stdout);
4258 # endif
4259  }
4260  break;
4261 
4262  case (PROPERTY_LOGLEVEL):
4263  if ((prop->uIntVal > 0) && (prop->uIntVal <= MSG_MAX_VAL)) {
4264  logLevel = prop->uIntVal | MSG_ALARM;
4265  retVal = true;
4266 # ifdef __DEBUG
4267  printf("FeeProperty changed: new log level (%d).\n", logLevel);
4268  fflush(stdout);
4269 # endif
4270  } else {
4271 # ifdef __DEBUG
4272  printf("Received invalid value for setting loglevel (%d), ignoring...\n",
4273  prop->uIntVal);
4274  fflush(stdout);
4275 # endif
4276  }
4277  break;
4278 
4279  default:
4280  // unknown property flag, but no logging
4281 # ifdef __DEBUG
4282  printf("Received unknown flag in setting FeeProperty (%d), ignoring...\n",
4283  prop->flag);
4284  fflush(stdout);
4285 # endif
4286  }
4287 
4288  return retVal;
4289 }
static unsigned short updateRate
Definition: feeserver.c:196
void createLogMessage(unsigned int type, char *description, char *origin)
Definition: feeserver.c:1530
static unsigned int logWatchDogTimeout
Definition: feeserver.c:133
static unsigned int logLevel
Definition: feeserver.c:211
static unsigned long issueTimeout
Definition: feeserver.c:203

+ Here is the call graph for this function: