4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
33 int noti_send(char *filename)
35 return heynoti_publish(filename);
38 int noti_add(const char *noti, void (*cb) (void *), void *data)
43 return heynoti_subscribe(noti_fd, noti, cb, data);
46 static void noti_init(void *data)
48 struct main_data *ad = (struct main_data*)data;
50 if ((ad->noti_fd = heynoti_init()) < 0) {
51 _E("Hey Notification Initialize failed");
54 if (heynoti_attach_handler(ad->noti_fd) != 0) {
55 _E("fail to attach hey noti handler");
59 noti_fd = heynoti_init();
61 _E("heynoti_init error");
65 if (heynoti_attach_handler(noti_fd) < 0) {
66 _E("heynoti_attach_handler error");
71 static void noti_exit(void *data)
73 struct main_data *ad = (struct main_data*)data;
75 heynoti_close(ad->noti_fd);
76 heynoti_close(noti_fd);
79 static const struct device_ops noti_device_ops = {
80 .priority = DEVICE_PRIORITY_NORMAL,
86 DEVICE_OPS_REGISTER(¬i_device_ops)