SELECT
	node_ip,
	node_mac,
	CONCAT(node_mac,'-ap', SUBSTRING(node_ip FROM 11)) AS node,
	hwtype,
	FLOOR(current_signal) AS signal,
	FLOOR(current_noise) AS noise,
	snr,
	(snr - 1 + RAND()) AS snr_jittered,
	IF(hwtype = "bcm", 1 - (rx_packets / (rx_packets + rx_fifo + rx_drop + rx_error + rx_frame)), 1 - (rx_packets / (rx_packets + madwifi_rx_crc + madwifi_rx_phy))) AS PER
	
FROM reports
LEFT JOIN hwtype_mac USING (node_mac)

ORDER BY node_mac
