'Connected' property of the network object is set before the connection attempt is made and does not indicate a connection success. Therefore, use device status property to identify the connection status of the device.