3 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * PROPRIETARY/CONFIDENTIAL
6 * This software is the confidential and proprietary information of SAMSUNG
7 * ELECTRONICS ("Confidential Information"). You agree and acknowledge that
8 * this software is owned by Samsung and you shall not disclose such
9 * Confidential Information and shall use it only in accordance with the terms
10 * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
11 * make no representations or warranties about the suitability of the software,
12 * either express or implied, including but not limited to the implied
13 * warranties of merchantability, fitness for a particular purpose, or
14 * non-infringement. SAMSUNG shall not be liable for any damages suffered by
15 * licensee arising out of or related to this software.
33 static void lock(int state)
36 err = power_lock_state(state, 0);
37 if(err == POWER_ERROR_NONE){
38 if(state >= POWER_STATE_NORMAL && state <= POWER_STATE_SCREEN_OFF)
39 printf("lock state [%s] locked\n", sname[state]);
41 printf("unknown state\n");
43 printf("power_lock_state fail\n");
47 static void unlock(int state)
49 if(power_unlock_state(state) == POWER_ERROR_NONE){
50 if(state >= POWER_STATE_NORMAL && state <= POWER_STATE_SCREEN_OFF)
51 printf("lock state [%s] unlocked\n", sname[state]);
53 printf("unknown state\n");
55 printf("power_unlock_state fail\n");
59 static void to_use(int state, int sleeptime)
66 static void pulse(int sleeptime)
69 power_lock_state(POWER_STATE_SCREEN_DIM, 1000);
70 power_lock_state(POWER_STATE_SCREEN_OFF, 10000);
71 power_lock_state(POWER_STATE_SCREEN_DIM, 1000);
72 power_lock_state(POWER_STATE_NORMAL, 1000);
78 int main(int argc, char *argv[])
85 printf("1 : Normal\n");
86 printf("2 : Screen Dim\n");
87 printf("3 : Screen Off\n");
88 printf("4 : pulse test\n");
91 switch(m = atoi(argv[1]))
94 state = POWER_STATE_NORMAL;
95 printf("normal!!!\n");
98 state = POWER_STATE_SCREEN_DIM;
102 state = POWER_STATE_SCREEN_OFF;
110 sleeptime = atoi(argv[2]);
113 to_use(state, sleeptime);