Changeset 768

Show
Ignore:
Timestamp:
08/31/09 16:10:30 (4 years ago)
Author:
atorf
Message:
  • Implemented former patch for MacOS support
  • Simple: Uses Windows/Fantom? code for USB, uses Linux fwrite to serial port for BT
  • Careful: It all works because sometimes inside the BT-code, we just ask "if ispc", and else we do stuff for both Linux and Mac implicitely…
  • Fixes #8
Location:
trunk/mfiles
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/mfiles/COM_CloseNXT.m

    r670 r768  
    6464% Signature 
    6565%   Author: Linus Atorf (see AUTHORS) 
    66 %   Date: 2008/07/09 
     66%   Date: 2009/08/31 
    6767%   Copyright: 2007-2009, RWTH Aachen University 
    6868% 
     
    137137        if h.ConnectionTypeValue == 1 % USB 
    138138            textOut(sprintf('Closing handle (USB) with MAC = %s (handle was %.1f minutes old)\n', h.NXTMAC, etime(clock, h.CreationTime) / 60)); 
    139             if h.OSValue == 1 % win 
     139            if (h.OSValue == 1) || (h.OSValue == 3) % Windows and Mac 
    140140                USB_CloseHandle_Windows(h); 
    141141            else % linux 
  • trunk/mfiles/COM_CollectPacket.m

    r670 r768  
    5858% Signature 
    5959%   Author: Linus Atorf (see AUTHORS) 
    60 %   Date: 2007/10/14 
     60%   Date: 2009/08/31 
    6161%   Copyright: 2007-2009, RWTH Aachen University 
    6262% 
     
    9393 
    9494    if handle.ConnectionTypeValue == 1 % USB 
    95         if handle.OSValue == 1 % Windows 
     95        if (handle.OSValue == 1) || (handle.OSValue == 3) % Windows and Mac 
    9696            [type cmd statusbyte content] = USB_CollectPacket_Windows(handle); 
    9797        else % Linux 
  • trunk/mfiles/COM_OpenNXTEx.m

    r758 r768  
    100100% Signature 
    101101%   Author: Linus Atorf (see AUTHORS) 
    102 %   Date: 2009/07/10 
     102%   Date: 2009/08/31 
    103103%   Copyright: 2007-2009, RWTH Aachen University 
    104104% 
     
    254254        h.OSName    = 'Windows'; 
    255255        h.OSValue   = 1; 
    256     else % no support for Mac yet... 
    257         h.OSName    = 'Linux'; 
    258         h.OSValue   = 2; 
     256    else % mac or linux 
     257        if ismac 
     258            h.OSName    = 'Mac'; 
     259            h.OSValue   = 3; 
     260        else 
     261            h.OSName    = 'Linux'; 
     262            h.OSValue   = 2; 
     263        end%if 
    259264    end%if 
    260265 
     
    487492    textOut(sprintf('Opening USB connection...\n')); 
    488493     
    489     if hIn.OSValue == 1 
     494    if (hIn.OSValue == 1) || (hIn.OSValue == 3) % Windows and Mac 
    490495        hOut = USB_OpenHandle_Windows(hIn, SuppressErrors); 
    491     elseif hIn.OSValue == 2 
     496    elseif hIn.OSValue == 2 % Linux 
    492497        hOut = USB_OpenHandle_Linux(hIn, SuppressErrors); 
    493498    end%if 
  • trunk/mfiles/COM_SendPacket.m

    r670 r768  
    3434% Signature 
    3535%   Author: Linus Atorf (see AUTHORS) 
    36 %   Date: 2008/07/09 
     36%   Date: 2009/08/31 
    3737%   Copyright: 2007-2009, RWTH Aachen University 
    3838% 
     
    7272        end%if 
    7373         
    74         if handle.OSValue == 1 % Windows 
     74        if (handle.OSValue == 1) || (handle.OSValue == 3) % Windows and Mac 
    7575            USB_SendAndCollectPacket_Windows(Packet(3:end), handle); 
    7676        else % Linux 
  • trunk/mfiles/private/checkHandleStruct.m

    r670 r768  
    1717%   Author: Linus Atorf (see AUTHORS) 
    1818%   Date: 2008/07/01 
    19 %   Copyright: 2007-2009, RWTH Aachen University 
    20 ; 
     19%   Copyright: 2007-2008, RWTH Aachen University 
    2120% 
    2221% *********************************************************************************************** 
     
    6362                    end%if 
    6463                end%if 
    65             else % Linux 
     64            elseif h.OSValue == 2 % Linux 
    6665                if h.ConnectionTypeValue == 1 % USB 
    6766                     if ~isnumeric(h.Handle) % also possible: isa('libpointer') ? 
     
    6968                     end%if 
    7069                else % BT 
     70                    if isfloat(h.Handle) 
     71                        valid = true; 
     72                    end%if 
     73                end%if 
     74            else % Mac 
     75                if h.ConnectionTypeValue == 1 % USB, Windows part for USB 
     76                    if isfloat(h.Handle) 
     77                        valid = true; 
     78                    end%if 
     79                else % BT, Linux part for BT 
    7180                    if isfloat(h.Handle) 
    7281                        valid = true;