示例#1
0
        private void RunProfilerCommand(ProfilerCommand command, Packet requestPacket, out Packet responsePacket)
        {
            responsePacket = null;

            RunProfilerCommand(command);

            if (requestPacket != null)
            {
                _devicePacketStream.Write(requestPacket);
            }

            // the response status code will be the second int read back (first is session ID)
            var packetStatusResponse = _devicePacketStream.Read();

            var sessionId = packetStatusResponse.ReadInt32();

            var status = packetStatusResponse.ReadInt32();

            if (status == 0)
            {
                responsePacket = _devicePacketStream.Read();
                return;
            }

            throw new Exception(command.ToString() + " failed. Return status: " + status);
        }
示例#2
0
        private void RunProfilerCommand(ProfilerCommand command)
        {
            // construct the command packet
            var commandPacket = new Packet();

            commandPacket.WriteInt32((int)command);

            _devicePacketStream.Write(commandPacket);
        }
        private void RunProfilerCommand(ProfilerCommand command)
        {
            // construct the command packet
            var commandPacket = new Packet();
            commandPacket.WriteInt32((int)command);

            _devicePacketStream.Write(commandPacket);
        }
        private void RunProfilerCommand(ProfilerCommand command, Packet requestPacket, out Packet responsePacket)
        {
            responsePacket = null;

            RunProfilerCommand(command);

            if (requestPacket != null)
            {
                _devicePacketStream.Write(requestPacket);
            }

            // the response status code will be the second int read back (first is session ID)
            var packetStatusResponse = _devicePacketStream.Read();

            var sessionId = packetStatusResponse.ReadInt32();

            var status = packetStatusResponse.ReadInt32();

            if (status == 0)
            {
                responsePacket = _devicePacketStream.Read();
                return;
            }

            throw new Exception(command.ToString() + " failed. Return status: " + status);
        }