MAGNET: A middleware for the proximal interaction of devices based on Wi-Fi direct