SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align")
-ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG")
-ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"DAEMON\"")
+ADD_DEFINITIONS("-DFEATURE_TLOG_DEBUG")
+ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"TELEPHONY_DAEMON\"")
+ADD_DEFINITIONS("-DDAEMON_VERSION=\"${VERSION}\"")
MESSAGE(${CMAKE_C_FLAGS})
MESSAGE(${pkgs_LDFLAGS})
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resource/etc/rc.d/rc5.d/S30telephony-daemon DESTINATION /etc/rc.d/rc5.d/
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME telephony-daemon)
Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License version 2.1.
-
-The full text of the LGPL 2.1 can be found in
-/usr/share/common-licenses.
+it under the terms of the the Apache License, Version 2.0 (the "License");
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0.
+* Thu Mar 7 06:57:21 UTC 2013 - tracy.graydon@intel.com
+- Bump to 1.1.12 (same version in Main)
+
*Wed Nov 7 22:21:39 UTC 2012 - tracy.graydon@intel.com
- Add .changes file
- This prokect was forked from Tizen:Devel:Main to fix manifests for IVI
Name: telephony-daemon
Summary: Telephony daemon
-Version: 0.1.6
+Version: 0.1.12
Release: 1
Group: System/Telephony
License: Apache
%prep
%setup -q
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version}
make %{?jobs:-j%jobs}
%install
%make_install
+mkdir -p %{buildroot}/usr/share/license
%files
%manifest telephony-daemon.manifest
%{_initrddir}/telephony-daemon
%{_sysconfdir}/rc.d/rc3.d/S30telephony-daemon
%{_sysconfdir}/rc.d/rc5.d/S30telephony-daemon
+/usr/share/license/telephony-daemon
#!/bin/sh
-dlogutil -b radio -v time -f /var/log/seq.radio.log -r 1000 -n 10 &
+dlogutil -b radio -v time -f /var/log/seq.radio.log -r 4000 -n 3 &
if [ ! -e /opt/etc/.hib_capturing ]; then
/usr/bin/telephony-daemon &
#include <time.h>
#include <dlfcn.h>
#include <getopt.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysinfo.h>
#include <glib.h>
#include <glib-object.h>
+#include <dlog.h>
#include <tcore.h>
#include <plugin.h>
#include <server.h>
+#include <util.h>
+#include <log.h>
#include "monitor.h"
+#ifndef DAEMON_VERSION
+#define DAEMON_VERSION "unknown"
+#endif
+
static Server *_server;
+void tcore_log(enum tcore_log_type type, enum tcore_log_priority priority, const char *tag, const char *fmt, ...)
+{
+ va_list ap;
+ char buf[1024];
+
+ va_start(ap, fmt);
+ vsnprintf(buf, 1023, fmt, ap);
+ va_end(ap);
+
+ __dlog_print(type, priority, tag, buf);
+}
+
static gboolean load_plugins(Server *s, const char *path, int flag_test_load)
{
const gchar *file;
GDir *dir;
void *handle;
GSList *list;
+ struct stat stat_buf;
+ char file_date[27];
TcorePlugin *p;
struct tcore_plugin_define_desc *desc;
+ if (!path || !s)
+ return FALSE;
+
dir = g_dir_open(path, 0, NULL);
if (!dir)
return FALSE;
while ((file = g_dir_read_name(dir)) != NULL) {
- if (g_str_has_prefix(file, "lib") == TRUE || g_str_has_suffix(file, ".so") == FALSE)
+ if (g_str_has_prefix(file, "lib") == TRUE
+ || g_str_has_suffix(file, ".so") == FALSE)
continue;
filename = g_build_filename(path, file, NULL);
continue;
}
+ dbg("%s plugin", desc->name);
+ dbg(" - path = %s", filename);
+ dbg(" - version = %d", desc->version);
+ dbg(" - priority = %d", desc->priority);
+
+ memset(&stat_buf, 0, sizeof(struct stat));
+ if (stat(filename, &stat_buf) == 0) {
+ if (ctime_r(&stat_buf.st_mtime, file_date) != NULL) {
+ if (strlen(file_date) > 1)
+ file_date[strlen(file_date)-1] = '\0';
+
+ dbg(" - date = %s", file_date);
+ }
+ }
+
if (desc->load) {
if (desc->load() == FALSE) {
dbg("false return from load(). skip this plugin");
p = tcore_plugin_new(s, desc, filename, handle);
tcore_server_add_plugin(s, p);
- dbg("plugin(%s) added", filename);
+ dbg("%s added", desc->name);
g_free(filename);
}
g_dir_close(dir);
+ info("plugin load finished");
+
list = tcore_server_ref_plugins(s);
for (; list; list = list->next) {
p = list->data;
}
}
+ info("plugin init finished");
+
return TRUE;
}
{
struct sigaction sigact_usr1;
Server *s;
- int flag_test_load=0;
+ int flag_test_load = 0;
int opt;
int opt_index;
struct option options[] = {
{ 0, 0, 0, 0 }
};
char *plugin_path = "/usr/lib/telephony/plugins/";
+ char *tcore_ver;
+ struct sysinfo info;
+
+ if (sysinfo(&info) == 0) {
+ info("uptime: %ld secs", info.uptime);
+ }
+
+ info("daemon version: %s", DAEMON_VERSION);
+
+ tcore_ver = tcore_util_get_version();
+ info("libtcore version: %s", tcore_ver);
+ free(tcore_ver);
sigact_usr1.sa_handler = on_signal_usr1;
sigemptyset(&sigact_usr1.sa_mask);
warn("sigaction(SIGUSR1) failed.");
}
-
while (1) {
opt = getopt_long(argc, argv, "hT", options, &opt_index);
}
}
- if (optind < argc) {
+ if (optind < argc)
plugin_path = argv[optind];
- }
- dbg("plugin_path: [%s]", plugin_path);
- dbg("flag[test_load]: %d", flag_test_load);
+ info("plugin_path: [%s]", plugin_path);
g_type_init();
#if !GLIB_CHECK_VERSION (2, 31, 0)
}
_server = s;
- if (!load_plugins(s, plugin_path, flag_test_load)) {
+ if (!load_plugins(s, plugin_path, flag_test_load))
goto free_end;
- }
if (flag_test_load)
goto free_end;
+ info("server mainloop start");
+
if (tcore_server_run(s) == FALSE) {
err("server_run failed.");
- goto free_end;
}
/*
*/
free_end:
- dbg("exit!");
+ info("server end");
tcore_server_free(s);
end:
#include <queue.h>
#include <storage.h>
#include <communicator.h>
+#include <user_request.h>
#include "monitor.h"
{
GSList *list;
Storage *strg;
- char *str;
msg("-- Storages --");
TcoreHal *h;
TcoreQueue *q;
TcorePending *pending;
+ UserRequest *ur;
char *str;
int qlen;
int i;
msg(" queue_head: %p", g_queue_peek_head(q->gq));
for (i = 0; i < qlen; i++) {
pending = g_queue_peek_nth(q->gq, i);
- msg(" [%02d] pending=%p, id=0x%x, ur=%p", i, pending, tcore_pending_get_id(pending), tcore_pending_ref_user_request(pending));
+ ur = tcore_pending_ref_user_request(pending);
+ msg(" [%02d] pending=%p, id=0x%x, ur=%p", i, pending, tcore_pending_get_id(pending), ur);
+ if (ur) {
+ msg(" ur request command = 0x%x", tcore_user_request_get_command(ur));
+ }
data_len = 0;
data = tcore_pending_ref_request_data(pending, &data_len);
msg(" data=%p, data_len=%d", data, data_len);
+/*
+ * telephony-daemon
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#ifndef __MONITIR_H__
#define __MONITOR_H__
<manifest>
<define>
- <domain name="telephony_framework" policy="restricted" plist="tel-plugin-atmodem, tel-plugin-database, tel-plugin-dbus_tapi, tel-plugin-dpram, tel-plugin-factory, tel-plugin-indicator, tel-plugin-nitz, tel-plugin-packetservice, tel-plugin-samsung, tel-plugin-samsung_indicator, tel-plugin-svcmode, tel-plugin-svnet, tel-plugin-svnet2, tel-plugin-vconf, tel-plugin-vmodem"/>
+ <domain name="telephony_framework"/>
+ <provide>
+ <label name="telephony_framework::db"/>
+ </provide>
</define>
+ <assign>
+ <filesystem path="/etc/rc.d/init.d/telephony-daemon" label="_" exec_label="none"/>
+ <filesystem path="/etc/rc.d/rc3.d/S30telephony-daemon" label="_" exec_label="none"/>
+ <filesystem path="/etc/rc.d/rc5.d/S30telephony-daemon" label="_" exec_label="none"/>
+ </assign>
<request>
- <domain name="_"/>
+ <domain name="telephony_framework"/>
</request>
</manifest>