Comments (8)
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.
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.
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.
my code file
https://github.com/rajansmk/ble
from shiny.
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.
if i code very simple method then also i am facing timeout error..
var noti = await peripheral.NotifyCharacteristic(notifyCharacteristic, false, false);
from shiny.
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.
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)
- [Bug]: IBleDelegate::OnAdapterStateChanged is not called HOT 1
- [Bug]: IPeripheral's connection state is not updated after .Scan() running again HOT 4
- [Bug]: App in background or not running. No any event fires under Android HOT 1
- net8.0 support for Maui HOT 5
- [Bug]: Location Permission Always Requester does not work (or appear) HOT 3
- [Bug]: Android does not throw a Disconnected into the BleDelegate HOT 1
- IBleManager.IsScanning is always False in Apple
- [Bug]: IPeripheral's connection state is not updated after .Scan() running again HOT 3
- [Bug]: Bug with NotifyCharacteristic Subscription HOT 1
- Cannot send local notification with a ScheduleDate set using 3.2.4 HOT 8
- [Feature Request]: Allow specifying user-agent header on NSURLSession Config HOT 1
- [Bug]: actionIdentifier not available in OnEntry delegate for Push Notifications HOT 1
- [Bug]: ServiceCollectionExtensions.AddBluetoothLE() throws "System.InvalidOperationException: This service descriptor is keyed. Your service provider may not support keyed services." HOT 2
- [Bug]: Shiny not working with Azure Notification Hub and FCM V1 HOT 3
- [Bug]: CharacteristicExtensions.GetAllCharacteristics returns only characteristics of the latest found service
- [Bug]: Setting up Shiny services for MAUI with .Net 8.0 support HOT 3
- [Bug]: await IBleManager.RequestAccessAsync() never returns a completed task the first time asking for permissions HOT 6
- [Bug]: Cannot use ScheduleDate and RepeatInterval at the same time HOT 1
- [Bug]: Connecting and disconnecting the connection does not work reliably HOT 3
- [Bug]: WriteCharacteristic is always timeout once "GATT is not connected" is thrown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiny.