Results 1 to 3 of 3

Thread: Bluetooth Scanner

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2015
    Posts
    29

    Bluetooth Scanner

    I have the following code that shows available COM Ports, allows me to write text and send it for display.

    PHP Code:
    Imports System
    Imports System
    .Threading
    Imports System
    .IO.Ports
    Imports System
    .ComponentModel

    Public Class Settings

        Dim myPort 
    As Array
        
    Delegate Sub SetTextCallBack(ByVal [text] As String)

        Private 
    Sub Settings_Load(sender As System.ObjectAs System.EventArgsHandles MyBase.Load

            myPort 
    IO.Ports.SerialPort.GetPortNames()
            
    PortComboBox.Items.AddRange(myPort)
            
    btn_Write.Enabled False

        End Sub

        
    Private Sub ComboBox1_SelectedIndexChanged(sender As ObjectAs EventArgs)

        
    End Sub

        
    Private Sub btn_Init_Click(sender As ObjectAs EventArgsHandles btn_Init.Click
            SerialPort1
    .PortName PortComboBox.Text
            SerialPort1
    .BaudRate BaudComboBox.Text
            SerialPort1
    .Open()

            
    btn_Init.Enabled False
            btn_Write
    .Enabled True
            btn_Close
    .Enabled True

        End Sub

        
    Private Sub btn_Write_Click(sender As ObjectAs EventArgsHandles btn_Write.Click

            SerialPort1
    .Write(InputTextBox.Text vbCr)

        
    End Sub

        
    Private Sub btn_Close_Click(sender As ObjectAs EventArgsHandles btn_Close.Click

            SerialPort1
    .Close()

            
    btn_Init.Enabled True
            btn_Write
    .Enabled False
            btn_Close
    .Enabled False
        End Sub

        
    Private Sub SerialPort1_DataReceived(sender As System.ObjectAs System.IO.Ports.SerialDataReceivedEventArgsHandles SerialPort1.DataReceived
            ReceivedText
    (SerialPort1.ReadExisting())
        
    End Sub

        
    Private Sub ReceivedText(ByVal [text] As String)
            If 
    Me.OutputTextBox.InvokeRequired Then
                Dim x 
    As New SetTextCallBack(AddressOf ReceivedText)
                
    Me.Invoke(x, New Object() {(text)})
            Else
                
    Me.OutputTextBox.Text &= [text]
            
    End If
        
    End Sub 
    I'm looking for a way to search for available Bluetooth connections and connect to a chosen Bluetooth device within the program. Any ideas?

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jan 2015
    Posts
    29

    Re: Bluetooth Scanner

    I guess a more accurate description of what I'm looking for is a bluetooth service discovery protocol

  3. #3
    Fanatic Member
    Join Date
    Jun 2006
    Posts
    615

    Re: Bluetooth Scanner

    Have you figured anything out about this? I'm interested in this as well
    If ive helped, RATE my post.

    If your thread is solved, and you got your answer, mark this thread Resolved.

    There is no other forum like VBFORUMS.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width