How do I return a pointer for the Aardvark API?

I'm using Total Phase's Aardvark USB Adapter and I'm wondering how to return a pointer?
I'm trying to use:
dataOut = [0 18];
dataTargetID = NET.createArray('System.Byte',19);
TotalPhase.AardvarkApi.aa_i2c_write_read(aard_device, slaveAddress, ... TotalPhase.AardvarkI2cFlags.AA_I2C_NO_FLAGS, 2, dataOut, write_count, 19, dataTargetID, read_count);
and I want to get write_count and read_count. From the user manual: http://www.totalphase.com/support/articles/200468316-Aardvark-Adapter-User-Manual#s5.5
it says the input is a unsigned short pointer?
I've tried:
read_count = NET.createArray('System.UInt16',1);
read_count = libpointer('UInt16');
read_count = 0;
but I always get the error:
No method 'aa_spi_slave_read' with matching signature found for class
'TotalPhase.AardvarkApi'.
Thanks!
-Mike

1 件のコメント

Philip Borghesani
Philip Borghesani 2014 年 7 月 14 日
libpointer objects are only for use with the calllib command. No .net or other method will recognize them.

サインインしてコメントする。

 採用された回答

Michael
Michael 2014 年 7 月 14 日

0 投票

Use 'methodsview TotalPhase.AardvarkApi' to see what aa_write_read returns. The read_count and write_count is returned so passing by reference isn't needed

1 件のコメント

Jeff Baker
Jeff Baker 2018 年 1 月 17 日
I have the oppositie problem- the counts are simply returned but the values are passed by reference. Did your code successfully return the values?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2014 年 7 月 11 日

編集済み:

2018 年 1 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by