Groups > Palm OS > Bluetooth Forum > Re: Informing user BT is connected (charge LED?)




Re: Informing user BT is connected (charge LED?)

Re: Informing user BT is connected (charge LED?)
Wed, 30 Aug 2006 14:19:41 -050
you can. the way to do it reliably and on all devices is not
officially documented but not too hard. here:

Err HwrLEDAttributes(Boolean set,UInt16 op,void* data)
 SYS_TRAP(sysTrapHwrLEDAttributes)

//set=true to set a value, set=false to get it.
//
//  *For the second parameter, the following can be used
//
//  *value points to a Boolean stating the state of the LED
//
//  #define kHwrLEDActive                     1
//
//  *value points to a UInt16, specifying the length of one cycle.
//  *value is in ticks (1/100 seconds)
//
//  #define kHwrLEDRate                       2
//
//  * value points to a UInt32, specifying the pattern of LED blinking
//  * example:
//     0xFFFFFFFF    stay on
//     0x0F0F0F0F    blink four times in equal intervals
//     0xAAAAAAAA    blink really fast
//     0x0F0F0000    blink twice, then pause
//
//  #define kHwrLEDPattern                    3
//
//  *value points to a UInt16, specifying the delay between two
//  *cycles in ticks
//
//  #define kHwrLEDDelay                      4
//
//  *value points to a UInt16 specifying the amount of repeats
//
//  #define kHwrLEDRepeatCount                5


also do not expect state to stay for long as system can change it
anytime (like if an alarm goes off).

pretty much to turn it on, set pattern to 0xFFFFFFFF, repeat count to
something large, rate to something large, and then active to "true",
to turn off, just set active to false.



if you are curious, for vibrate control it is the same, expect the api
is HwrVibrateAttributes, with the prototype of


Err HwrVibrateAttributes(Boolean set,UInt16 op,void* data)
 SYS_TRAP(sysTrapHwrVibrateAttributes)




On 8/30/06, Luc Le Blanc <lleblanc@cam.org> wrote:
> My app needs to connect to a Bluetooth-enabled laser distancemeter (namely
a Leica Disto). At the tap of a button on the Palm, I establish the connection
and wait for data. Is there a way I can blink, flash or just light the charge
LED on the device (if any) to indicate a connection is setup? Or is there
another standard way to inform the user?
>
>
> Luc Le Blanc
> --
> For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/
>


-- 
Best Regards, Dmitry Grinberg
Software Engineer, http://PalmPowerups.com
(847) 226 9295
AIM: DmitryGrinberg
MSN: dmitrygr@attbi.com
ICQ: 165589894
Y! IM: dmitrygr2003
Post Reply
Informing user BT is connected (charge LED?)
Wed, 30 Aug 2006 19:06:33 -000
My app needs to connect to a Bluetooth-enabled laser distancemeter (namely a
Leica Disto). At the tap of a button on the Palm, I establish the connection and
wait for data. Is there a way I can blink, flash or just light the charge LED on
the device (if any) to indicate a connection is setup? Or is there another
standard way to inform the user?


Luc Le Blanc
Post Reply
Re: Informing user BT is connected (charge LED?)
Wed, 30 Aug 2006 22:08:37 -050
you forgot  to set repeat count, delay, and then set "Active" to 1
all of those need to be done

