Giter Site home page Giter Site logo

Comments (8)

aritchie avatar aritchie commented on June 11, 2024

I'm not sure what you're asking me here?

  • The title says you're getting a timeout, but where is that timeout happening? On the Notify function?
  • In your expected behaviour you state: But always it returning the command only not response . <= Shiny doesn't change the data that is being sent back to you. Did you check your actual peripheral.

Please reduce your code as well. The intent of a reproducible sample is small & focused with commented code being removed.

from shiny.

rajansmk avatar rajansmk commented on June 11, 2024

await peripheral
.NotifyCharacteristic(notifyCharacteristic,false,false)
.Timeout(TimeSpan.FromSeconds(60));
while calling this function i am getting error "the operation has timed out"
I have implemented through SubOnMainThread but no use same error.
When I am writing command I need response. (it is working on the nrf connect application but i don't know how to get from NotifyCharacteristic function)
Please guide me..

from shiny.

rajansmk avatar rajansmk commented on June 11, 2024

This is my byte array :4d4f44454c3f0d string value :MODEL?
Nrf response(debug) from var wr = await peripheral.WriteCharacteristic(notifyCharacteristic, command,true); is 0D0A32303035303132330D0A3E
when i write the command i am getting this byte code only return(wr.data) "4d4f44454c3f0d" not this expected result 0D0A32303035303132330D0A3E

from shiny.

rajansmk avatar rajansmk commented on June 11, 2024

my code file
https://github.com/rajansmk/ble

from shiny.

aritchie avatar aritchie commented on June 11, 2024

Ok you've still given me almost 400 lines of code to look at, so I'm going to bypass that for now.

I don't know if there is a bug here, but you've put a timeout on a streaming characteristic. NotifyCharacteristic is a continuous stream, so you don't want it to timeout. You just want to wait/listen on it.

As for your write - shiny doesn't do anything weird with the data. You need to figure out your peripheral and writes.

You really have to point me towards a bug in Shiny or I'll have to close this one off

from shiny.

rajansmk avatar rajansmk commented on June 11, 2024

if i code very simple method then also i am facing timeout error..
var noti = await peripheral.NotifyCharacteristic(notifyCharacteristic, false, false);

from shiny.

rajansmk avatar rajansmk commented on June 11, 2024

i have given the github link https://github.com/rajansmk/ble
Then how to get response from ble device through write command(WriteCharacteristic) .can you pls give any sample code..

from shiny.

aritchie avatar aritchie commented on June 11, 2024

i have given the github link https://github.com/rajansmk/ble

Yes, but as I've said - it is too large and doesn't actually frame an issue I can fix with this library

var noti = await peripheral.NotifyCharacteristic(notifyCharacteristic, false, false);

You can't do this. It is a continuous stream. You need to research how your peripheral works for TX/RX and how to properly use reactive extensions as part of this library.

Then how to get response from ble device through write command(WriteCharacteristic) .can you pls give any sample code..

There is a sample app as part of this repo and there is documentation on shinylib.net . This isn't tech support and I simply don't know your peripheral.

This appears to be a misunderstanding with how things work and not the library. I am closing this for now. If you can provide an actual issue with a repro, I'm happy to take a look

from shiny.

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.