does your recipient need a special format? you need to prepare it?
basically data are just bytes but you can wrap all content in a struct as example json,xml.
you need to know what the other side will see.
high transfer rate can affect data loss.
More than happy if an admin wants to pop it in the Add-ons section. I guess my question might be a little generic in that I’m trying to figure out how to call those methods… Ie, what the code looks like to reference the plugin in the most basic form.
Well, this is a multi step process with async events.
Since you can read, I assume you got the WindowsGattCharacteristicMBS object. Then maybe query the WindowsGattDescriptorMBS like in the BluetoothLE Device example.
And it is probably important to keep references to the objects over time. Like if you call WriteValueAsync and the object is destroyed at the end of the method, the async process could get cancelled.
As said, I wrote this with a few customers together and I’ll ask them for an example.
So you got the WindowsGattDeviceServiceMBS object, either by picking from the array you got via GetGattServicesCompleted or IncludedServicesCompleted events.
Then you would query the characteristics, e.g.
once you got CharacteristicsCompleted event, you can make new objects of your WindowsGattCharacteristicMBS subclass to catch events and then sends values:
Sub CharacteristicsCompleted(asyncStatus as Integer, Result as WindowsGattCharacteristicsResultMBS) Handles CharacteristicsCompleted
If result <> Nil Then
Dim theCharacteristics() As WindowsGattCharacteristicMBS = Result.Characteristics
For Each theCharacteristic As WindowsGattCharacteristicMBS In theCharacteristics
Dim Characteristic As New GattCharacteristic(theCharacteristic)
Log "Characteristic: "+Characteristic.UserDescription+" "+Characteristic.UUID
Var mb As New MemoryBlock(6)
mb.Byte(0) = &H01 // Data Byte
mb.Byte(1) = &HAA
mb.Byte(2) = &H55
mb.Byte(3) = &HAA
mb.Byte(4) = &H55
mb.Byte(5) = &HAA
Log "Failed to get characteristics."
For this example there are two characteristics. First it sets configuration descriptor to 1, which I think is WriteWithoutResponse.
Then it assembles a data package with 6 bytes and writes it.
Later the WriteValueAsyncCompleted event is called.