Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

AND_DLL.DLL API Documentation

Rank

Total Posts: 5

Joined 0

PM

Hi all,

working with the ANT_DLL on Delphi/Win32, I could really use some documentation of the calls available through the DLL. I found some information to some of them (in the appendix of the PDF "ANT Message Protocol and Usage"), but no "full reference manual" or anything like that.

For example, I need information on the "ANT_UnassignAllResponseFunctions" call - what does it do, when can/can't I use it?

And also a description which calls to issue in what order to close-down a connection would be greatly appreciated. At this point, I'm using
ANT_ResetSystem;
ANT_Nap(1000);
ANT_Close;
Result := FreeLibrary(HAntLib);
When unloading the DLL, but this crashes. Do I have to unassign the channel first?

Thanks,
Justus      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The only documentation we have regarding the ANT_DLL is the appendix in the "ANT Message Protocol and Usage", as well as an application note that provides more details on how to import the DLL. Have you had a look at the DEMO_DLL included with the library package? There is a lot of comments within the code to assist with the usage.

The response functions are callbacks you assign to process ANT messages (device level and specific to each channel). You can unassign them at any time, ideally after you are done with ANT and you no longer need to process any messages.      
Rank

Total Posts: 5

Joined 0

PM

Setting up a connection to the ANT device has worked straight from the start; setting channel parameters and hooking up the response functions seems to be going well. What I need to do now is break down a connection in a nice and clean way leaving the software in the same state it was when it was first started (so I can (re-)connect to the device later on if required).

Some findings so far:

- Using the ANT_Close call makes the app "hang" in some sort of endless loop.

- Using FreeLibrary (without a call to ANT_Close) crashes the app in some memory address of the ANT_DLL.DLL, even when the response functions have been removed and the ANT_Nap call has been issued with 1000 milliseconds delay.

- After an ANT_Reset, the ANT_Init returns an error.

The example code in ANT_USB2_Windows_Package.zip does mention how to BUILD a connection, it says little over TEARING one DOWN properly.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

ANT_Close cannot be called from the response functions - it must be called from the same thread that started the connection. You must call ANT_Close before you are able to unload the library.      
Rank

Total Posts: 5

Joined 0

PM

Over the summer I wrote a test tool in Delphi 2006 to figure out setting up and breaking down a connection as well as fiddle with the callback functions. For anyone interested, the results (binary and all the source files) are attached to this message, see [file name=ANTTT_1_0_0_0.zip size=352240]http://www.thisisant.com/images/fbfiles/files/ANTTT_1_0_0_0.zip[/file] .      
Rank

Total Posts: 4

Joined 2013-01-21

PM

Hi,

The link is no longer working. Anyone has gotten somewhere interfacing with Delphi?

Thanks      
Rank

Total Posts: 5

Joined 0

PM

The file seems to have been deleted from the ANT developer zone. I uploaded it to my own website for your convenience:

http://www.row-ware.com/other/ANTTT-1-0-0-0.zip

Hope this helps.      
Rank

Total Posts: 4

Joined 2013-01-21

PM

Thanks a lot. If I make improvements I'll keep you posted.

Mike