Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

UWP dll wrapper advice?

Rank

Total Posts: 13

Joined 2015-03-24

PM

Hi, I have a rather large and somewhat old desktop (unmanaged c++) app that I've ported to the Raspberry Pi with the exception of ANT support. It's not really feasible to rewrite the app in c# so I'd gone down the path of putting together a wrapper for the UWP dll. Using the desktop ANT_NET.dll on the desktop as a stand-in (since if I understand correctly the interface is the same) I was able to get it working fairly easily. But in the porting to the PI I've run into a bunch of issues... my first wrapper was c++/cli which I didn't realized is completely unsupported on the PI. Then based on MS support's suggestion I went with a c# COM wrapper which again wouldn't work once I ported it (no regasm on the PI and adding the keys manually doesn't work). Lastly (and again based on MS's recommendation) I went with an "unregistered side-by-side COM" approach. Again, works fine on the desktop not on the PI. If the PI had the same tools available (sxstrace, procmon, etc.) I could probably work out what's going on but without these tools I'm shooting in the dark. Anyway, I'm wondering if any of the devs that put together the PI's UWP dll might have any suggestions. I'm assuming you've gone through a bit of this already while doing your port. And again, it may be that it's just not possible. As it stands the COM stuff fails on it's own before I even have had a chance to load up the ANT_NET_UWP.dll so for all I know at this point it's just not a supported scenario. At any rate any input/suggestions you might have would be appreciated. We've got BT/LE support working already and I'd really like to add ANT as well if at all possible. Thx, Chris      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

The best way to do it would be to build and include the static C++ native library in your app. Unfortunately, we haven't had time to make a source release of the UWP library yet like we have for the other libraries. I can't give you a timeframe, but it definitely is still on the TODO list.

Using either of the DLLs that we have packaged now from C++ on UWP is going to be a lot of work as you are obviously finding.

If anybody else finds this post looking to do ANT using C++ on UWP / Raspberry Pi / Windows IOT then feel free to comment here and we might bump the priority if there is more interest.      

Signature

Dynastream Developer

Rank

Total Posts: 13

Joined 2015-03-24

PM

Hi Shane, Thanks very much for the reply... I really hope I can get this going. Before going the wrapper route I did try building the old C++ library, though I just built it as an ARM dll. Everything compiled/linked and seemed to run okay but I got a bad return from the ANT_Init call. I don't remember the exact error though I took it to be because the different driver for the dongle on the PI. Is that not a correct assumption? If not and you think it should work I'll definitely give that another look and if I get it working will be happy to share whatever process I go through on the forum for anyone else going down this path. Thanks, chris

PS - it just came back to me that I only built the main ANT_DLL.dll as I didn't see the source for the others (another reason I wasn't surprised it didn't work).      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Compiling the standard libs for UWP won't work because they don't know how to use the WinUSB driver.      

Signature

Dynastream Developer

Rank

Total Posts: 13

Joined 2015-03-24

PM

Thanks... just to be sure though that I'm not misunderstanding, including the static C++ library in my app would still have the same issue on the RP (since it still wouldn't work with the WinUSB driver). I just want to be sure I'm not missing a possible solution/workaround. Thanks!      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Until we publish the UWP C++ code, there is not an easy solution or workaround. The only solution would be to wrap the UWP Dlls in the beta as you were trying in your first post.      

Signature

Dynastream Developer

Rank

Total Posts: 13

Joined 2015-03-24

PM

Got it, thanks... just wanted to be sure. Thx