Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

led-request_color not working as expected

When I use 

led_request_color(LED_Id,LED_COLOR_GREEN,1)

 

I expected it to flash the GREEN LED once and once only but it continues to flash about once every 3 seconds

 

If I follow the above command by 

led_request_color(LED_Id,LED_COLOR_RED,1)

 

I expected it to flash RED once but it flashes alternately RED and GREEN.

 

Are my expectations that I should have seen a single GREEN flash followed by single RED flash?

 

Actual code I used is shown below and flashes  4 GREEN followed by RED GREEN RED?

 

if (led_request_color(LED_Id,LED_COLOR_GREEN,1) == BPS_FAILURE)
cout << "LED request failed, errno = " << errno << endl;


sleep(10000);

if (led_request_color(LED_Id,LED_COLOR_RED,1) == BPS_FAILURE)
cerr << "LED request failed, errno = " << errno << endl;

sleep(10000);

 

for this code I expected only one GREEN followed by one RED.

Trusted Contributor
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800
My Carrier: Rogers

Re: led-request_color not working as expected

I am in the same boat as you are. I'll post back If I figure out why it does that.

 

Maybe you should try to use the led_cancel when you want to stop the led from flashing?

Developer
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: led-request_color not working as expected

led_cancel works but it does so immediately so I  use it just before I set the new colour.

Highlighted
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: led-request_color not working as expected

Looks like an issue with the API.  I've escalated it to our development team.

 

For reference, this is logged in Issue Tracker here:  https://www.blackberry.com/jira/browse/TOOL-441

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker