-
Notifications
You must be signed in to change notification settings - Fork 8
VB.net options #39
Hi all im looking to write a small app to show the values from the meter however i dont know c# and looking through the code and using telerik i cant get anything useable.
All im looking to do is connect to the meter, see what mode its in, ie volts, mA etc and get the reading.
All the examples for BT LE dont seem to help me connect to the meter but the complied application works wonderfully.
Many Thanks
J
All reactions
Replies: 16 comments 8 replies
hi, latest version can be complicated but if you want to do it yourself you can use https://github.com/webspiderteam/Bluetooth-DMM-For-Windows/releases/tag/WPFAlpha_1.04 this version. this version has only displaying codes and connection codes. ofcourse there is issues with it but I can help you if you want. BTW whick device do you have?
All reactions
All reactions
Ok. I am working on it. Probably I will send a useable source code for you tomorrow.
All reactions
All reactions
Can you explain me ?
where will you use it?
how its should look like ?
why do you need smaller app?
and last one is can you show me a picture of how it should look?
All reactions
All reactions
but is already has most of them
image
when you set necessary settings it will connect without asking anything or or you dont need to connecttion things
All reactions
All reactions
it has Mqtt ability too. Did you see it? it gets values from meter and its very simple app to make anything as you want. you can find it here https://github.com/webspiderteam/Bluetooth_DMM_For_Windows_MQTT_Test_Project
also for bluetooth connection ability I have used that sample code
HeartRateLE-master (1).zip
this was my starting point for connecting to meter. You can inspect it for understanding code.
All reactions
All reactions
All reactions
there was a vb winform example. did you see it?
All reactions
Ah, no i didnt I was looking at the c# code and trying to decipher
All reactions
https://www.vb-paradise.de/index.php/Thread/132559-Bluetooth-Ansprechen-Ansteuern-von-BLE-Ger%C3%A4ten/ here is an example. its not english but you can use translate
All reactions
btw you dont need to convert dll file you can use it as it is. you ony need to make main window
All reactions
Sorry I dont understand?
All reactions
you can use my bluetooth.dmm.dll as referance and you can use it in vb.net
All reactions
WpfApp3.zip
you can use this as start point with dll. this dll also decodes hex data so you dont need to try decode just use.
All reactions
All reactions
sorry there is no docs but codes should be like that. but not sure is it true or not
Imports System.ComponentModel
Imports HeartRateLE.Bluetooth
Imports HeartRateLE.Bluetooth.Events
Imports HeartRateLE.Bluetooth.Schema
Imports Windows.Devices.Bluetooth
Imports Windows.Devices.Enumeration
Class MainWindow
Private _heartRateMonitor As HeartRateLE.Bluetooth.HeartRateMonitor
Private Property SelectedDeviceId As String
Private Property SelectedDeviceName As String
Private Sub HrParserOnValueChanged(sender As Object, e As RateChangedEventArgs)
txtData.Content = e.MyGattCData
txtSymbol.Content = e.MyGattCDataSymbol
End Sub
Private Sub HrDeviceOnDeviceConnectionStatusChanged(sender As Object, e As ConnectionStatusChangedEventArgs)
MessageBox.Show("gg")
End Sub
Private Async Function Button_ClickAsync(sender As Object, e As RoutedEventArgs) As Task Handles button.Click
Debug.WriteLine("Starting enumeration...")
Dim dp = New DevicePicker()
Dim rec0 = New Windows.Foundation.Rect(10, 10, 400, 500)
dp.Filter.SupportedDeviceSelectors.Add(BluetoothLEDevice.GetDeviceSelectorFromPairingState(False))
'dp.Filter.SupportedDeviceSelectors.Add(BluetoothLEDevice.GetDeviceSelectorFromDeviceName("Bluetooth DMM"))
'dp.Show(rec0)
Dim mydev As DeviceInformation = Await dp.PickSingleDeviceAsync(rec0, Windows.UI.Popups.Placement.Above)
If mydev IsNot Nothing Then
Await _heartRateMonitor.ConnectAsync(mydev.Id).ConfigureAwait(False)
'Await mydev.Pairing.PairAsync(DevicePairingProtectionLevel.EncryptionAndAuthentication)
Dim connectResult = Await _heartRateMonitor.ConnectAsync(mydev.Id)
MessageBox.Show("gg")
If (Not connectResult.IsConnected) Then
MessageBox.Show(connectResult.ErrorMessage)
End If
End If
End Function
Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
_heartRateMonitor = New HeartRateMonitor()
' we should always monitor the connection status
RemoveHandler _heartRateMonitor.ConnectionStatusChanged, AddressOf HrDeviceOnDeviceConnectionStatusChanged
AddHandler _heartRateMonitor.ConnectionStatusChanged, AddressOf HrDeviceOnDeviceConnectionStatusChanged
' we can create value parser And listen for parsed values of given characteristic
'HrParser.ConnectWithCharacteristic(HrDevice.HeartRate.HeartRateMeasurement)
RemoveHandler _heartRateMonitor.RateChanged, AddressOf HrParserOnValueChanged
AddHandler _heartRateMonitor.RateChanged, AddressOf HrParserOnValueChanged
'connectResult = Await _heartRateMonitor.ConnectAsync("")
End Sub
End Class
All reactions
All reactions
@secureitall Here is project that I made in vb.net. download and make your changes as you wish.
its very basic stuffs. I only connected and got the values. also deceded them too...
All reactions
All reactions
that would be great :)