Skip to content

Navigation Menu

Sign in
Sign up

VB.net options #39

secureitall started this conversation in General
Jun 21, 2023 · 16 comments · 8 replies
Discussion options

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

You must be logged in to vote

Replies: 16 comments 8 replies

Comment options

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?

You must be logged in to vote
0 replies
Comment options

Hi Many Thanks Ive downloaded the alpha and will work through it. I only want to connect to one device and get the value etc. The device I have is an AN9002 got it because of your code assuming I could connect to it lol J From: webspiderteam ***@***.***> Sent: Thursday, June 22, 2023 9:01 AM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) 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? — Reply to this email directly, view it on GitHub <#39 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXRPX523VW677C2LLXTXMP3SFANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXUU2JVCW5ZHWU7RC3LXMP3SFA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL5N3W.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

Ok. I am working on it. Probably I will send a useable source code for you tomorrow.

You must be logged in to vote
0 replies
Comment options

Oh Wow Ive been looking at converting some of it but ive found some things appear to not be possible in vb.net and I don’t have the ability J From: webspiderteam ***@***.***> Sent: Thursday, June 22, 2023 10:41 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) Ok. I am working on it. Probably I will send a useable source code for you tomorrow. — Reply to this email directly, view it on GitHub <#39 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXXMEOOHH2C5DMKGTOTXMS3VJANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXSCNZAP7TUZ5Q2XSODXMS3VJA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL53R6.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

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?

You must be logged in to vote
0 replies
Comment options

Hi Its to get a value from the meter to show if it’s a good or a bad value. Ie battery results if above 1.3v then green and pass below read and fail. I don’t need all the discovery parts or the pretty display, just a way to connect to the device by address in vb.net and a means to display the actual reading on the meter (and its current selected range) in a textbox.. J From: webspiderteam ***@***.***> Sent: Friday, June 23, 2023 12:58 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) 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? — Reply to this email directly, view it on GitHub <#39 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXSRFCBH7HK62B57OKLXMWAFLANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXQSP54ZDJYFQPXOF3TXMWAFLA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6FSS.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

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

You must be logged in to vote
0 replies
Comment options

Agreed, your pp works perfectly but I need to get the values from the meter into my app so I can manipulate the readings obtained. All of the examples I can find that can connect to say a heart rate monitor uses DeviceInformation.FindAllAsync(BluetoothDevice.GetDeviceSelector()) And this doesn’t list the an9002 meter. Ive looked at the Bluetooth le explorer and the meter shows up in that and displays values (in hex) Plus your app fully connects to the meter and does everything. From: webspiderteam ***@***.***> Sent: Friday, June 23, 2023 1:14 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) but is already has most of them <https://user-images.githubusercontent.com/85828505/248263910-0d6e7694-ecd9-4204-8257-968e25550ad7.png> when you set necessary settings it will connect without asking anything or or you dont need to connecttion things — Reply to this email directly, view it on GitHub <#39 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXRB3F6PK5UDTTXM5PDXMWCCJANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXVYPQUFTQPCRANK2JLXMWCCJA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6FZW.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
1 reply
Comment options

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.

Comment options

Yes I did consider setting up a mqtt server and listening to that but thought it was a little overcomplicated for what im trying to do. I will look at this though. I have looked at the heartrate monitor sample you suggested and used Telerik to convert sections from c# to vb.net However The first bit I have tried to translate and work though gives me a load of errors Public Async Function ConnectAsync(ByVal deviceId As String) As Task(Of ConnectionResult) _heartRateDevice = Await BluetoothLEDevice.FromIdAsync(deviceId) If _heartRateDevice Is Nothing Then Return New Schema.ConnectionResult() With { .IsConnected = False, .ErrorMessage = "Could not find specified heart rate device" } End If If Not _heartRateDevice.DeviceInformation.Pairing.IsPaired Then _heartRateDevice = Nothing Return New Schema.ConnectionResult() With { .IsConnected = False, .ErrorMessage = "Heart rate device is not paired" } End If _heartRateDevice.ConnectionStatusChanged -= DeviceConnectionStatusChanged _heartRateDevice.ConnectionStatusChanged += DeviceConnectionStatusChanged Dim isReachable = Await GetDeviceServicesAsync() If Not isReachable Then _heartRateDevice = Nothing Return New Schema.ConnectionResult() With { .IsConnected = False, .ErrorMessage = "Heart rate device is unreachable (i.e. out of range or shutoff)" } End If Dim characteristicResult As CharacteristicResult characteristicResult = Await SetupHeartRateCharacteristic() If Not characteristicResult.IsSuccess Then Return New Schema.ConnectionResult() With { .IsConnected = False, .ErrorMessage = characteristicResult.Message } DeviceConnectionStatusChanged(_heartRateDevice, Nothing) Return New Schema.ConnectionResult() With { .IsConnected = _heartRateDevice.ConnectionStatus = BluetoothConnectionStatus.Connected, .Name = _heartRateDevice.Name } I was hoping that I could see the code to connect to the meter from this then work on getting the value from it. Understand that once I have got the values I have to convert them into something readable Thanks for your help so far James From: webspiderteam ***@***.***> Sent: Friday, June 23, 2023 1:45 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) 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 <https://github.com/webspiderteam/Bluetooth-DMM-For-Windows/files/11848521/HeartRateLE-master.1.zip> this was my starting point for connecting to meter. You can inspect it for understanding code. — Reply to this email directly, view it on GitHub <#39 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXXR5EF6ZJDKLBCBL4DXMWFWPANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXU33CCMMXWRW3XUMR3XMWFWPA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6GJ4.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

