Beispiel #1
0
// "period" command
dn_error_t spiNetApp_cli_period(char const* buf, INT32U len) {
   int        sarg;
   int        l;
   
   //--- param 0: period
   l = sscanf (buf, "%d", &sarg);
   if (l < 1) {
      return DN_ERR_INVALID;
   }
   else {
      spiNetApp_vars.period = (INT16U)sarg;
   }
   
   // sync configuration to file
   syncToConfigFile();
   
   return DN_ERR_NONE;
}
Beispiel #2
0
// "period" command
dn_error_t spiNetApp_cli_period(INT8U* buf, INT32U len, INT8U offset) {
   char*      token;
   int        sarg;
   
   buf += offset;
   
   //--- param 0: period
   token = dnm_cli_getNextToken(&buf, ' ');
   if (token == NULL) {
      return DN_ERR_INVALID;
   } else {
      sscanf (token, "%d", &sarg);
      spiNetApp_vars.period = (INT16U)sarg;
   }
   
   // sync configuration to file
   syncToConfigFile();
   
   return DN_ERR_NONE;
}