masdeseiscaracteres
10/16/2013 - 12:02 AM

Trying to add MIMO cable synchronization to the Matlab Support Package for USRP(R) hardware by Ettus Research

Trying to add MIMO cable synchronization to the Matlab Support Package for USRP(R) hardware by Ettus Research

clc;
clear;
close all;

cd 'C:\MATLAB\SupportPackages\R2013a\sdru'

try
    unloadlibrary('libmwusrp_uhd_capi')
end
libfile=fullfile('bin',computer('arch'),'libmwusrp_uhd_capi');
hdrfile1=fullfile('include','libmwusrp_uhd_capi.hpp');
hdrfile2=fullfile('include','sdrupackage.h');
hdrfile3=fullfile('include','usrp_uhd_capi.hpp');
incdir=fullfile('include');
[a b]=loadlibrary(libfile,hdrfile3,'addheader',hdrfile1,'addheader',hdrfile2,'includepath','include','mfilename','protofile')
% [a b]=loadlibrary(libfile,@protofile,'addheader',hdrfile1,'addheader',hdrfile2,'includepath','include','mfilename','protofile')

try
    %libfunctionsview('libmwusrp_uhd_capi')
    libfunctions('libmwusrp_uhd_capi','-full')
end

BUFFERSIZE=255;
arg1 = blanks(BUFFERSIZE);
arg2 = libpointer('UsrpErrorCapiEnumT',int32(0))   
arg3 = blanks(BUFFERSIZE);  

%% Two usage examples
[a b c]= calllib('libmwusrp_uhd_capi','getSDRuDriverVersion_c',arg1,arg2,arg3);
sprintf('UHD Driver version: %s\n',a);

[a b]= calllib('libmwusrp_uhd_capi','reportDrivers_c',arg1,arg2,arg3)