Author Topic: How to activate SPP and Dialup services  (Read 7671 times)

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
How to activate SPP and Dialup services
« on: May 30, 2007, 04:48:15 PM »
Hello,

I'm currently experimenting Bluetooth framework ActiveX to replace our own made componant. In our componant, on MS stack, we were activating SPP and Dialup services after pairing using BluetoothSetServiceState. I'd like to have the same behavior but I can't find how to do that with BF API.

I've tryed the following code but it doesn't seems to work...

Code: [Select]
BFClientXClass BFClientX = new BFClientXClass();

BFClientX.BluetoothTransport.ServiceUUID = BTservice.UUID;
BFClientX.BluetoothTransport.Authentication = false;
BFClientX.BluetoothTransport.Encryption = false;
BFClientX.BluetoothTransport.Device = BTDevice;
BFBluetoothDiscoveryXClass btDiscovery = new BFBluetoothDiscoveryXClass();
BFBluetoothRadiosX radios =  btDiscovery.EnumRadios();

if(radios.Count > 0)
   BFClientX.BluetoothTransport.Device.Radio = radios.get_Radio(0);



BFClientX.Transport = BluetoothFrameworkX.BFAPITransportX.atBluetooth;
try
{
   BFClientX.Open();
}
catch(Exception ex)
{
   Log.Warning("Unable to start BT service : "+ ex.Message);
}

Can you help me to get both SPP and Dialup services activated ?
Thanks

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #1 on: May 30, 2007, 04:52:06 PM »
Good time of the day!

Do you want connect to that service or create the COM port association?

If first - use the BFSerialPortClientX component (by default it connects to SerialPort profile, changing ServiceUUID you can connect to DUN as well).
If second - use BFBluetoothCOMPortCreatorX (by default is use the SerialPort too).
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #2 on: May 31, 2007, 09:38:43 AM »
Hello,

I'd like to activate the services to allow them to be checked in "bluetooth panel > device properties > services".

If I use the bluetoothCOMPortCreator, I get an exception telling that the COM Port can not be created. If I use BFSerialPortClientX, I manage to open a connection but the serial port service will not be enabled.

I need the services to be activated to get the COM prt always mounted when the BT device is near my computer.


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #3 on: May 31, 2007, 05:53:03 PM »
OK. I see now. But in any case - the better way is using direct Bluetooth connection without any com ports.

P.S. It is a MS api bug I can't fix - the first call of Open raises an error because driver for COM port not installed yet - the second will success. I am working on fix that problem.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #4 on: May 31, 2007, 11:36:03 PM »
Good day!
I have found the problem with creating COM port under MS stack. The problem was in incorrect COM number detection (not in Service creation).
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #5 on: June 05, 2007, 02:10:33 PM »
Hello,

the problem during COM port creation has disappeared with latest release  :)
But, I still have my problem when trying to enable SPP and DUN services. If I use the COM port creator, it's working well but only until I release the object. Is there any to allow the port to be always present just like it does when you manually enable these services ?

Thanks

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #6 on: June 05, 2007, 02:14:56 PM »
Well. It is correct. COM port creator relase the created port when closed. But i can add new functionality for you when it will leave the created port in the system. Till this evening will done.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #7 on: June 05, 2007, 05:22:45 PM »
Hello,

thanks for your help.
If you implements this feature, It will be great.

I have another question for you : how can I retrieve the COM port associated to a device ?
If I detect an already paired BT device during discovery how can I found its associated COM port ? I guess I can not use the COM port creator because it's only creating the COM port... or i'm wrong and the COM port creator can retrieved without  recreating an existing COM port...


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #8 on: June 05, 2007, 05:33:46 PM »
I will add this feature too :) It takes a bit time - but I hope tomorrow will done.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #9 on: June 07, 2007, 08:49:49 AM »
Hello,

can you send me a mail when the newest release with these features will be ready ? With these features, I think I would have all I need.

Thanks

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #10 on: June 07, 2007, 10:15:48 AM »
Good day!

Sure i will do. The problem I have found the bug with Nokia 6021 and BlueSoleil - want fix it before send the release.

Thank you.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #11 on: June 11, 2007, 09:33:58 AM »
Hello,

I've seen that you have release bluetooth Framework 5.2.2 yestarday. I've tryed to use it but I can't see the changes you say you will perform to activate service and to reuse already created COM ports.

Are these changes in this release ? If yes, how can I use them ?

Thanks


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #12 on: June 11, 2007, 12:24:42 PM »
Good day!

It is more hot-fix than release ;) I am really sorry, but I have not complete it yet. There was a bit hotest tasks (have found the problem with nokias phones and fixed that). But today I have start work on your tasks. I will publish message here when it done.

Thank you.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Re: How to activate SPP and Dialup services
« Reply #13 on: June 11, 2007, 08:16:15 PM »
Here is. BFCOMPortCreateorX has new property Permanent now. Set it to True and the port will not be destroyd after closing.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline Groumf

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: How to activate SPP and Dialup services
« Reply #14 on: June 12, 2007, 06:17:55 PM »
Hello,

the newest property works well but it seems that, with this release, the discovery has some problems.

I want my application to notify user when a new device is detected so I have a thread that perform a full discovery (a slow and blocking discovery with services retrival). With the other release I can't see any problem but with this one, the appliction hangs when I call BFBluetoothDevicesX.Discovery(radio, false, true, true). I spend some time to find what can be wrong in my code but I have found nothing at this time. I will look more deeply into it tomorrow.

Do you have any idea that can help me to solve the problem ?
Thanks