On 8/30/06, Luc Le Blanc <lleblanc@cam.org> wrote:
> I do
>
> UInt32 led = 0x0F0F0000;
>
> HwrLEDAttributes( true, kHwrLEDPattern, &led );
>
> but nothing flashes on my T3. Did I miss something?
>
>
> --
> Luc Le Blanc
>
>
> Dmitry Grinberg wrote:
> > you can. the way to do it reliably and on all devices is not
> > officially documented but not too hard. here:
> >
> > Err HwrLEDAttributes(Boolean set,UInt16 op,void* data)
> > SYS_TRAP(sysTrapHwrLEDAttributes)
> >
> > //set=true to set a value, set=false to get it.
> > //
> > //  *For the second parameter, the following can be used
> > //
> > //  *value points to a Boolean stating the state of the LED
> > //
> > //  #define kHwrLEDActive                     1
> > //
> > //  *value points to a UInt16, specifying the length of one cycle.
> > //  *value is in ticks (1/100 seconds)
> > //
> > //  #define kHwrLEDRate                       2
> > //
> > //  * value points to a UInt32, specifying the pattern of LED
blinking
> > //  * example:
> > //     0xFFFFFFFF    stay on
> > //     0x0F0F0F0F    blink four times in equal intervals
> > //     0xAAAAAAAA    blink really fast
> > //     0x0F0F0000    blink twice, then pause
> > //
> > //  #define kHwrLEDPattern                    3
> > //
> > //  *value points to a UInt16, specifying the delay between two
> > //  *cycles in ticks
> > //
> > //  #define kHwrLEDDelay                      4
> > //
> > //  *value points to a UInt16 specifying the amount of repeats
> > //
> > //  #define kHwrLEDRepeatCount                5
> >
> >
> > also do not expect state to stay for long as system can change it
> > anytime (like if an alarm goes off).
> >
> > pretty much to turn it on, set pattern to 0xFFFFFFFF, repeat count to
> > something large, rate to something large, and then active to
"true",
> > to turn off, just set active to false.
> >
> >
> >
> > if you are curious, for vibrate control it is the same, expect the
api
> > is HwrVibrateAttributes, with the prototype of
> >
> >
> > Err HwrVibrateAttributes(Boolean set,UInt16 op,void* data)
> > SYS_TRAP(sysTrapHwrVibrateAttributes)
> >
> >
> >
> >
> > On 8/30/06, Luc Le Blanc <lleblanc@cam.org> wrote:
> >> My app needs to connect to a Bluetooth-enabled laser
distancemeter
> >> (namely a Leica Disto). At the tap of a button on the Palm, I
> >> establish the connection and wait for data. Is there a way I can
> >> blink, flash or just light the charge LED on the device (if any)
to
> >> indicate a connection is setup? Or is there another standard way
to
> >> inform the user?
> >>
> >>
> >> Luc Le Blanc
> >> --
> >> For information on using the PalmSource Developer Forums, or to
> >> unsubscribe, please see http://www.palmos.com/dev/support/forums/
> >>
> >
> >
>
>
> --
> Luc Le Blanc
>
> --
> For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/
>


-- 
Best Regards, Dmitry Grinberg
Software Engineer, http://PalmPowerups.com
(847) 226 9295
AIM: DmitryGrinberg
MSN: dmitrygr@attbi.com
ICQ: 165589894
Y! IM: dmitrygr2003
Post Reply
Re: Informing user BT is connected (charge LED?)
Wed, 30 Aug 2006 22:55:08 -040
I do

UInt32 led = 0x0F0F0000;

HwrLEDAttributes( true, kHwrLEDPattern, &led );

but nothing flashes on my T3. Did I miss something?


-- 
Luc Le Blanc


Dmitry Grinberg wrote:
> you can. the way to do it reliably and on all devices is not
> officially documented but not too hard. here:
> 
> Err HwrLEDAttributes(Boolean set,UInt16 op,void* data)
> SYS_TRAP(sysTrapHwrLEDAttributes)
> 
> //set=true to set a value, set=false to get it.
> //
> //  *For the second parameter, the following can be used
> //
> //  *value points to a Boolean stating the state of the LED
> //
> //  #define kHwrLEDActive                     1
> //
> //  *value points to a UInt16, specifying the length of one cycle.
> //  *value is in ticks (1/100 seconds)
> //
> //  #define kHwrLEDRate                       2
> //
> //  * value points to a UInt32, specifying the pattern of LED blinking
> //  * example:
> //     0xFFFFFFFF    stay on
> //     0x0F0F0F0F    blink four times in equal intervals
> //     0xAAAAAAAA    blink really fast
> //     0x0F0F0000    blink twice, then pause
> //
> //  #define kHwrLEDPattern                    3
> //
> //  *value points to a UInt16, specifying the delay between two
> //  *cycles in ticks
> //
> //  #define kHwrLEDDelay                      4
> //
> //  *value points to a UInt16 specifying the amount of repeats
> //
> //  #define kHwrLEDRepeatCount                5
> 
> 
> also do not expect state to stay for long as system can change it
> anytime (like if an alarm goes off).
> 
> pretty much to turn it on, set pattern to 0xFFFFFFFF, repeat count to
> something large, rate to something large, and then active to
"true",
> to turn off, just set active to false.
> 
> 
> 
> if you are curious, for vibrate control it is the same, expect the api
> is HwrVibrateAttributes, with the prototype of
> 
> 
> Err HwrVibrateAttributes(Boolean set,UInt16 op,void* data)
> SYS_TRAP(sysTrapHwrVibrateAttributes)
> 
> 
> 
> 
> On 8/30/06, Luc Le Blanc <lleblanc@cam.org> wrote:
>> My app needs to connect to a Bluetooth-enabled laser distancemeter 
>> (namely a Leica Disto). At the tap of a button on the Palm, I 
>> establish the connection and wait for data. Is there a way I can 
>> blink, flash or just light the charge LED on the device (if any) to 
>> indicate a connection is setup? Or is there another standard way to 
>> inform the user?
>>
>>
>> Luc Le Blanc
>> -- 
>> For information on using the PalmSource Developer Forums, or to 
>> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>>
> 
> 


