본문으로 건너뛰기
안드로이드 메인보드 · 터치 디스플레이 · 펌웨어 — 2013년부터

Power and scheduling

Static methodsBroadcast — returns void

Immediate power control and time-based scheduling. Every function here returns void and acts asynchronously — see the overview.

Schedules are the reason this API exists for most kiosk and signage builds: a board that powers itself down overnight and back up before opening hours.

Immediate control​

MethodAction
reboot(context)Restart the device now
powerOff(context)Shut down now
sleep(context)Enter sleep (screen off, low power)
wakeup(context)Wake from sleep
import com.itemp.itempapi.ItempApiPub;

ItempApiPub.reboot(context);
// Sleep at close, wake at open — driven by your own logic or a scheduled task.
ItempApiPub.sleep(context);
// ...later...
ItempApiPub.wakeup(context);

Scheduled power off​

public static void setPowerOffTime(
Context context,
String offHour, // "0" - "23" (24-hour)
String offMin, // "0" - "59"
String offWeek, // "0" - "7" (see day codes below)
boolean enable) // true = schedule on, false = cancel
// Power off every day at 22:30.
ItempApiPub.setPowerOffTime(context, "22", "30", "0", true);

Day codes​

The offWeek / onWeek argument is a single day, not a bitmask:

CodeDay
"0"Every day
"1"Sunday
"2"Monday
"3"Tuesday
"4"Wednesday
"5"Thursday
"6"Friday
"7"Saturday

To schedule several specific days, call the function once per day. "0" (every day) is the common case for signage.

Scheduled power on​

public static void setPowerOnTime(
Context context,
String onHour, // "0" - "23"
String onMin, // "0" - "59"
String onWeek, // "0" - "7" (same day codes as above)
boolean enable)
// Power on every day at 08:00.
ItempApiPub.setPowerOnTime(context, "8", "0", "0", true);

Scheduled reboot​

A daily reboot is a cheap way to clear memory leaks in a long-running kiosk app.

public static void setRebootTime(
Context context,
String rebootHour, // "0" - "23"
String rebootMin, // "0" - "59"
boolean rebootEnable)
// Reboot every night at 04:00, when nobody is using the device.
ItempApiPub.setRebootTime(context, "4", "0", true);

Notes​

Cancel by calling again with enable = false. There is no separate clear function. The hour/minute you pass when disabling are ignored.

Hour and minute are strings, not ints. "8" works; 8 will not compile. Do not zero-pad — the firmware expects "8", not "08".

A power-off schedule only fires if the device is on at that time, and a power-on schedule requires the board to still have standby power. If you cut mains power entirely, the scheduled wake cannot run.

No confirmation. None of these return whether the schedule was accepted. To verify, set the schedule, let it fire once, and confirm the device behaved. There is no getter for the current schedule.

  • System time — set the clock the schedule runs against
  • Overview — why these calls return void