Announcement

Collapse
No announcement yet.

BT Mobilephone Plugin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • BT Mobilephone Plugin

    Hey guys,

    I've decided to release the plugin I wrote for myself to the public.

    Essentially its a bluetooth mobile phone plugin which has the following features:
    Phonebook download from the phone
    Pause/Resume Music based on call status
    Pause/Resume Music based on Siri status (for iPhone users)
    Siri Can be triggered through an RR command (In my setup I have a button via a car2pc adaptor mapped via ExecTBL.ini to trigger Siri)
    If you are on a phone call before entering the car, when RideRunner loads, the plugin will detect the phone is in a call and automatically pause the music
    If you manually dial a phone number using the phone keypad it still pauses and resumes the music when you are finished
    Phone is automatically reconnected upon disconnection
    And lastly phone audio is routed through the PC

    I have only included the source code and not a compiled DLL as this is not designed to be a production release, just for those that feel if existing bluetooth plugins don't meet their needs, then they can make their own!

    It is written in VB.NET and requires BlueSoleil. I have used this with BlueSoleil 8.0.395
    It does not use a wrapper DLL to call the BlueSoleil SDK, rather it interfaces directly with the BlueSoleil SDK DLL
    I used the documentation from http://www.bluesoleil.com/download/f..._UserGuide.pdf

    It requires that the phone mac address be inserted into the constructor of the BT class
    It requires that the phone be paired previously (this is for simplicity). The functionality is there within the BlueSoleil SDK to allow pairing on the fly.
    It is written using Visual Studio 2012.
    It has been tested on Windows 8 & Windows XP

    Credit to Lambo and his original bluetooth wrapper/plugin http://www.mp3car.com/rr-released-pl...ne-plugin.html which got me pointed towards the Bluesoleil SDK

    All I ask is if you do decide to release a plugin based on the code just give me a small mention

    If you have questions post away!

    Cheers,

    Asela
    Attached Files
    Last edited by Fox_Mulder; 12-19-2012, 12:58 AM.
    Fox Mulder
    2004 Toyota MR2
    Modified Intel Xeon E5450 3Ghz Quad Core 2GB RAM 160GB SSD M4ATX Xenarc 700TSV TS Toslink Audio BU353 DiNovo Mini Car2PC ODBII Bluetooth HF 16x2 Character LCD

  • #2
    Thanks for this share !
    I have an error into the BT.vb class:
    phoneAddr(5) =
    phoneAddr(4) =
    phoneAddr(3) =
    phoneAddr(2) =
    phoneAddr(1) =
    phoneAddr(0) =
    I have commented these lines and i can to compile !

    and you can also add, if you want the menuitem property for the dynamics menus:
    Case "menuitem"
    Properties = Chr(34) + "LOAD;MOBILECALL.skin" + Chr(34) + ",MobilePhone,Icons\Phone.png,MobilePhone,MobilePh one is selected"

    Comment


    • #3
      You have to place your phones mac address in for phoneAddr

      Like if your phones mac address is 00:11:22:33:44:55

      then you would have

      phoneAddr(5) = 0 '00
      phoneAddr(4) = 17 '11
      phoneAddr(3) = 34 '22
      phoneAddr(2) = 51 '33
      phoneAddr(1) = 68 '44
      phoneAddr(0) = 85 '55

      phoneAddr() has to be in decimal whereas your phones mac address in in hex. So a simple conversion between hex and decimal is needed

      http://www.statman.info/conversions/hexadecimal.html
      Last edited by Fox_Mulder; 12-10-2012, 05:19 AM.
      Fox Mulder
      2004 Toyota MR2
      Modified Intel Xeon E5450 3Ghz Quad Core 2GB RAM 160GB SSD M4ATX Xenarc 700TSV TS Toslink Audio BU353 DiNovo Mini Car2PC ODBII Bluetooth HF 16x2 Character LCD

      Comment


      • #4
        What code do i add for load the contacts list with the pictures of contacts

        Comment


        • #5
          To do that you will need to add a RR command to get the list of contacts in the RRExtension class. Contacts are stored as a list of type Contact in the BT class. I do not know of a way of transferring pictures off the phone for contacts. There seems to be an issue with my restoreConnection subroutine. It isn't actually really necessary unless the phone could possibly be paired with the computer before the plugin runs. I have updated the code attached in the first post.
          Fox Mulder
          2004 Toyota MR2
          Modified Intel Xeon E5450 3Ghz Quad Core 2GB RAM 160GB SSD M4ATX Xenarc 700TSV TS Toslink Audio BU353 DiNovo Mini Car2PC ODBII Bluetooth HF 16x2 Character LCD

          Comment


          • #6
            Originally posted by Fox_Mulder View Post
            To do that you will need to add a RR command to get the list of contacts in the RRExtension class. Contacts are stored as a list of type Contact in the BT class. I do not know of a way of transferring pictures off the phone for contacts. There seems to be an issue with my restoreConnection subroutine. It isn't actually really necessary unless the phone could possibly be paired with the computer before the plugin runs. I have updated the code attached in the first post.
            I know how to build a RR custom list, but i don't know how to use the contact class !

            Comment


            • #7
              this looks interesting , downloaded and will try it tomorrow
              View my worklog here

              Comment


              • #8
                nice plugin, im having some issues to connect to my phone, in a quick test im able to connect to phone, see phone name, and some other info, using .Dial(13234) doesnt seem to work for me. like i said a quick test. and outside RR, i import youre BT.vb Phonebook.vb and contact.vb to a test form. what i did was change the constructor sub


                Code:
                  Public Sub New(ByVal Address() As Byte)
                        name = "MR2"
                        initVars()
                        agService = BTSDK_INVALID_HANDLE
                        hfService = BTSDK_INVALID_HANDLE
                
                        ' Set phone_addr Here
                        phoneAddr = Address
                
                        'Prevent Garbage Collection
                        connEventGlobal = AddressOf connEvent
                        hfEventGlobal = AddressOf hfEvent
                
                        threadWaitForPhone = New Thread(AddressOf waitForPhone)
                        threadWaitForPhone.IsBackground = True
                        threadWaitForPhone.Start()
                
                    End Sub
                and on my form load i use this.


                Code:
                 
                 Dim Mac As String = "D4:20:6D:35:C2:80"
                 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
                        Try
                            Dim Mac() As String = Me.Mac.Split(CChar(":"))
                            Dim ADDRS(6) As Byte 
                            For i As Integer = 5 To 0 Step -1
                                ADDRS(i) = CByte("&H" & Mac(i))
                            Next
                            BT = New BT(ADDRS)
                        Catch ex As Exception
                       
                        End Try
                
                    End Sub
                Last edited by EL CAMINO; 12-24-2012, 01:52 PM.
                BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                RRTube ==> [View/Download Youtube Videos]
                WifiMan ==> [Wifi Manager]
                RRec ==> [Audio Capture]

                If You Want To Be Given Everything, Give Everything Up ...
                Bird York -- In The Deep --

                Comment


                • #9
                  I have done the same change that EL CAMINO into my plugin but i can't connect my phone !

                  code changed into the BT.vb class:
                  Code:
                    Public Sub New(ByVal Address() As Byte)
                          name = "MR2"
                          initVars()
                          agService = BTSDK_INVALID_HANDLE
                          hfService = BTSDK_INVALID_HANDLE
                  
                          ' Set phone_addr Here
                          phoneAddr = Address
                  
                          'Prevent Garbage Collection
                          connEventGlobal = AddressOf connEvent
                          hfEventGlobal = AddressOf hfEvent
                  
                          threadWaitForPhone = New Thread(AddressOf waitForPhone)
                          threadWaitForPhone.IsBackground = True
                          threadWaitForPhone.Start()
                  
                      End Sub
                  and

                  and this code into the RRExtension.vb class:
                  Code:
                      Public Sub Initialize(ByRef pluginDataPath As String)
                  
                          On Error Resume Next
                          If Directory.Exists(pluginDataPath) = False Then Directory.CreateDirectory(pluginDataPath)
                  
                          Dim Mac As String = "44:4E:1A:1C:C6:15"
                          Dim dt() As String = Mac.Split(CChar(":"))
                          Dim ADDRS(6) As Byte
                          For i As Integer = 5 To 0 Step -1
                              ADDRS(i) = CByte("&H" & dt(i))
                          Next
                          bluetooth = New BT(ADDRS)
                  
                      End Sub

                  Comment


                  • #10
                    I play with this plugin source and i don't understand why the plugin return nothing for:
                    phoneModel
                    phoneManufacturer

                    An idea please ?

                    Comment


                    • #11
                      I try to read the phone's contacts but my list is empty !
                      http://www.mp3car.com/rr-plugins/154...ne-plugin.html

                      Dim myphonebook As phoneBook = New phoneBook
                      Dim result As String = " 0 " & vbCrLf
                      For Each phonecontact In myphonebook.List
                      result = result & "LST" & phonecontact.Number & "||" & phonecontact.Name & vbCrLf
                      Next
                      SaveContactToFile(result, MainPath & "MyContacts.txt")
                      Where is my error please ?

                      Comment


                      • #12
                        I Hope someone can help out a newbie.

                        How do I install this plugin? I don't see any installer.

                        Thanks

                        Comment


                        • #13
                          This is only a source not a dll . Prefer the MobilePhone.NET plugin !

                          Comment


                          • #14
                            Originally posted by pierrotm777 View Post
                            This is only a source not a dll . Prefer the MobilePhone.NET plugin !
                            Hi,
                            I did put in my phones Bluetooth mac address and built it. If I put the dll in THE RR plugin folder it does not recognize it as a plugin.

                            Moblephone.net plugin crashes RR half the time with me starting and closing RR. I was hoping this might work better for me.

                            Comment


                            • #15
                              Originally posted by Philip21 View Post
                              Hi,
                              I did put in my phones Bluetooth mac address and built it. If I put the dll in THE RR plugin folder it does not recognize it as a plugin.

                              Moblephone.net plugin crashes RR half the time with me starting and closing RR. I was hoping this might work better for me.
                              This is a compiled version. I have added an .xml file where you need to add your phone's mac address !


                              NB:
                              This version isn't also complete that the MOBILEPHONE.NET
                              I should like to add an automatic load phone's book but need help and nobody want help me :-(

                              See the post #34 for download !!!
                              Last edited by pierrotm777; 08-26-2013, 06:15 AM.

                              Comment

                              Working...
                              X