-- 
Luc Le Blanc
Post Reply
Re: Informing user BT is connected (charge LED?)
Wed, 06 Sep 2006 22:57:13 -040
Dmitry Grinberg wrote:
> you forgot  to set repeat count, delay, and then set "Active" to
1
> all of those need to be done

I do:

UInt32          led = 0xFFFFFFFF;
Boolean         active = true;

HwrLEDAttributes( true, kHwrLEDPattern, &led );
HwrLEDAttributes( true, kHwrLEDActive, &active );

and nothing happens on the T3 :(


-- 
Luc Le Blanc



>> Dmitry Grinberg wrote:
>> > you can. the way to do it reliably and on all devices is not
>> > officially documented but not too hard. here:
>> >
>> > Err HwrLEDAttributes(Boolean set,UInt16 op,void* data)
>> > SYS_TRAP(sysTrapHwrLEDAttributes)
>> >
>> > //set=true to set a value, set=false to get it.
>> > //
>> > //  *For the second parameter, the following can be used
>> > //
>> > //  *value points to a Boolean stating the state of the LED
>> > //
>> > //  #define kHwrLEDActive                     1
>> > //
>> > //  *value points to a UInt16, specifying the length of one
cycle.
>> > //  *value is in ticks (1/100 seconds)
>> > //
>> > //  #define kHwrLEDRate                       2
>> > //
>> > //  * value points to a UInt32, specifying the pattern of LED
blinking
>> > //  * example:
>> > //     0xFFFFFFFF    stay on
>> > //     0x0F0F0F0F    blink four times in equal intervals
>> > //     0xAAAAAAAA    blink really fast
>> > //     0x0F0F0000    blink twice, then pause
>> > //
>> > //  #define kHwrLEDPattern                    3
>> > //
>> > //  *value points to a UInt16, specifying the delay between two
>> > //  *cycles in ticks
>> > //
>> > //  #define kHwrLEDDelay                      4
>> > //
>> > //  *value points to a UInt16 specifying the amount of repeats
>> > //
>> > //  #define kHwrLEDRepeatCount                5
>> >
>> >
>> > also do not expect state to stay for long as system can change it
>> > anytime (like if an alarm goes off).
>> >
>> > pretty much to turn it on, set pattern to 0xFFFFFFFF, repeat count
to
>> > something large, rate to something large, and then active to
"true",
>> > to turn off, just set active to false.
>> >
>> >
>> >
>> > if you are curious, for vibrate control it is the same, expect the
api
>> > is HwrVibrateAttributes, with the prototype of
>> >
>> >
>> > Err HwrVibrateAttributes(Boolean set,UInt16 op,void* data)
>> > SYS_TRAP(sysTrapHwrVibrateAttributes)
>> >
>> >
>> >
>> >
>> > On 8/30/06, Luc Le Blanc <lleblanc@cam.org> wrote:
>> >> My app needs to connect to a Bluetooth-enabled laser
distancemeter
>> >> (namely a Leica Disto). At the tap of a button on the Palm, I
>> >> establish the connection and wait for data. Is there a way I
can
>> >> blink, flash or just light the charge LED on the device (if
any) to
>> >> indicate a connection is setup? Or is there another standard
way to
>> >> inform the user?
>> >>
>> >>
>> >> Luc Le Blanc
>> >> --
>> >> For information on using the PalmSource Developer Forums, or
to
>> >> unsubscribe, please see
http://www.palmos.com/dev/support/forums/
>> >>
>> >
>> >
>>
>>
>> -- 
>> Luc Le Blanc
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact