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));
37 result = alarmmgr_add_reference_periodic_alarm_withcb(1, callback, NULL, &alarm_id);
40 printf("alarmmgr_add_reference_periodic_alarm_withcb : error_code : %d\n", result);
43 int main(int argc, char** argv)
48 mainloop = g_main_loop_new(NULL, FALSE);
49 result = alarmmgr_init("org.tizen.alarmmgr.refperiodic");
52 printf("fail to alarmmgr_init : error_code : %d\n", result);
56 g_main_loop_run(mainloop);