Closed Nick-Blair19 closed 1 month ago
Hi @Nick-Blair19,
I'm the friendly issue checker. It seems like (100.00 %) you haven't used our issue template :cry: I think it is very frustrating for the repository owners, if you ignore them.
If you think it's fine to make an exception, just ignore this message. But if you think it was a mistake to delete the template, please close the issue and create a new one.
Thanks!
Just added sample project zip
This repo is dead... Use different library.
This repo is dead... Use different library.
afraid you may be right
This repo is dead... Use different library.
Nah, it's not quite dead yet, it only smells a bit funny 😝
var service = _gattDevice.GetServiceAsync(Guid.Parse("fefb"));
The compile error you see is basically due to an await
missing here.
This is a C# beginner question, not a bug report! (Please use 'Discussions' instead of 'Issues' for such things in GitLab, if at all.)
no the error is not with var service = _gattDevice.GetServiceAsync(Guid.Parse("fefb")); but with var sendCharacteristic = service.GetCharacteristicsAsync(GattIdentifiers.UartGattCharacteristicSendId); Also get similar errors with read and write characteristics ant StartUpdates
???
This is the error
That is, as I said, because you're missing an await
on the assignment of your service (so that it's of type Task
instead of IService
). Trust me ;)
(and please do some reading on asynchronous operations in C#, before posting further comments here)
oh by the way janus while youre there can I ask you a few more questions?
How do I notify characteristics? Before when using xamarin corebluetooth I had SetNotifyValue but cant see anything like this here?
how do I send Rx and Tx credits to 'Credit' characteristics (I have a Telit BLE module with a GATT service)? Before I had corebluetooth code this.PendingLocalUARTCreditsCount = this.MaxLocalUARTCreditsCount - this.LocalUARTCreditsCount; Byte[] byteData = new Byte[1]; byteData[0] = (Byte)((this.PendingLocalUARTCreditsCount & 0xFF)); NSData valueData = (NSData.FromArray(byteData)); peripheral.WriteValue(valueData, UartRxCreditsCharacteristic, CBCharacteristicWriteType.WithoutResponse);
Lastly do you have the ability to discover bluetooth device adresses with ble.plugin?
Very many thanks. Regards Nick
I am using ble.plugin 3.1.0 and ios ipad 17.7 I have error in visual studio with code var sendCharacteristic = service.GetCharacteristicsAsync(GattIdentifiers.UartGattCharacteristicSendId); I get error 'Task' does not contain a definition for 'GetCharacteristicsAsync' and no accessible extension method 'GetCharacteristicsAsync' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?)
This is the code snippet
public void Connect(IDevice _gattDevice)
{
this._adapter.ConnectToDeviceAsync(_gattDevice);
var ble = CrossBluetoothLE.Current;
var adapter = CrossBluetoothLE.Current.Adapter;
try
{
var service = _gattDevice.GetServiceAsync(Guid.Parse("fefb"));
if (service != null)
{
This should be working code and I get similar errors with read and write characteristics methods? Regards Nick.