Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Heart Rate Monitor → Thread

   

Basic C++ MSVC 2008 project

Rank

Total Posts: 9

Joined 2013-10-09

PM

Hi,

I'm trying to build a very basic project that can just read HRM data into a MSVC 2008 console application.

I was hoping to simply have to add a single .LIB or .DLL plus a single "ant.h" file to the code and compile away. It seems that it is a bit more involving than that. Can some kind person over here provide some hints to what is the closest to this simple project building I describe above?

I tried to find a PDF which describe what each .LIB / .DLL contains (functions, etc.) but there again it is not so clear.

Thanks
     
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi!

If your aim is simply to obtain the data, you can use the SimulANT+ program to do so (http://www.thisisant.com/developer/resources/downloads/ ).

Otherwise take a look at the info here: http://www.thisisant.com/developer/ant-basics/starting-your-project/
You will also need the ANT+ Heart Rate Monitor Device Profile (http://www.thisisant.com/developer/resources/downloads/#documents_tab ).
     
Rank

Total Posts: 9

Joined 2013-10-09

PM

Hi,

I've got all the necessary hardware... and looked at all the documentation you point to. Unfortunately, I'm still lost as to where to start. Usually, a library only requires the coder to use one or a few .LIB / .DLL plus an .H file. That is what I was expecting to find with ANT+ ...

I do need to code this into our own C++ code so it is not a question of using a already-made software such as SimulANT+. We used it to try and validate that the hardware works but now we need to have this in our own code.

My question is really, what is the simplest (fewest lines of code, etc.) code that we need to have an empty ANT/ANT+ project compiling / linking?

thanks      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi,

So the steps under this heading: DEVELOPING ANT ENABLED APPLICATIONS on the starting your project page aren't working for you? This does describe how to compile the library, so if you're stuck can you be more specific?

Thanks!      
Rank

Total Posts: 9

Joined 2013-10-09

PM

Hi,

I can build all the demo project, etc. But I found it still too involved for what I'm looking for. The demo sample code I mean.

My question is: for someone starting a clean project, from scratch, what must be set in terms of includes to that empty project such that it will build cleanly and allow to include ANT+ related functions call to it?

I.e., we are not looking at copying over the projects from the demo into our own project in order to get rolling with this. We want to start from our own code and just add to it the minimum ANT+ code to retrieve the HRM data from the device.

Regards      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

When I started with ANT+ development in C#, I read the "ANT Message Protocol and Usage" document and the ANT+ device profile I was interested in (heart rate like in your case) and found this enough to write my first lines of code and get a first display app working.
Possible pitfalls: you might not set the correct channel parameters for your ANT+ device profile.
In order to check this, it's helpful to use the ANTware II application and try out the parameters. If that works, i.e. you can receive sensor values, it's easy to put these parameters into your own application.

Cheers,
OMB      
Rank

Total Posts: 9

Joined 2013-10-09

PM

Hi,

Thank you for your reply... I'm not even there. I'm just trying to figure out the dependencies such that I setup my project correctly with the correct .LIB and .h include files in my own project such that, hopefully, at some point, it would compile / link with ANT+ specific functions.

I don't know. I may be an old style programer, but it seems to me that with a well designed library, you just had one (or a few) .LIB and a single .h include to add to your project to add the said library to any existing project and it worked. As for documentation, here again, usually you have 1- a user guide which explains the mechanics of how things work, then 2- you have an API reference manual which list all functions, one by one, with the required parameters. I know the last can be found in one of the many PDF found on this site... at the end in an appendix, but, in my opinion, there maybe is to much documentation or the information is misplaced such that it's overwhelming at start for nothing. I was hoping to not have to read a 130+ page document before being able to write the first few lines of code.

About Antware II, I tried installing it and it complained that a DLL required by this project couldn't be run.

I'm sorry for sounding so negative, but this is not the first third party library I integrate with code and it feels something is missing here.

Thanks for the help all.      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Ah I see.
There's a very good starting point for you:
"ANT Windows Library Package with source code" download on http://www.thisisant.com/developer/resources/downloads/ .
It contains the libraries (even with source code) and some example projects.
All as ready-to-compile projects for Microsoft Visual Studio C++ and C# .

Good luck,
OMB - an old style programmer as well, but no sooo ooolllldd style as to use C++ smile      
Rank

Total Posts: 9

Joined 2013-10-09

PM

Hi,

... Yes, we have already installed all this and built it successfully. I guess we will have to read the full documents and reverse engineer the demo projects to see what library LIB / DLL and .h include they use... I was just hoping someone could give us an even simpler code sample than the demo ones... Or is it really the minimal code to get anything working with any ANT+ device? I'm less familiar with C# project files specifics.

Thanks for your help.