~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychHardware/iViewXToolbox/iViewXComm.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                        result=data;
58
58
                    end
59
59
                end
 
60
            case 'receivelast',
 
61
                if ~isempty(ivx.udp)
 
62
                    % should we instead check status?
 
63
                    % stat=pnet(ivx.udp,'status');
 
64
                    
 
65
                    while 1
 
66
                        % Wait/Read udp packet to read buffer
 
67
                        len=pnet(ivx.udp,'readpacket');
 
68
                        
 
69
                        %len=pnet(udp,'readpacket',[],'noblock');
 
70
                        % if len>0 fprintf('Len: %d\n', len); end
 
71
                        
 
72
                        if len > 0
 
73
                            % [ip,port]=pnet(ivx.udp,'gethost');
 
74
                            % if packet larger then 1 byte then read
 
75
                            % maximum of 1000 doubles in network byte order
 
76
                            % data=pnet(udp,'read',ivx.udpmaxread,'double');
 
77
                            data=pnet(ivx.udp,'read',ivx.udpmaxread);
 
78
                            % data
 
79
                            result=data;
 
80
                        else
 
81
                            break
 
82
                        end
 
83
                    end
 
84
                end
60
85
            case 'close',
61
86
                if ~isempty(ivx.udp)
62
87