(I)에서 code로 된 것을 말로 풀어보자
1. 기본 low battery 흐름
[CODE] /* check whether battery is low or not */ if ((info->dat.ac == AC_OFF_LINE) && (info->dat.level == BATTERY_LEVEL_BAR_0)) { . update battery_status as low_battery if (!(info->stat & BATTERY_SENT_ALARM)) { info->stat |= BATTERY_SENT_ALARM; . send "battery=low" msg } /* add time counter */ b_time_inc(info, BATTERY_LOW_MSG_TIME); /* time to send msg? */ if ( (info->dat.voltage < BATTERY_VOL_LOW) && (info->time[BATTERY_LOW_MSG_TIME] >= BATTERY_MSG_LOW_INTERVAL) ) { . send "battery=low" msg b_time_clr(info, BATTERY_LOW_MSG_TIME); } } else { . it is not low battery. }[/CODE]
[CODE] /* check whether battery is low or not */ if ((info->dat.ac == AC_OFF_LINE) && (info->dat.level == BATTERY_LEVEL_BAR_0)) { . update battery_status as low_battery if (!(info->stat & BATTERY_SENT_ALARM)) { info->stat |= BATTERY_SENT_ALARM; . send "battery=low" msg } /* add time counter */ b_time_inc(info, BATTERY_LOW_MSG_TIME); /* time to send msg? */ if ( (info->dat.voltage < BATTERY_VOL_LOW) && (info->time[BATTERY_LOW_MSG_TIME] >= BATTERY_MSG_LOW_INTERVAL) ) { . send "battery=low" msg b_time_clr(info, BATTERY_LOW_MSG_TIME); } } else { . it is not low battery. }[/CODE]
2. PDA off가 들어가면...
[CODE] /* time to send msg? */ 안을 다음 routine으로 대체 if (info->dat.voltage < BATTERY_VOL_PDA_OFF) { /* system off */ if (info->time[BATTERY_OFF_MSG_TIME] >= BATTERY_MSG_PDA_OFF_INTERVAL) . send "battery=off" msg else b_time_inc(info, BATTERY_OFF_MSG_TIME); } else { b_time_clr(info, BATTERY_OFF_MSG_TIME); . send "battery=low" msg b_time_clr(info, BATTERY_LOW_MSG_TIME); }[/CODE]
[CODE] /* time to send msg? */ 안을 다음 routine으로 대체 if (info->dat.voltage < BATTERY_VOL_PDA_OFF) { /* system off */ if (info->time[BATTERY_OFF_MSG_TIME] >= BATTERY_MSG_PDA_OFF_INTERVAL) . send "battery=off" msg else b_time_inc(info, BATTERY_OFF_MSG_TIME); } else { b_time_clr(info, BATTERY_OFF_MSG_TIME); . send "battery=low" msg b_time_clr(info, BATTERY_LOW_MSG_TIME); }[/CODE]
3. PHONE 추가
지금까지는 평화로왔는데, PHONE이라는 손님 등장...
지금까지는 평화로왔는데, PHONE이라는 손님 등장...