Click here to Skip to main content
15,892,746 members
Home / Discussions / Mobile
   

Mobile

 
QuestionNotification icon in the system tray Pin
AndriyBabiy24-Aug-06 11:37
AndriyBabiy24-Aug-06 11:37 
QuestionIncoming Call Notification compact framework Pin
deanxp23-Aug-06 4:30
deanxp23-Aug-06 4:30 
QuestionMobile applications for simple cell phones Pin
AmitDey22-Aug-06 18:57
AmitDey22-Aug-06 18:57 
AnswerRe: Mobile applications for simple cell phones Pin
alexey N22-Aug-06 21:17
alexey N22-Aug-06 21:17 
QuestionSQL CE Connections Pin
DazJack122-Aug-06 3:13
DazJack122-Aug-06 3:13 
AnswerRe: SQL CE Connections Pin
Chris S Kaiser28-Aug-06 11:09
Chris S Kaiser28-Aug-06 11:09 
Questionintroduction Pin
abhi851921-Aug-06 5:56
abhi851921-Aug-06 5:56 
QuestionTrying to connect to BT headset programatically, but can't make it work !! Pin
PG200617-Aug-06 12:47
PG200617-Aug-06 12:47 
Hi,

I hope someone can help me !

I'm trying to programatically make a connection to Bluetooth headset
from WM5 device.

Using the GU interface provided on the device, I can
a. discover the headset device, and authenicate
b. Select the headset service, however I'm not certain what is actually
done programatically when perform this selection in the GUI
c. Redirect the audio of the WM5 device to the headset.using the
following code:

HANDLE h = CreateFile(L"BAG0:",0,0,NULL,OPEN_EXISTING,0,NULL);
BOOL status = DeviceIoControl(h,IOCTL_AG_OPEN_AUDIO,NULL,0,NULL,0,NULL,NULL);
CloseHandle(h);

This all works fine !

Now If I try to achieve allow of the above without using the GUI of the device:

The following code allows me to cnnect to a headset and authenicate

if (ERROR_SUCCESS == BthCreateACLConnection (&b, &h)) {
iRes = BthAuthenticate (&b);
BthCloseConnection (h);

I was then expecting to use the the audio gateway to redirect
audio to the headset. But I can't see how this can work as at this
point I've only connected to the bluetooth device and not the headset
service, so the AG wouldn't know which device to connect to !

If I add code to connect to the headset service as shown below :

SOCKET s = socket (AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
SOCKADDR_BTH sab;
memset (&sab, 0, sizeof(sab));
sab.addressFamily = AF_BTH;
sab.serviceClassId = HeadsetServiceClass_UUID;
sab.btAddr = b;

if (0 != connect (s, (const sockaddr *)&sab, sizeof(sab))) {

then althought the above code connects to the headset, the connection is
terminated by the headset about ten seconds after its made.
If I use the same code to connect to a another service the connection
is not terminated.

Additionally if I try to get the AG to redirect to the Headset whilst I'm connected
to it, I can open the device BAG0:, but the IOCTL's return error 5, unable to access
device.

One thing I have noticed is that the registry doesn't contain any setting under :

HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\AudioGateway

But this doesn't seem to stop my using the same code to redirect the audio
if the GUI is used to establish the connection to the headset

Can you give me some pointers as I'm running out of ideas !?!

Cheers

Paul Grant
QuestionMedia player Pin
Mohammad A Gdeisat16-Aug-06 22:38
Mohammad A Gdeisat16-Aug-06 22:38 
QuestionCompact framework File Existing..... Pin
Sri harini14-Aug-06 23:35
Sri harini14-Aug-06 23:35 
QuestionDynamically Adding Controls to a Panel Pin
RB@Emphasys14-Aug-06 10:22
RB@Emphasys14-Aug-06 10:22 
AnswerRe: Dynamically Adding Controls to a Panel Pin
RB@Emphasys14-Aug-06 10:43
RB@Emphasys14-Aug-06 10:43 
QuestionHow to operate Excel on Pocket PC by using C#? Pin
blackmash11-Aug-06 22:01
blackmash11-Aug-06 22:01 
QuestionListview in windows mobile Pin
Sri harini9-Aug-06 22:09
Sri harini9-Aug-06 22:09 
AnswerRe: Listview in windows mobile Pin
lincyang15-Jan-09 20:51
lincyang15-Jan-09 20:51 
QuestionWindows Mobile 2003 Pocket PC or 5.0 Sample Applications/Code/Tutorial? Pin
Coolarj109-Aug-06 13:38
Coolarj109-Aug-06 13:38 
AnswerRe: Windows Mobile 2003 Pocket PC or 5.0 Sample Applications/Code/Tutorial? [modified] Pin
Michael Hendrickx20-Aug-06 0:39
Michael Hendrickx20-Aug-06 0:39 
QuestionHow to overwrite the power button in a pocket PC? Pin
msolh7-Aug-06 10:23
msolh7-Aug-06 10:23 
QuestionHelp Required for Development of Mobile Application on Window Mobile platform 5.0 [modified] Pin
phijophlip4-Aug-06 0:50
phijophlip4-Aug-06 0:50 
AnswerRe: Help Required for Development of Mobile Application on Window Mobile platform 5.0 Pin
Sarvesvara (BVKS) Dasa5-Aug-06 17:47
Sarvesvara (BVKS) Dasa5-Aug-06 17:47 
QuestionCombo Box in ListView Pin
kakarato3-Aug-06 23:42
kakarato3-Aug-06 23:42 
Questionsending data to the server using webservice Pin
lj_163-Aug-06 22:33
lj_163-Aug-06 22:33 
QuestionMerge Replication. Pin
R.Hariharan3-Aug-06 0:35
R.Hariharan3-Aug-06 0:35 
QuestionWindows Mobile 5.0 == Windows Mobile 2005? Pin
George_George1-Aug-06 22:44
George_George1-Aug-06 22:44 
AnswerRe: Windows Mobile 5.0 == Windows Mobile 2005? Pin
Mohammad A Gdeisat2-Aug-06 12:05
Mohammad A Gdeisat2-Aug-06 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.