From 17f49232c8bdf62cf1c299714f5e723149e5bcca Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Mon, 28 Mar 2016 00:02:31 +0000 Subject: [PATCH] float2reate introduced. FossilOrigin-Name: 7e122c31ac685504c3a2324d30d4fa3c72d6505cfc93e705ed3703d78589a524 --- src/cw/dot11.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cw/dot11.h b/src/cw/dot11.h index 7ff65428..a9e12f4a 100644 --- a/src/cw/dot11.h +++ b/src/cw/dot11.h @@ -238,15 +238,17 @@ static inline int dot11_put_ssid(uint8_t *dst,uint8_t * ssid,int len){ } -#define dot11_rate(rate) ((int)(rate*2+0.5)); +#define dot11_float2rate(frate) ((int)(frate*2+0.5)); +#define dot11 rate2float(rate) ((float)(rate)/2.0) + static inline int dot11_put_supported_rates(uint8_t *dst, float *basic, float *rates){ uint8_t *d = dst+2; while(*basic != 0.0){ - *d++ = 0x80 | dot11_rate(*basic); + *d++ = 0x80 | dot11_float2rate(*basic); basic++; } while(*rates != 0.0){ - *d++ = dot11_rate(*rates); + *d++ = dot11_float2rate(*rates); rates++; } *(dst)=DOT11_ELEM_SUPPORTED_RATES;