added first phase for connection between the pc and the device.