I think the first step I need to achieve is to connect to the meter by its address and get the hex values it streams. Then I can look at how to convert that using the information on Home · ludwich66/Bluetooth-DMM Wiki (github.com) <https://github.com/ludwich66/Bluetooth-DMM/wiki> J From: webspiderteam ***@***.***> Sent: Friday, June 23, 2023 1:45 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) 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 <https://github.com/webspiderteam/Bluetooth-DMM-For-Windows/files/11848521/HeartRateLE-master.1.zip> this was my starting point for connecting to meter. You can inspect it for understanding code. — Reply to this email directly, view it on GitHub <#39 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXXR5EF6ZJDKLBCBL4DXMWFWPANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXU33CCMMXWRW3XUMR3XMWFWPA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6GJ4.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

there was a vb winform example. did you see it?

You must be logged in to vote
2 replies
Comment options

Ah, no i didnt I was looking at the c# code and trying to decipher

Comment options

Comment options

btw you dont need to convert dll file you can use it as it is. you ony need to make main window

You must be logged in to vote
3 replies
Comment options

Sorry I dont understand?

Comment options

you can use my bluetooth.dmm.dll as referance and you can use it in vb.net

Comment options

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.

Comment options

That looks to be an amazing option. If I add the dll as a reference is there any docs on how to use it from vb? From: webspiderteam ***@***.***> Sent: Friday, June 23, 2023 5:46 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) you can use my bluetooth.dmm.dll as referance and you can use it in vb.net — Reply to this email directly, view it on GitHub <#39 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXQGGG2NF3FXASVIDQ3XMXB4JANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXQ4AIMFESJ5QCRJZI3XMXB4JA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6K3G.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
1 reply
Comment options

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
Comment options

That’s wonderful Where do I find the dll’s to reference for the import statements? Ive looked in the bin folder of the previous source and there arnt there and I cant build it as there are errors in visual studio J From: webspiderteam ***@***.***> Sent: Saturday, June 24, 2023 1:58 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Author ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) 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 — Reply to this email directly, view it on GitHub <#39 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXRIXBI3KHI5NP4KIFTXM3P7BANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you authored the thread. <https://github.com/notifications/beacon/ARX2CXS5XI3GX5YNR3I7Q7DXM3P7BA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL6UKE.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
0 replies
Comment options

@secureitall Here is project that I made in vb.net. download and make your changes as you wish.

BluetoothDMM_VB.NET.zip

its very basic stuffs. I only connected and got the values. also deceded them too...

You must be logged in to vote
0 replies
Comment options

Wow Wonderful this seems to make more sense to me. Ill let you know how I get on Superb Many Thanks James From: webspiderteam ***@***.***> Sent: Sunday, June 25, 2023 3:50 PM To: webspiderteam/Bluetooth-DMM-For-Windows ***@***.***> Cc: secureitall ***@***.***>; Mention ***@***.***> Subject: Re: [webspiderteam/Bluetooth-DMM-For-Windows] VB.net options (Discussion #39) @secureitall <https://github.com/secureitall> Here is project that I made in vb.net. download and make your changes as you wish. BluetoothDMM_VB.NET.zip <https://github.com/webspiderteam/Bluetooth-DMM-For-Windows/files/11860004/BluetoothDMM_VB.NET.zip> its very basic stuffs. I only connected and got the values. also deceded them too... — Reply to this email directly, view it on GitHub <#39 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ARX2CXWQT5ZAQNXQM3FWDT3XNBFYZANCNFSM6AAAAAAZPOAHIA> . You are receiving this because you were mentioned. <https://github.com/notifications/beacon/ARX2CXRRWQP6RL7TZTGRXW3XNBFYZA5CNFSM6AAAAAAZPOAHICWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAL66R2.gif> Message ID: ***@***.*** ***@***.***> >
You must be logged in to vote
1 reply
Comment options

that would be great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /