Wrote connected_devices handler.