Coder Social home page Coder Social logo

Write to FTMS Device about blewinrtdll HOT 6 OPEN

adabru avatar adabru commented on July 22, 2024
Write to FTMS Device

from blewinrtdll.

Comments (6)

adabru avatar adabru commented on July 22, 2024

Hi @serramat , you could try the things mentioned in #20 (comment) .

from blewinrtdll.

ShuohengZhang avatar ShuohengZhang commented on July 22, 2024

Hi @serramat , you could try the things mentioned in #20 (comment) .

Hi adabru, thanks for your great work on this BLE.dll! By the way I have the similar problem as @serramat had. The whole DLL worked very well since I use it, and since October the write value is down. There's no errors but only the FTMS indoorbike doesn't react to the value it received. Specifically I want to change 2 Bytes ('0x11, 0x00, 0x00, Byte1, Byte2, 0x00, 0x00'). I tried changing GattWriteOption::WriteWithoutResponse to GattWriteOption::WriteWithResponse at https://github.com/adabru/BleWinrtDll/blob/main/BleWinrtDll/BleWinrtDll.cpp#L536 . , this doesn't work in my case, but I tried with nRF Connect on iOS system. Where I write '110000DC050000' would make the FTMS indoorbike change its inclination grade to '15' correctly. I even wrote a UWP application to test the function, and surprisingly it works. But as I use the UWP specific API, I cannot make it into a dll and import to Unity. And I'm stucking to this problem for a month but I still cannot figure out where's the problem. Could u please help me out ?

from blewinrtdll.

adabru avatar adabru commented on July 22, 2024

Hi @ShuohengZhang ,
it's good that your UWP application works. The dll in this repository is a c++ winrt wrapper for UWP code so the step from your UWP app to the dll should be small.

You can compare the UWP function calls from https://github.com/adabru/BleWinrtDll/blob/main/BleWinrtDll/BleWinrtDll.cpp with your UWP app. If your UWP app uses another API-call, you can change that in BleWinrtDll.cpp. Or you can change the API-call in your UWP app to the same as in BleWinrtDll.cpp.

As reference for converting UWP code to c++ winrt and vice versa, you can use
https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/BluetoothLE/cppwinrt/Scenario2_Client.cpp
and
https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/BluetoothLE/cs/Scenario2_Client.xaml.cs
Those are functionally the same.

from blewinrtdll.

ShuohengZhang avatar ShuohengZhang commented on July 22, 2024

Hi @adabru,
Thanks for your reply!! And yeah, I was a bit afraid to write a C++ DLL by myself because I don't really understand the C++ codes that well. However, I tried it with your suggestions today and looked into your codes and the samples I made (Dll_BLE.cpp). When I import this DLL into the Unity project, there is a DllNotFoundException when I already put it in the same folder as your BLEWinrtDll (I assume when this DLL can be used, so should mine). I would so appreciate hearing your suggestions!!

Best regards!

from blewinrtdll.

adabru avatar adabru commented on July 22, 2024

I'm not quite sure what the reason for the DllNotFoundException is. You can try to look at Unity's import settings for that file. You can also try to change the 32-bit or 64-bit setting in VS. And maybe try to ask ChatGPT.

Is your repository private? I can't access the link.

from blewinrtdll.

ShuohengZhang avatar ShuohengZhang commented on July 22, 2024

@adabru sorry I didn’t notice that was private now u may have the access. And thanks again that you still concern about my case !

from blewinrtdll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.