From 070c02011a115371dd22cf20a265527682f4fa35 Mon Sep 17 00:00:00 2001 From: Rodney Cullen <782506+rodcul@users.noreply.github.com> Date: Thu, 16 Aug 2018 14:17:12 -0400 Subject: [PATCH] Add Bit Rate to iwconfig --- iwconfig.js | 4 ++++ test/iwconfig.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/iwconfig.js b/iwconfig.js index fb2f5fd..bed0fbf 100644 --- a/iwconfig.js +++ b/iwconfig.js @@ -63,6 +63,10 @@ function parse_status_block(block) { parsed.frequency = parseFloat(match[1]); } + if ((match = block.match(/Bit Rate[:|=]\s*([0-9\.]+)/))) { + parsed.bitrate = parseFloat(match[1]); + } + if ((match = block.match(/IEEE\s*([^\s]+)/))) { parsed.ieee = match[1].toLowerCase(); } diff --git a/test/iwconfig.js b/test/iwconfig.js index c78f3ea..cbfaa0d 100644 --- a/test/iwconfig.js +++ b/test/iwconfig.js @@ -91,6 +91,7 @@ describe('iwconfig', function() { ieee: '802.11bg', mode: 'master', frequency: 2.437, + bitrate: 54, sensitivity: 0, quality: 18, signal: 11, @@ -142,6 +143,7 @@ describe('iwconfig', function() { ieee: '802.11bg', mode: 'master', frequency: 2.437, + bitrate: 54, sensitivity: 0, quality: 18, signal: 11, @@ -179,6 +181,7 @@ describe('iwconfig', function() { ieee: '802.11abgn', mode: 'managed', frequency: 2.412, + bitrate: 36, quality: 63, signal: -47 });