0

I'm developing Sony smart watch extension and need to control over led. I have implemented active low power mode so watch back light can never go off. SO far its working good. But now i need to light the led when new data come from mobile app to watch. I am able to have that data in watch but at the same time i want to light the back light ON. I searched on official documentation and come to know about CONTROl_LED_INTENT in this link

I am calling this snippet at the time of data insertion

Intent intent = new Intent(Control.Intents. CONTROL_LED_INTENT); intent.putExtra(Control.Intents.EXTRA_ON_DURATION, 20); intent.putExtra(Control.Intents.EXTRA_OFF_DURATION, 50); intent.putExtra(Control.Intents.EXTRA_REPEATS, 2); intent.putExtra(Control.Intents.EXTRA_LED_COLOR, 1);

sendToHostApp(intent);

but not able to turn light on. How can i make light on.

kunal
  • 308
  • 3
  • 15
  • 1
    When you say "led", I assume you are referring to the screen, correct? So what you would like to achieve is to have the screen backlight switch on when you get new data to present, is this the question? – shellström Nov 03 '14 at 13:37
  • @shellström SONY ya i want backlight switch on when i get new data – kunal Nov 03 '14 at 13:46

2 Answers2

1

You can set the screen state to SCREEN_STATE_AUTO or SCREEN_STATE_ON as per the API References which effectively switches on the backlight of the screen.

https://developer.sony.com/reference/sony-addon-sdk/com/sonyericsson/extras/liveware/extension/util/control/ControlExtension#setScreenState(int)

An example of a snippet with this

Intent intent = new Intent(Control.Intents.CONTROL_SET_SCREEN_STATE_INTENT);
intent.putExtra(Control.Intents.EXTRA_SCREEN_STATE, Control.Intents.SCREEN_STATE_AUTO);
sendToHostApp(intent);
shellström
  • 1,417
  • 13
  • 29
0

Try a longer value. 20 milliseconds is 2 hundredths of a second. You may not be able to see it or the hardware may not be able to do that.

weston
  • 54,145
  • 21
  • 145
  • 203