Is there a way to detect if a Broadcom Bluetooth device is turned on using
code?

Thanks to Unc, I know how to set the device:

HMODULE hBFM = LoadLibrary(TEXT("BtFlightModeCtl.dll"));
if (hBFM)
{
HRESULT (WINAPI *OEMSetBthPowerState)(DWORD);
OEMSetBthPowerState =
(HRESULT (WINAPI*)(DWORD))
(GetProcAddress(hBFM, TEXT("OEMSetBthPowerState")));
}

where:
OEMSetBthPowerState(TRUE)
turns a Broadcom device ON

and:
OEMSetBthPowerState(FALSE)
turns a Broadcom device OFF


But, if the device is already turned on when I start my code, I want to
leave it on whenever I am done.

Re: Broadcom Bluetooth by ctacke/>

ctacke/>
Fri Aug 10 13:59:17 CDT 2007

I don't know the answer, but just based on your code I'd be inclined to at
least try to GetProcAddress for something that looks like one of these:

DWORD OEMGetBthPowerState();
DWORD OEMGetBthPowerState(DOWRD *state);

Who knows, you might get lucky.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com



"jp2code" <poojo.com/mail> wrote in message
news:eFvyZ$22HHA.4184@TK2MSFTNGP06.phx.gbl...
> Is there a way to detect if a Broadcom Bluetooth device is turned on using
> code?
>
> Thanks to Unc, I know how to set the device:
>
> HMODULE hBFM = LoadLibrary(TEXT("BtFlightModeCtl.dll"));
> if (hBFM)
> {
> HRESULT (WINAPI *OEMSetBthPowerState)(DWORD);
> OEMSetBthPowerState =
> (HRESULT (WINAPI*)(DWORD))
> (GetProcAddress(hBFM, TEXT("OEMSetBthPowerState")));
> }
>
> where:
> OEMSetBthPowerState(TRUE)
> turns a Broadcom device ON
>
> and:
> OEMSetBthPowerState(FALSE)
> turns a Broadcom device OFF
>
>
> But, if the device is already turned on when I start my code, I want to
> leave it on whenever I am done.
>
>



Re: Broadcom Bluetooth by jp2code

jp2code
Fri Aug 10 14:36:42 CDT 2007

Good advice!

m_OEMGetBthPowerState = (HRESULT (WINAPI*)(DWORD*))(GetProcAddress(m_hBFM,
TEXT("OEMGetBthPowerState")));

...and it worked!

Is there any way to dig tools out of an API?

"<ctacke/>" wrote:
>I don't know the answer, but just based on your code I'd be inclined to at
>least try to GetProcAddress for something that looks like one of these:
>
> DWORD OEMGetBthPowerState();
> DWORD OEMGetBthPowerState(DOWRD *state);
>
> Who knows, you might get lucky.
>
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Managed Code in an Embedded World
> www.OpenNETCF.com
>
>
>
> poojo wrote:
>> Is there a way to detect if a Broadcom Bluetooth device is turned on
>> using code?
>>
>> Thanks to Unc, I know how to set the device:
>>
>> HMODULE hBFM = LoadLibrary(TEXT("BtFlightModeCtl.dll"));
>> if (hBFM)
>> {
>> HRESULT (WINAPI *OEMSetBthPowerState)(DWORD);
>> OEMSetBthPowerState =
>> (HRESULT (WINAPI*)(DWORD))
>> (GetProcAddress(hBFM, TEXT("OEMSetBthPowerState")));
>> }
>>
>> where:
>> OEMSetBthPowerState(TRUE)
>> turns a Broadcom device ON
>>
>> and:
>> OEMSetBthPowerState(FALSE)
>> turns a Broadcom device OFF
>>
>>
>> But, if the device is already turned on when I start my code, I want to
>> leave it on whenever I am done.
>>
>>
>
>



Re: Broadcom Bluetooth by Uncle

Uncle
Mon Aug 13 03:50:21 CDT 2007


> OEMSetBthPowerState(FALSE)
> turns a Broadcom device OFF
>
You're just lucky. Mine won't turn off using that API. :-)



Re: Broadcom Bluetooth by Uncle

Uncle
Mon Aug 13 06:43:58 CDT 2007

In reply to jp2code (poojo.com/mail) who wrote this in
utP$HX42HHA.1208@TK2MSFTNGP05.phx.gbl, I, Marvo, say :

> Good advice!
>
> m_OEMGetBthPowerState = (HRESULT
> (WINAPI*)(DWORD*))(GetProcAddress(m_hBFM,
> TEXT("OEMGetBthPowerState")));
> ...and it worked!
>
> Is there any way to dig tools out of an API?
>
I think you're talking about the equivalent of "depends.exe" (Dependency
Walker) which you'd use on a PC. I don't know if there is one for PPC.



Re: Broadcom Bluetooth by jp2code

jp2code
Mon Aug 13 08:34:11 CDT 2007

Hey Unc,

Have you seen this site?
http://tinyurl.com/2xlh2s

The url will redirect you to the TekSoftCo website.

I was just given this site myself a few minutes ago, so I can't tell you if
it will be a wealth of help.

"Uncle Marvo" wrote:
>
>> OEMSetBthPowerState(FALSE)
>> turns a Broadcom device OFF
>>
> You're just lucky. Mine won't turn off using that API. :-)
>



Re: Broadcom Bluetooth by Uncle

Uncle
Mon Aug 13 09:04:19 CDT 2007

In reply to jp2code (poojo.com/mail) who wrote this in
e5RGg6a3HHA.5740@TK2MSFTNGP04.phx.gbl, I, Marvo, say :

> Hey Unc,
>
> Have you seen this site?
> http://tinyurl.com/2xlh2s
>
> The url will redirect you to the TekSoftCo website.
>
> I was just given this site myself a few minutes ago, so I can't tell
> you if it will be a wealth of help.
>
It is a wealth of help. It doesn't perform exactly as advertised but I have
turned the thing off and on. Seems to work sort of randomly but I'm sure
that will be figured out.

Thanks, JP and thanks, Radu!

I'd like to know where you get these "unpublished" ordinals and calls from
:-)



Re: Broadcom Bluetooth by Uncle

Uncle
Mon Aug 13 09:12:52 CDT 2007

In reply to Uncle Marvo (paul.r@deletethisbitfortescue.org.uk) who wrote
this in 5ib6nlF3ofrquU1@mid.individual.net, I, Marvo, say :

> In reply to jp2code (poojo.com/mail) who wrote this in
> e5RGg6a3HHA.5740@TK2MSFTNGP04.phx.gbl, I, Marvo, say :
>
>> Hey Unc,
>>
>> Have you seen this site?
>> http://tinyurl.com/2xlh2s
>>
>> The url will redirect you to the TekSoftCo website.
>>
EEEEK!

I used the .exe file, it turned off all devices, and when I tried to turn
them on again, the Bluetooth device and tray icon have both "disappeared".
My PPC is telling me to insert a module to turn it back on!

Still, it's doing *something*

:-)



Re: Broadcom Bluetooth by jp2code

jp2code
Mon Aug 13 10:04:49 CDT 2007

Sounds like you are having a good time over there, chap!

It certainly makes one appreciate devices on the shelf that has
functionality built in that works every time!

"Uncle Marvo" exclaimed:
> EEEEK!
>
> I used the .exe file, it turned off all devices, and when I tried to turn
> them on again, the Bluetooth device and tray icon have both "disappeared".
> My PPC is telling me to insert a module to turn it back on!
>
> Still, it's doing *something*
>
> :-)
>



Re: Broadcom Bluetooth by Uncle

Uncle
Mon Aug 13 10:11:41 CDT 2007

In reply to jp2code (poojo.com/mail) who wrote this in
uloGJtb3HHA.5160@TK2MSFTNGP05.phx.gbl, I, Marvo, say :

Certainly am. I've found workarounds. That Radu is one smart cookie :-)

> Sounds like you are having a good time over there, chap!
>
> It certainly makes one appreciate devices on the shelf that has
> functionality built in that works every time!
>
> "Uncle Marvo" exclaimed:
>> EEEEK!
>>
>> I used the .exe file, it turned off all devices, and when I tried to
>> turn them on again, the Bluetooth device and tray icon have both
>> "disappeared". My PPC is telling me to insert a module to turn it
>> back on! Still, it's doing *something*
>>
>> :-)