Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.tcf.examples.daytime.agent/tcf')
-rw-r--r--examples/org.eclipse.tcf.examples.daytime.agent/tcf/config.h44
-rw-r--r--examples/org.eclipse.tcf.examples.daytime.agent/tcf/main/services-ext.h26
-rw-r--r--examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.c68
-rw-r--r--examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.h28
4 files changed, 0 insertions, 166 deletions
diff --git a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/config.h b/examples/org.eclipse.tcf.examples.daytime.agent/tcf/config.h
deleted file mode 100644
index b4ba0cb72..000000000
--- a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/config.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v1.0 which accompany this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-/*
- * This file contains "define" statements that control agent configuration.
- * SERVICE_* definitions control which service implementations are included into the agent.
- *
- * This is example agent configuration. It includes only few standard services,
- * and one example service: Day Time.
- */
-
-#ifndef D_config
-#define D_config
-
-#include <tcf/framework/mdep.h>
-
-#if defined(WIN32) || defined(__CYGWIN__)
-# define TARGET_UNIX 0
-#elif defined(_WRS_KERNEL)
-# define TARGET_UNIX 0
-#else
-# define TARGET_UNIX 1
-#endif
-
-#define SERVICE_FileSystem 1
-#define SERVICE_SysMonitor TARGET_UNIX
-
-#define ENABLE_Trace 1
-#define ENABLE_Discovery 1
-
-
-#endif /* D_config */
diff --git a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/main/services-ext.h b/examples/org.eclipse.tcf.examples.daytime.agent/tcf/main/services-ext.h
deleted file mode 100644
index 00083d39a..000000000
--- a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/main/services-ext.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v1.0 which accompany this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-/*
- * Services initialization code extension point.
- * If the agent is built with additional user-defined services,
- * a customized version of services-ext.h file can be added to compiler headers search paths.
- */
-
-#include <tcf/services/daytime.h>
-
-static void ini_ext_services(Protocol * proto, TCFBroadcastGroup * bcg) {
- ini_daytime_service(proto);
-}
diff --git a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.c b/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.c
deleted file mode 100644
index c4108038e..000000000
--- a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v1.0 which accompany this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-/*
- * Sample TCF service implementation.
- */
-
-#include <tcf/config.h>
-#include <time.h>
-#include <tcf/framework/json.h>
-#include <tcf/framework/errors.h>
-#include <tcf/framework/exceptions.h>
-#include <tcf/services/daytime.h>
-
-static const char * DAYTIME = "Daytime";
-
-static void command_get_time_of_day(char * token, Channel * c) {
- char str[0x100];
- char res[0x100];
- time_t t;
-
- // Read command argumnet: string TZ - time zone name
- json_read_string(&c->inp, str, sizeof(str));
- // Each JSON encoded argument should end with zero byte
- if (c->inp.read(&c->inp) != 0) exception(ERR_JSON_SYNTAX);
- // Done reading arguments.
- // The command message should end with MARKER_EOM (End Of Message)
- if (c->inp.read(&c->inp) != MARKER_EOM) exception(ERR_JSON_SYNTAX);
-
- // Execute the command: retrieve current time as a string.
- // Note: we ignore command argument for simplicity,
- // a real command handler should do something better then that.
- time(&t);
- strcpy(res, ctime(&t));
-
- // Start reply message with zero terminated string "R"
- write_stringz(&c->out, "R");
- // Send back the command token
- write_stringz(&c->out, token);
- // Send error report, for now always "no error"
- write_errno(&c->out, 0);
- // Send reply data
- json_write_string(&c->out, res);
- // JSON encoded data should end with zero byte
- c->out.write(&c->out, 0);
- // Done sending reply data.
- // The reply message should end with MARKER_EOM (End Of Message)
- c->out.write(&c->out, MARKER_EOM);
- // Done sending reply message.
- // Command handling is complete.
-}
-
-void ini_daytime_service(Protocol * proto) {
- // Install command handler
- add_command_handler(proto, DAYTIME, "getTimeOfDay", command_get_time_of_day);
-}
diff --git a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.h b/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.h
deleted file mode 100644
index 492544d76..000000000
--- a/examples/org.eclipse.tcf.examples.daytime.agent/tcf/services/daytime.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v1.0 which accompany this distribution.
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- * You may elect to redistribute this code under either of these licenses.
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-/*
- * Sample TCF service header file.
- */
-
-#ifndef DAYTIME_H_
-#define DAYTIME_H_
-
-#include <tcf/config.h>
-#include <tcf/framework/protocol.h>
-
-extern void ini_daytime_service(Protocol * proto);
-
-#endif /*DAYTIME_H_*/

Back to the top