uint8 process_keyvalue(){ if(keylen==17){ if(!matches(key, STR_SCHEDULING_ENABLE, keylen)) return 1; process_scheduling_enable(); }else if(keylen==16){ if(!matches(key, STR_CHANNEL_x_ENABLE, keylen)) return 1; process_channel_enable(key[8]-48 - 1); }else if(keylen==14){ if(matches(key, STR_CHANNEL_x_NAME, keylen)){ if(valuelen==0) return 2; process_channel_name(key[8]-48 - 1); }else if(matches(key, STR_CHANNEL_x_GAIN, keylen)){ if(valuelen==0) return 2; process_channel_gain(key[8]-48 - 1); }else if(matches(key, STR_ACCEL_X_ENABLE, keylen)){ process_accel_enable(0); }else if(matches(key, STR_ACCEL_Y_ENABLE, keylen)){ process_accel_enable(1); }else if(matches(key, STR_ACCEL_Z_ENABLE, keylen)){ process_accel_enable(2); }else{ return 1; } }else if(keylen==12){ if(!matches(key, STR_SAMPLE_DELAY, keylen)) return 1; if(valuelen==0) return 2; process_sample_delay(); }else if(keylen==11){ if(!matches(key, STR_FILE_FORMAT, keylen)) return 1; if(valuelen==0) return 2; process_file_format(); }else if(keylen==10){ if(!matches(key, STR_START_TIME, keylen)) return 1; if(valuelen==0) return 2; process_start_time(); }else if(keylen==8){ if(!matches(key, STR_END_TIME, keylen)) return 1; if(valuelen==0) return 2; process_end_time(); }else{ return 1; } return 0; }
void process_keyvalue(){ if(keylen==17){ if(!matches(key, STR_SCHEDULING_ENABLE, keylen)) return; process_scheduling_enable(); }else if(keylen==16){ if(!matches(key, STR_CHANNEL_x_ENABLE, keylen)) return; process_channel_enable(key[8]-48 - 1); }else if(keylen==14){ if(!matches(key, STR_CHANNEL_x_NAME, keylen) || valuelen==0) return; process_channel_name(key[8]-48 - 1); }else if(keylen==12){ if(!matches(key, STR_SAMPLE_DELAY, keylen) || valuelen==0) return; process_sample_delay(); }else if(keylen==11){ if(!matches(key, STR_FILE_FORMAT, keylen) || valuelen==0) return; process_file_format(); }else if(keylen==10){ if(!matches(key, STR_START_TIME, keylen) || valuelen==0) return; process_start_time(); }else if(keylen==8){ if(!matches(key, STR_END_TIME, keylen) || valuelen==0) return; process_end_time(); } }