change supportedrates config setting to the actual MBit value

supportedrates is now a list instead on an array and float values
(e.g. 5.5) are permited.
This commit is contained in:
Andreas Schultz 2016-03-03 08:59:49 +01:00
parent 8dc30ae3c4
commit d68bc01d00
2 changed files with 17 additions and 4 deletions

View File

@ -106,9 +106,9 @@ application: {
numberchannels = 11;
maxtxpower = 100;
};
supportedrates = [
12, 18, 24, 36, 48, 72, 96, 108
];
supportedrates = (
6, 9, 12, 18, 24, 36, 48, 54
);
txpower = {
current = 100;
supported = [ 100 ];

View File

@ -364,7 +364,20 @@ static int wtp_parsing_radio_configuration(config_setting_t* configElement, stru
if ((count >= CAPWAP_SUPPORTEDRATES_MINLENGTH) && (count <= CAPWAP_SUPPORTEDRATES_MAXLENGTH)) {
radio->supportedrates.supportedratescount = (uint8_t)count;
for (i = 0; i < count; i++) {
int value = (config_setting_get_float_elem(configItems, i) * 10) / 5;
config_setting_t *elem;
int value;
elem = config_setting_get_elem(configItems, i);
switch (config_setting_type(elem)) {
case CONFIG_TYPE_INT:
value = config_setting_get_int(elem) * 2;
break;
case CONFIG_TYPE_FLOAT:
value = config_setting_get_float(elem) * 2;
break;
default:
return 0;
}
if ((value >= 2) && (value <= 127)) {
radio->supportedrates.supportedrates[i] = (uint8_t)value;
} else {