You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
I have this device I need to read data from but the constructor created a custom service.
In order to get informations like DeviceID I need to write a command on a characteristic and read the result from another one.
The two characteristics have the same GUID, the differences are the rights (one can only write, the other can read/update).
While I write my command on the WriteOnly, the event "ValueUpdated" of the other characteristic is triggered but the characteristic value is always null.
var characts = service.Characteristics.Where(c => c.ID == new Guid("81eb77bd-89b8-4494-8a09-7f83d986ddc7"));
writeCharact = characts.FirstOrDefault(c => c.CanWrite && !c.CanRead);
readCharact = characts.FirstOrDefault(c => c.CanRead && c.CanUpdate);
if (writeCharact != null)
{
var cmd = ToMeter("&W "); // Just my command it will send "&W 58287"
readCharact.ValueUpdated += async (sender, e) =>
{
var readValue = readCharact.Value;
var c = await readCharact.ReadAsync();
var id = c.Value;
};
readCharact.StartUpdates();
writeCharact.Write(cmd);
}
This code works on iOS but doesn't on android. I can scan the devices, discover the services, discover the characteristics with no problem. Only this scenario doesn't work.
Any ideas?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello !
I have this device I need to read data from but the constructor created a custom service.
In order to get informations like DeviceID I need to write a command on a characteristic and read the result from another one.
The two characteristics have the same GUID, the differences are the rights (one can only write, the other can read/update).
While I write my command on the WriteOnly, the event "ValueUpdated" of the other characteristic is triggered but the characteristic value is always null.
This code works on iOS but doesn't on android. I can scan the devices, discover the services, discover the characteristics with no problem. Only this scenario doesn't work.
Any ideas?
The text was updated successfully, but these errors were encountered: