#!/bin/bash

phy=$1

phy="bcm43xx-phy$phy"
echo ",current TXpower,desired TXpower"
i=0
while read line; do
	x="$(echo $line | grep -e "$phy")"
	if [ -z "$x" ]; then
		continue
	fi
	x="$(echo $line | grep -e "Current TX power output")"
	if [ -z "$x" ]; then
		continue
	fi

	tim="$(echo $line | cut -d ' ' -f 2 | cut -d ']' -f 1)"
	cur="$(echo $line | cut -d ' ' -f 9)"
	est="$(echo $line | cut -d ' ' -f 15)"
	echo "$tim,$cur,$est"
#	let i=i+1
done
