2 * Copyright (c) 2015 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 int callback(alarm_id_t alarm_id, void* user_param)
27 printf("Alarm[%d] has expired at %s\n", alarm_id, ctime(¤t_time));
36 result = alarmmgr_add_periodic_alarm_withcb(5, QUANTUMIZE, callback, NULL, &alarm_id);
38 printf("fail to alarmmgr_add_periodic_alarm_withcb : error_code : %d\n", result);
40 result = alarmmgr_add_periodic_alarm_withcb(5, CUT_OFF, callback, NULL, &alarm_id);
42 printf("fail to alarmmgr_add_periodic_alarm_withcb : error_code : %d\n", result);
46 int main(int argc, char** argv)
51 mainloop = g_main_loop_new(NULL, FALSE);
52 result = alarmmgr_init("org.tizen.alarmmgr.periodic");
55 printf("fail to alarmmgr_init : error_code : %d\n", result);
59 g_main_loop_run(mainloop);