tux-droid-svn Mailing List for Tux Droid CE (Page 237)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: remi <c2m...@c2...> - 2007-02-27 15:48:49
|
Author: remi Date: 2007-02-27 16:48:34 +0100 (Tue, 27 Feb 2007) New Revision: 105 Added: software/gtdi/tags/0.0.1/ Log: ADD: GTDI 0.0.1 release Copied: software/gtdi/tags/0.0.1 (from rev 104, software/gtdi/trunk) |
From: remi <c2m...@c2...> - 2007-02-27 15:46:53
|
Author: remi Date: 2007-02-27 16:46:37 +0100 (Tue, 27 Feb 2007) New Revision: 104 Added: software/alarm_clock/tags/0.0.1/ Log: ADD: Alarm Clock 0.0.1 release Copied: software/alarm_clock/tags/0.0.1 (from rev 103, software/alarm_clock/trunk) |
From: remi <c2m...@c2...> - 2007-02-27 15:44:21
|
Author: remi Date: 2007-02-27 16:44:09 +0100 (Tue, 27 Feb 2007) New Revision: 103 Added: software/email_alert/tags/0.0.1/ Log: ADD: email_alert 0.0.1 release Copied: software/email_alert/tags/0.0.1 (from rev 102, software/email_alert/trunk) |
From: remi <c2m...@c2...> - 2007-02-27 15:18:56
|
Author: remi Date: 2007-02-27 16:18:40 +0100 (Tue, 27 Feb 2007) New Revision: 102 Modified: software/alarm_clock/trunk/tdac.py Log: UPD : Add versioning on load tdac.py Modified: software/alarm_clock/trunk/tdac.py =================================================================== --- software/alarm_clock/trunk/tdac.py 2007-02-27 15:13:11 UTC (rev 101) +++ software/alarm_clock/trunk/tdac.py 2007-02-27 15:18:40 UTC (rev 102) @@ -46,6 +46,7 @@ f = open('version.txt', 'r') app_version = f.readline()[0:-1] # strip the \n at the EOL f.close() +print "Alarm Clock version " + app_version glade_dir = "" locale_dir = "" |
From: jaguarondi <c2m...@c2...> - 2007-02-27 15:11:32
|
Author: jaguarondi Date: 2007-02-27 16:11:19 +0100 (Tue, 27 Feb 2007) New Revision: 100 Added: daemon/trunk/CHANGES firmware/tuxaudio/trunk/CHANGES firmware/tuxcore/trunk/CHANGES firmware/tuxup/trunk/CHANGES Removed: daemon/trunk/NEWS firmware/tuxaudio/tags/v0.3.0/ firmware/tuxaudio/trunk/NEWS firmware/tuxcore/tags/v0.3.0/ firmware/tuxcore/trunk/NEWS firmware/tuxup/trunk/NEWS Log: - CLN: mrenamed all NEWS by CHANGES which seems more in accordance with OSS - CLN: removed firmware tags that will be done again when creating the packages Copied: daemon/trunk/CHANGES (from rev 93, daemon/trunk/NEWS) =================================================================== --- daemon/trunk/CHANGES (rev 0) +++ daemon/trunk/CHANGES 2007-02-27 15:11:19 UTC (rev 100) @@ -0,0 +1,24 @@ +$Id$ + +Approximate change log for TUX Daemon by version. + +(For more detailed changes, see the ChangeLog file.) + +---------------------------------------------------------------------- +Current: + + * . + +Version 0.1.7: + + * Improved stability with mutexes. + * Code cleanup and bug fixes. + +Version 0.1.6: + + * No logs given from R. + +Version 0.1.5: + + * Initial public release. + Deleted: daemon/trunk/NEWS =================================================================== --- daemon/trunk/NEWS 2007-02-27 15:03:43 UTC (rev 99) +++ daemon/trunk/NEWS 2007-02-27 15:11:19 UTC (rev 100) @@ -1,24 +0,0 @@ -$Id$ - -Approximate change log for TUX Daemon by version. - -(For more detailed changes, see the ChangeLog file.) - ----------------------------------------------------------------------- -Current: - - * . - -Version 0.1.7: - - * Improved stability with mutexes. - * Code cleanup and bug fixes. - -Version 0.1.6: - - * No logs given from R. - -Version 0.1.5: - - * Initial public release. - Copied: firmware/tuxaudio/trunk/CHANGES (from rev 93, firmware/tuxaudio/trunk/NEWS) =================================================================== --- firmware/tuxaudio/trunk/CHANGES (rev 0) +++ firmware/tuxaudio/trunk/CHANGES 2007-02-27 15:11:19 UTC (rev 100) @@ -0,0 +1,15 @@ +$Id: NEWS 58 2007-01-29 15:34:20Z jaguarondi $ + +Approximate change log for TUXAUDIO by version. + +(For more detailed changes, see svn log.) + +---------------------------------------------------------------------- +Current: + + * . + +Version 0.3.0: + + * Initial public release. This code is considered stable. + Deleted: firmware/tuxaudio/trunk/NEWS =================================================================== --- firmware/tuxaudio/trunk/NEWS 2007-02-27 15:03:43 UTC (rev 99) +++ firmware/tuxaudio/trunk/NEWS 2007-02-27 15:11:19 UTC (rev 100) @@ -1,15 +0,0 @@ -$Id: NEWS 58 2007-01-29 15:34:20Z jaguarondi $ - -Approximate change log for TUXAUDIO by version. - -(For more detailed changes, see svn log.) - ----------------------------------------------------------------------- -Current: - - * . - -Version 0.3.0: - - * Initial public release. This code is considered stable. - Copied: firmware/tuxcore/trunk/CHANGES (from rev 93, firmware/tuxcore/trunk/NEWS) =================================================================== --- firmware/tuxcore/trunk/CHANGES (rev 0) +++ firmware/tuxcore/trunk/CHANGES 2007-02-27 15:11:19 UTC (rev 100) @@ -0,0 +1,18 @@ +$Id$ + +Approximate change log for TUXCORE by version. + +(For more detailed changes, see svn log.) + +---------------------------------------------------------------------- +Current: + + * . + +Version 0.3.0: + + * Initial public release. This code is considered stable. Most + functionalities are implemented. Handling now all movements, IR emitter, IR + receiver, phototransistor, blue led's and I2C communication. There's also a + standalone behavior implemented but still not configurable from the + computer. Deleted: firmware/tuxcore/trunk/NEWS =================================================================== --- firmware/tuxcore/trunk/NEWS 2007-02-27 15:03:43 UTC (rev 99) +++ firmware/tuxcore/trunk/NEWS 2007-02-27 15:11:19 UTC (rev 100) @@ -1,18 +0,0 @@ -$Id$ - -Approximate change log for TUXCORE by version. - -(For more detailed changes, see svn log.) - ----------------------------------------------------------------------- -Current: - - * . - -Version 0.3.0: - - * Initial public release. This code is considered stable. Most - functionalities are implemented. Handling now all movements, IR emitter, IR - receiver, phototransistor, blue led's and I2C communication. There's also a - standalone behavior implemented but still not configurable from the - computer. Copied: firmware/tuxup/trunk/CHANGES (from rev 93, firmware/tuxup/trunk/NEWS) =================================================================== --- firmware/tuxup/trunk/CHANGES (rev 0) +++ firmware/tuxup/trunk/CHANGES 2007-02-27 15:11:19 UTC (rev 100) @@ -0,0 +1,24 @@ +$Id$ + +Approximate change log for TUXUP by version. + +(For more detailed changes, see the ChangeLog file.) + +---------------------------------------------------------------------- +Current: + + * Connection now checks for 5 seconds before replying that Tu is not found. + * Added autodetection of the CPU to be programmed based on the CPU field in + hex files or names of eep files. + * Added version display when programming hex files. + * Changed the usage, replaced the old argument parsing with getopt. + * Added --version, --help, --pretend and --verbose options. + * Added --main option to reprogram tuxcore and tuxaudio only. + * Added support for usb programming which is a simple front-end to dfu-programmer. dfu-programmer needs to be installed. + * Now uses defines from commands.h for CPU numbers, I2C addresses, etc. + * Code cleanup + +Version 0.0.1: + + * Initial public release. + Deleted: firmware/tuxup/trunk/NEWS =================================================================== --- firmware/tuxup/trunk/NEWS 2007-02-27 15:03:43 UTC (rev 99) +++ firmware/tuxup/trunk/NEWS 2007-02-27 15:11:19 UTC (rev 100) @@ -1,24 +0,0 @@ -$Id$ - -Approximate change log for TUXUP by version. - -(For more detailed changes, see the ChangeLog file.) - ----------------------------------------------------------------------- -Current: - - * Connection now checks for 5 seconds before replying that Tu is not found. - * Added autodetection of the CPU to be programmed based on the CPU field in - hex files or names of eep files. - * Added version display when programming hex files. - * Changed the usage, replaced the old argument parsing with getopt. - * Added --version, --help, --pretend and --verbose options. - * Added --main option to reprogram tuxcore and tuxaudio only. - * Added support for usb programming which is a simple front-end to dfu-programmer. dfu-programmer needs to be installed. - * Now uses defines from commands.h for CPU numbers, I2C addresses, etc. - * Code cleanup - -Version 0.0.1: - - * Initial public release. - |
From: remi <c2m...@c2...> - 2007-02-27 15:04:03
|
Author: remi Date: 2007-02-27 16:03:43 +0100 (Tue, 27 Feb 2007) New Revision: 99 Added: software/email_alert/branches/ software/email_alert/tags/ software/email_alert/trunk/ software/email_alert/trunk/SimpleGladeApp.py software/email_alert/trunk/sample_behavior_script.py software/email_alert/trunk/tdema.glade software/email_alert/trunk/tdema.py software/email_alert/trunk/version.txt Removed: software/email_alert/SimpleGladeApp.py software/email_alert/sample_behavior_script.py software/email_alert/tdema.glade software/email_alert/tdema.py software/email_alert/version.txt Log: ADD : "trunk" "tags" and "branches" directories added MOV : All files are moved in the trunk directory Deleted: software/email_alert/SimpleGladeApp.py =================================================================== --- software/email_alert/SimpleGladeApp.py 2007-02-27 15:02:00 UTC (rev 98) +++ software/email_alert/SimpleGladeApp.py 2007-02-27 15:03:43 UTC (rev 99) @@ -1,341 +0,0 @@ -""" - SimpleGladeApp.py - Module that provides an object oriented abstraction to pygtk and libglade. - Copyright (C) 2004 Sandino Flores Moreno -""" - -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -import os -import sys -import re - -import tokenize -import gtk -import gtk.glade -import weakref -import inspect - -__version__ = "1.0" -__author__ = 'Sandino "tigrux" Flores-Moreno' - -def bindtextdomain(app_name, locale_dir=None): - """ - Bind the domain represented by app_name to the locale directory locale_dir. - It has the effect of loading translations, enabling applications for different - languages. - - app_name: - a domain to look for translations, tipically the name of an application. - - locale_dir: - a directory with locales like locale_dir/lang_isocode/LC_MESSAGES/app_name.mo - If omitted or None, then the current binding for app_name is used. - """ - try: - import locale - import gettext - locale.setlocale(locale.LC_ALL, "") - gtk.glade.bindtextdomain(app_name, locale_dir) - gettext.install(app_name, locale_dir, unicode=1) - except (IOError,locale.Error), e: - print "Warning", app_name, e - __builtins__.__dict__["_"] = lambda x : x - - -class SimpleGladeApp: - - def __init__(self, path, root=None, domain=None, **kwargs): - """ - Load a glade file specified by glade_filename, using root as - root widget and domain as the domain for translations. - - If it receives extra named arguments (argname=value), then they are used - as attributes of the instance. - - path: - path to a glade filename. - If glade_filename cannot be found, then it will be searched in the - same directory of the program (sys.argv[0]) - - root: - the name of the widget that is the root of the user interface, - usually a window or dialog (a top level widget). - If None or ommited, the full user interface is loaded. - - domain: - A domain to use for loading translations. - If None or ommited, no translation is loaded. - - **kwargs: - a dictionary representing the named extra arguments. - It is useful to set attributes of new instances, for example: - glade_app = SimpleGladeApp("ui.glade", foo="some value", bar="another value") - sets two attributes (foo and bar) to glade_app. - """ - if os.path.isfile(path): - self.glade_path = path - else: - glade_dir = os.path.dirname( sys.argv[0] ) - self.glade_path = os.path.join(glade_dir, path) - for key, value in kwargs.items(): - try: - setattr(self, key, weakref.proxy(value) ) - except TypeError: - setattr(self, key, value) - self.glade = None - self.install_custom_handler(self.custom_handler) - self.glade = self.create_glade(self.glade_path, root, domain) - if root: - self.main_widget = self.get_widget(root) - else: - self.main_widget = None - self.normalize_names() - self.add_callbacks(self) - self.new() - - def __repr__(self): - class_name = self.__class__.__name__ - if self.main_widget: - root = gtk.Widget.get_name(self.main_widget) - repr = '%s(path="%s", root="%s")' % (class_name, self.glade_path, root) - else: - repr = '%s(path="%s")' % (class_name, self.glade_path) - return repr - - def new(self): - """ - Method called when the user interface is loaded and ready to be used. - At this moment, the widgets are loaded and can be refered as self.widget_name - """ - pass - - def add_callbacks(self, callbacks_proxy): - """ - It uses the methods of callbacks_proxy as callbacks. - The callbacks are specified by using: - Properties window -> Signals tab - in glade-2 (or any other gui designer like gazpacho). - - Methods of classes inheriting from SimpleGladeApp are used as - callbacks automatically. - - callbacks_proxy: - an instance with methods as code of callbacks. - It means it has methods like on_button1_clicked, on_entry1_activate, etc. - """ - self.glade.signal_autoconnect(callbacks_proxy) - - def normalize_names(self): - """ - It is internally used to normalize the name of the widgets. - It means a widget named foo:vbox-dialog in glade - is refered self.vbox_dialog in the code. - - It also sets a data "prefixes" with the list of - prefixes a widget has for each widget. - """ - for widget in self.get_widgets(): - widget_name = gtk.Widget.get_name(widget) - prefixes_name_l = widget_name.split(":") - prefixes = prefixes_name_l[ : -1] - widget_api_name = prefixes_name_l[-1] - widget_api_name = "_".join( re.findall(tokenize.Name, widget_api_name) ) - gtk.Widget.set_name(widget, widget_api_name) - if hasattr(self, widget_api_name): - raise AttributeError("instance %s already has an attribute %s" % (self,widget_api_name)) - else: - setattr(self, widget_api_name, widget) - if prefixes: - gtk.Widget.set_data(widget, "prefixes", prefixes) - - def add_prefix_actions(self, prefix_actions_proxy): - """ - By using a gui designer (glade-2, gazpacho, etc) - widgets can have a prefix in theirs names - like foo:entry1 or foo:label3 - It means entry1 and label3 has a prefix action named foo. - - Then, prefix_actions_proxy must have a method named prefix_foo which - is called everytime a widget with prefix foo is found, using the found widget - as argument. - - prefix_actions_proxy: - An instance with methods as prefix actions. - It means it has methods like prefix_foo, prefix_bar, etc. - """ - prefix_s = "prefix_" - prefix_pos = len(prefix_s) - - is_method = lambda t : callable( t[1] ) - is_prefix_action = lambda t : t[0].startswith(prefix_s) - drop_prefix = lambda (k,w): (k[prefix_pos:],w) - - members_t = inspect.getmembers(prefix_actions_proxy) - methods_t = filter(is_method, members_t) - prefix_actions_t = filter(is_prefix_action, methods_t) - prefix_actions_d = dict( map(drop_prefix, prefix_actions_t) ) - - for widget in self.get_widgets(): - prefixes = gtk.Widget.get_data(widget, "prefixes") - if prefixes: - for prefix in prefixes: - if prefix in prefix_actions_d: - prefix_action = prefix_actions_d[prefix] - prefix_action(widget) - - def custom_handler(self, - glade, function_name, widget_name, - str1, str2, int1, int2): - """ - Generic handler for creating custom widgets, internally used to - enable custom widgets (custom widgets of glade). - - The custom widgets have a creation function specified in design time. - Those creation functions are always called with str1,str2,int1,int2 as - arguments, that are values specified in design time. - - Methods of classes inheriting from SimpleGladeApp are used as - creation functions automatically. - - If a custom widget has create_foo as creation function, then the - method named create_foo is called with str1,str2,int1,int2 as arguments. - """ - try: - handler = getattr(self, function_name) - return handler(str1, str2, int1, int2) - except AttributeError: - return None - - def gtk_widget_show(self, widget, *args): - """ - Predefined callback. - The widget is showed. - Equivalent to widget.show() - """ - widget.show() - - def gtk_widget_hide(self, widget, *args): - """ - Predefined callback. - The widget is hidden. - Equivalent to widget.hide() - """ - widget.hide() - - def gtk_widget_grab_focus(self, widget, *args): - """ - Predefined callback. - The widget grabs the focus. - Equivalent to widget.grab_focus() - """ - widget.grab_focus() - - def gtk_widget_destroy(self, widget, *args): - """ - Predefined callback. - The widget is destroyed. - Equivalent to widget.destroy() - """ - widget.destroy() - - def gtk_window_activate_default(self, window, *args): - """ - Predefined callback. - The default widget of the window is activated. - Equivalent to window.activate_default() - """ - widget.activate_default() - - def gtk_true(self, *args): - """ - Predefined callback. - Equivalent to return True in a callback. - Useful for stopping propagation of signals. - """ - return True - - def gtk_false(self, *args): - """ - Predefined callback. - Equivalent to return False in a callback. - """ - return False - - def gtk_main_quit(self, *args): - """ - Predefined callback. - Equivalent to self.quit() - """ - self.quit() - - def main(self): - """ - Starts the main loop of processing events. - The default implementation calls gtk.main() - - Useful for applications that needs a non gtk main loop. - For example, applications based on gstreamer needs to override - this method with gst.main() - - Do not directly call this method in your programs. - Use the method run() instead. - """ - gtk.main() - - def quit(self): - """ - Quit processing events. - The default implementation calls gtk.main_quit() - - Useful for applications that needs a non gtk main loop. - For example, applications based on gstreamer needs to override - this method with gst.main_quit() - """ - gtk.main_quit() - - def run(self): - """ - Starts the main loop of processing events checking for Control-C. - - The default implementation checks wheter a Control-C is pressed, - then calls on_keyboard_interrupt(). - - Use this method for starting programs. - """ - try: - self.main() - except KeyboardInterrupt: - self.on_keyboard_interrupt() - - def on_keyboard_interrupt(self): - """ - This method is called by the default implementation of run() - after a program is finished by pressing Control-C. - """ - pass - - def install_custom_handler(self, custom_handler): - gtk.glade.set_custom_handler(custom_handler) - - def create_glade(self, glade_path, root, domain): - return gtk.glade.XML(self.glade_path, root, domain) - - def get_widget(self, widget_name): - return self.glade.get_widget(widget_name) - - def get_widgets(self): - return self.glade.get_widget_prefix("") Deleted: software/email_alert/sample_behavior_script.py =================================================================== --- software/email_alert/sample_behavior_script.py 2007-02-27 15:02:00 UTC (rev 98) +++ software/email_alert/sample_behavior_script.py 2007-02-27 15:03:43 UTC (rev 99) @@ -1,22 +0,0 @@ -#!/usr/bin/python -# -*- coding: latin-1 -*- -# ----------------------------------------------- -# Initalization of modules -# uses objects "tux" and "tss" -# ----------------------------------------------- -import sys -sys.path.append('/opt/kysoh/tuxdroid/pythonlibs') -from tux import * -# ----------------------------------------------- -# Your script -# ----------------------------------------------- - -tux.cmd.wings_on(4) -tux.cmd.eyes_on(4) - - -# ----------------------------------------------- -# End of script -# ----------------------------------------------- -tux.sys.wait(1) -tux.disconnect_from_daemon() Deleted: software/email_alert/tdema.glade =================================================================== --- software/email_alert/tdema.glade 2007-02-27 15:02:00 UTC (rev 98) +++ software/email_alert/tdema.glade 2007-02-27 15:03:43 UTC (rev 99) @@ -1,951 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> -<requires lib="gnome"/> - -<widget class="GtkWindow" id="window1"> - <property name="height_request">472</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Tux Droid E-Mail Alert</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="on_window1_destroy" last_modification_time="Sun, 18 Feb 2007 01:31:20 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_OUT</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFixed" id="fixed1"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="e_server"> - <property name="width_request">160</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">•</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">72</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="width_request">40</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Server:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed2"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="e_port"> - <property name="width_request">86</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">110</property> - <property name="has_frame">True</property> - <property name="invisible_char">•</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">40</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label6"> - <property name="width_request">34</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Port:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed3"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="e_login"> - <property name="width_request">160</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">•</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">72</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="width_request">35</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Login:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed4"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="e_password"> - <property name="width_request">160</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">72</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label8"> - <property name="width_request">63</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Password:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed5"> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="sb_check"> - <property name="width_request">56</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 100 1 10 10</property> - </widget> - <packing> - <property name="x">152</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label9"> - <property name="width_request">152</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Check for new mail every</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label10"> - <property name="width_request">51</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">minutes.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">211</property> - <property name="y">4</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>POP3 Account</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_OUT</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFixed" id="fixed6"> - <property name="visible">True</property> - - <child> - <widget class="GtkRadioButton" id="rb_wav"> - <property name="width_request">95</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">.wav file</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">2</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="cb_behavior"> - <property name="width_request">102</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Behavior</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">66</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="rb_tts"> - <property name="width_request">95</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">TTS</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">rb_wav</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">34</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed7"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="e_tts"> - <property name="width_request">256</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Enter text here.</property> - <property name="has_frame">True</property> - <property name="invisible_char">•</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkFileChooserButton" id="fcb_wav"> - <property name="width_request">256</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Sélectionner un fichier</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - <signal name="selection_changed" handler="on_fcb_wav_selection_changed" last_modification_time="Sun, 18 Feb 2007 01:29:35 GMT"/> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkFileChooserButton" id="fcb_behavior"> - <property name="width_request">256</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Sélectionner un fichier</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - <signal name="selection_changed" handler="on_fcb_behavior_selection_changed" last_modification_time="Sun, 18 Feb 2007 01:29:48 GMT"/> - </widget> - <packing> - <property name="x">0</property> - <property name="y">64</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="bt_test"> - <property name="width_request">120</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Test</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_bt_test_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:14 GMT"/> - </widget> - <packing> - <property name="x">9</property> - <property name="y">96</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Notification</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_OUT</property> - - <child> - <widget class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed8"> - <property name="visible">True</property> - - <child> - <widget class="GtkCheckButton" id="cb_body"> - <property name="width_request">125</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Body message</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">24</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="cb_subject"> - <property name="width_request">164</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Subject & sender</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Read E-mail</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame4"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_OUT</property> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFixed" id="fixed9"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="label11"> - <property name="width_request">77</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Select voice:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">4</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="width_request">104</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Select pitch level:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">36</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed10"> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="sb_pitch"> - <property name="width_request">72</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">100 100 250 1 10 10</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBoxEntry" id="cbbe_voice"> - <property name="width_request">248</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="items" translatable="yes">FR male -FR female -US male -US female</property> - <property name="add_tearoffs">False</property> - <property name="has_frame">True</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>TTS configuration</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed11"> - <property name="visible">True</property> - - <child> - <widget class="GtkButton" id="bt_cancel"> - <property name="width_request">100</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Cancel</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_bt_cancel_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:51 GMT"/> - </widget> - <packing> - <property name="x">168</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="bt_accept"> - <property name="width_request">100</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Accept</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_bt_accept_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:57 GMT"/> - </widget> - <packing> - <property name="x">272</property> - <property name="y">8</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> Deleted: software/email_alert/tdema.py =================================================================== --- software/email_alert/tdema.py 2007-02-27 15:02:00 UTC (rev 98) +++ software/email_alert/tdema.py 2007-02-27 15:03:43 UTC (rev 99) @@ -1,248 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF8 -*- - -# -------------------------------------------------------------------- -# Tux Droid - E-Mail Alert -# Copyright (C) 2007 C2ME Sa <rem...@c2...> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# -------------------------------------------------------------------- -# $Id: $ -# -------------------------------------------------------------------- - -# ----------------------------------------------- -# Initalization of modules -# use object "tux" -# ----------------------------------------------- -import sys -sys.path.append('/opt/kysoh/tuxdroid/pythonlibs') -from tux import * -# ----------------------------------------------- -# Your script -# ----------------------------------------------- - -import os - -import gtk -import gnome - -from poplib import * -import thread -import email -import string -import email.Parser -from email.Header import decode_header - -from SimpleGladeApp import SimpleGladeApp -from SimpleGladeApp import bindtextdomain - -app_name = "tdema" -f = open('version.txt', 'r') -app_version = f.readline()[0:-1] # strip the \n at the EOL -f.close() - -print "Email Alert version " + app_version - -glade_dir = "" -locale_dir = "" - -bindtextdomain(app_name, locale_dir) - -#------------------------------------------------------------------------------ -# Window class -#------------------------------------------------------------------------------ -class Window1(SimpleGladeApp): - - #-------------------------------------------------------------------------- - # Class init - #-------------------------------------------------------------------------- - def __init__(self, path="tdema.glade", - root="window1", - domain=app_name, **kwargs): - path = os.path.join(glade_dir, path) - SimpleGladeApp.__init__(self, path, root, domain, **kwargs) - self.wav_filename="None" - self.py_filename="None" - self.viewed_mail_list=[] - self.check_enabled=False - - #-------------------------------------------------------------------------- - # On new window - #-------------------------------------------------------------------------- - def new(self): - self.get_widget("cbbe_voice").set_active(2) - self.get_widget("e_password").set_visibility(False) - - #-------------------------------------------------------------------------- - # On close windows - #-------------------------------------------------------------------------- - def on_window1_destroy(self, widget, *args): - self.check_enabled=False - tux.sys.wait(1) - tux.disconnect_from_daemon() - sys.exit(0) - - #-------------------------------------------------------------------------- - # On wav file selected - #-------------------------------------------------------------------------- - def on_fcb_wav_selection_changed(self, widget, *args): - filename=widget.get_filename() - ext=len(filename)-filename.find(".wav") - if ext == 4 : - self.wav_filename=filename - else: - self.wav_filename="None" - widget.unselect_filename(filename) - - #-------------------------------------------------------------------------- - # On behavior file selected - #-------------------------------------------------------------------------- - def on_fcb_behavior_selection_changed(self, widget, *args): - filename=widget.get_filename() - ext=len(filename)-filename.find(".py") - if ext == 3 : - self.py_filename=filename - else: - self.py_filename="None" - widget.unselect_filename(filename) - - #-------------------------------------------------------------------------- - # On test notification button clicked - #-------------------------------------------------------------------------- - def on_bt_test_clicked(self, widget, *args): - self.on_alert() - - #-------------------------------------------------------------------------- - # On cancel button clicked - #-------------------------------------------------------------------------- - def on_bt_cancel_clicked(self, widget, *args): - self.check_enabled=False - tux.sys.wait(1) - tux.disconnect_from_daemon() - sys.exit(0) - - #-------------------------------------------------------------------------- - # On accept button clicked - #-------------------------------------------------------------------------- - def on_bt_accept_clicked(self, widget, *args): - if self.check_enabled: return - self.check_enabled=True - thread.start_new_thread(self.check_email,()) - - #-------------------------------------------------------------------------- - # On alert event - #-------------------------------------------------------------------------- - def on_alert(self): - if self.get_widget("cb_behavior").get_active(): - if self.py_filename!="None": - tux.sys.shell_free("python "+self.py_filename) - if self.get_widget("rb_wav").get_active(): - if self.wav_filename!="None": - tux.sys.shell_free("aplay -D hw:1 "+self.wav_filename) - else: - voice_cb=self.get_widget("cbbe_voice") - pitch_sb=self.get_widget("sb_pitch") - text_e=self.get_widget("e_tts") - tux.tts.select_voice(voice_cb.get_active()+1,pitch_sb.get_value()) - tux.tts.speak(text_e.get_text()) - - #-------------------------------------------------------------------------- - # Check mail thread - #-------------------------------------------------------------------------- - def check_email(self): - # Select voice and pitch - voice_cb=self.get_widget("cbbe_voice") - pitch_sb=self.get_widget("sb_pitch") - tux.tts.select_voice(voice_cb.get_active()+1,pitch_sb.get_value()) - while self.check_enabled: - # Connect to pop server - conn=POP3(self.get_widget("e_server").get_text()) - conn.user(self.get_widget("e_login").get_text()) - conn.pass_(self.get_widget("e_password").get_text()) - liste=conn.list()[1:2] - if len(liste[0])>0: - for k in range(len(liste[0])): - # Check if mail is old - old_mail=False - if len(self.viewed_mail_list)>0: - for uidl in self.viewed_mail_list: - if uidl==conn.uidl(k+1): - old_mail=True - if old_mail: continue - # Make a single string with mail - strraw = "" - for z in conn.top(k+1,1)[1]: strraw=strraw+z+"\n" - # Mark the mail as read - self.viewed_mail_list.append(conn.uidl(k+1)) - # Parse the email - p = email.Parser.Parser() - msg=p.parsestr(strraw) - # Get subject - subjecttxt=get_header_info(msg,"Subject") - # Get sender - tmptext=get_header_info(msg,"From") - idx=tmptext.find("<") - if idx>0: - fromtxt=tmptext[0:idx-1] - else: - fromtxt=tmptext - # Play the notification - self.on_alert() - if self.get_widget("cb_subject").get_active(): - tux.tts.speak("Envoyé par. "+fromtxt+".") - tux.tts.speak("Le sujet est. "+subjecttxt+".") - if self.get_widget("cb_body").get_active(): - tux.tts.speak("Voici le contenu de l'email. "+get_body(msg)) - conn.quit() - tux.sys.wait(self.get_widget("sb_check").get_value()) - -#------------------------------------------------------------------------------ -# get_header_info -#------------------------------------------------------------------------------ -def get_header_info(msg,entry): - tmp1=decode_header(msg[entry]) - if str(tmp1[0][1])=="None": - return tmp1[0][0] - else: - tmp2=unicode(tmp1[0][0],tmp1[0][1]) - return tmp2.encode('utf-8','replace') - -#------------------------------------------------------------------------------ -# get_body -#------------------------------------------------------------------------------ -def get_body(mail): - if mail.is_multipart(): - for part in mail.get_payload(): - showmessage(part) - else: - if str(mail.get_content_charset())!='None': - tmp=unicode(mail.get_payload(),mail.get_content_charset()) - ... [truncated message content] |
From: remi <c2m...@c2...> - 2007-02-27 14:56:38
|
Author: remi Date: 2007-02-27 15:56:21 +0100 (Tue, 27 Feb 2007) New Revision: 97 Added: software/alarm_clock/version.txt Modified: software/alarm_clock/tdac.py Log: UPD : tdac.py : Correction of project title in the licence header Versioning loaded from "version.txt" ADD : version.txt Modified: software/alarm_clock/tdac.py =================================================================== --- software/alarm_clock/tdac.py 2007-02-27 14:27:39 UTC (rev 96) +++ software/alarm_clock/tdac.py 2007-02-27 14:56:21 UTC (rev 97) @@ -2,7 +2,7 @@ # -*- coding: UTF8 -*- # -------------------------------------------------------------------- -# Tux Droid - E-Mail Alert +# Tux Droid - Alarm Clock # Copyright (C) 2007 C2ME Sa <rem...@c2...> # # This program is free software; you can redistribute it and/or modify @@ -43,7 +43,9 @@ from SimpleGladeApp import bindtextdomain app_name = "tdac" -app_version = "0.0.1" +f = open('version.txt', 'r') +app_version = f.readline()[0:-1] # strip the \n at the EOL +f.close() glade_dir = "" locale_dir = "" Added: software/alarm_clock/version.txt =================================================================== --- software/alarm_clock/version.txt (rev 0) +++ software/alarm_clock/version.txt 2007-02-27 14:56:21 UTC (rev 97) @@ -0,0 +1 @@ +0.0.1 Property changes on: software/alarm_clock/version.txt ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 14:28:08
|
Author: jaguarondi Date: 2007-02-27 15:27:39 +0100 (Tue, 27 Feb 2007) New Revision: 96 Modified: software/email_alert/tdema.py Log: -CHG: version variable is now retrieved from version.txt Modified: software/email_alert/tdema.py =================================================================== --- software/email_alert/tdema.py 2007-02-27 13:13:03 UTC (rev 95) +++ software/email_alert/tdema.py 2007-02-27 14:27:39 UTC (rev 96) @@ -50,8 +50,12 @@ from SimpleGladeApp import bindtextdomain app_name = "tdema" -app_version = "0.0.1" +f = open('version.txt', 'r') +app_version = f.readline()[0:-1] # strip the \n at the EOL +f.close() +print "Email Alert version " + app_version + glade_dir = "" locale_dir = "" |
From: remi <c2m...@c2...> - 2007-02-27 13:13:15
|
Author: remi Date: 2007-02-27 14:13:03 +0100 (Tue, 27 Feb 2007) New Revision: 95 Removed: software/alarm_clock/tdac.gladep software/email_alert/tdema.gladep Modified: software/ software/alarm_clock/SimpleGladeApp.py software/alarm_clock/sample_behavior_script.py software/alarm_clock/tdac.glade software/alarm_clock/tdac.py software/email_alert/SimpleGladeApp.py software/email_alert/sample_behavior_script.py software/email_alert/tdema.glade software/email_alert/tdema.py Log: UPD : Properties update Property changes on: software ___________________________________________________________________ Name: Keywords - Id Name: eol-style - native Property changes on: software/alarm_clock/SimpleGladeApp.py ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native Property changes on: software/alarm_clock/sample_behavior_script.py ___________________________________________________________________ Name: svn:executable + * Name: svn:Keywords + Id Name: svn:eol-style + native Property changes on: software/alarm_clock/tdac.glade ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native Deleted: software/alarm_clock/tdac.gladep =================================================================== --- software/alarm_clock/tdac.gladep 2007-02-27 13:08:43 UTC (rev 94) +++ software/alarm_clock/tdac.gladep 2007-02-27 13:13:03 UTC (rev 95) @@ -1,7 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name>TDAC</name> - <program_name>tdac</program_name> -</glade-project> Property changes on: software/alarm_clock/tdac.py ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native Property changes on: software/email_alert/SimpleGladeApp.py ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native Property changes on: software/email_alert/sample_behavior_script.py ___________________________________________________________________ Name: svn:executable + * Name: svn:Keywords + Id Name: svn:eol-style + native Property changes on: software/email_alert/tdema.glade ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native Deleted: software/email_alert/tdema.gladep =================================================================== --- software/email_alert/tdema.gladep 2007-02-27 13:08:43 UTC (rev 94) +++ software/email_alert/tdema.gladep 2007-02-27 13:13:03 UTC (rev 95) @@ -1,7 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name>TDEMA</name> - <program_name>tdema</program_name> -</glade-project> Property changes on: software/email_alert/tdema.py ___________________________________________________________________ Name: svn:Keywords + Id Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 13:08:59
|
Author: jaguarondi Date: 2007-02-27 14:08:43 +0100 (Tue, 27 Feb 2007) New Revision: 94 Added: software/email_alert/version.txt Log: - ADD: version.txt now contains the version number, will need to import it from the py file Added: software/email_alert/version.txt =================================================================== --- software/email_alert/version.txt (rev 0) +++ software/email_alert/version.txt 2007-02-27 13:08:43 UTC (rev 94) @@ -0,0 +1 @@ +0.0.1 Property changes on: software/email_alert/version.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 12:35:56
|
Author: jaguarondi Date: 2007-02-27 13:35:43 +0100 (Tue, 27 Feb 2007) New Revision: 92 Modified: daemon/trunk/AUTHORS daemon/trunk/NEWS Log: - UPD: NEWS and AUTHORS updated Modified: daemon/trunk/AUTHORS =================================================================== --- daemon/trunk/AUTHORS 2007-02-27 12:33:26 UTC (rev 91) +++ daemon/trunk/AUTHORS 2007-02-27 12:35:43 UTC (rev 92) @@ -6,4 +6,5 @@ Contributors: - Olivier Vandorpe <> + Olivier Vandorpe <yasha-pgt-linux.org> + Modified: daemon/trunk/NEWS =================================================================== --- daemon/trunk/NEWS 2007-02-27 12:33:26 UTC (rev 91) +++ daemon/trunk/NEWS 2007-02-27 12:35:43 UTC (rev 92) @@ -9,6 +9,15 @@ * . +Version 0.1.7: + + * Improved stability with mutexes. + * Code cleanup and bug fixes. + +Version 0.1.6: + + * No logs given from R. + Version 0.1.5: * Initial public release. |
From: remi <c2m...@c2...> - 2007-02-27 12:34:07
|
Author: remi Date: 2007-02-27 13:33:26 +0100 (Tue, 27 Feb 2007) New Revision: 91 Added: software/email_alert/ software/email_alert/SimpleGladeApp.py software/email_alert/sample_behavior_script.py software/email_alert/tdema.glade software/email_alert/tdema.gladep software/email_alert/tdema.py Modified: software/ Log: ADD : TuxDroid E-Mail Alert Property changes on: software ___________________________________________________________________ Name: Keywords + Id Name: eol-style + native Property changes on: software/email_alert ___________________________________________________________________ Name: Keywords + Id Name: eol-style + native Added: software/email_alert/SimpleGladeApp.py =================================================================== --- software/email_alert/SimpleGladeApp.py (rev 0) +++ software/email_alert/SimpleGladeApp.py 2007-02-27 12:33:26 UTC (rev 91) @@ -0,0 +1,341 @@ +""" + SimpleGladeApp.py + Module that provides an object oriented abstraction to pygtk and libglade. + Copyright (C) 2004 Sandino Flores Moreno +""" + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +import os +import sys +import re + +import tokenize +import gtk +import gtk.glade +import weakref +import inspect + +__version__ = "1.0" +__author__ = 'Sandino "tigrux" Flores-Moreno' + +def bindtextdomain(app_name, locale_dir=None): + """ + Bind the domain represented by app_name to the locale directory locale_dir. + It has the effect of loading translations, enabling applications for different + languages. + + app_name: + a domain to look for translations, tipically the name of an application. + + locale_dir: + a directory with locales like locale_dir/lang_isocode/LC_MESSAGES/app_name.mo + If omitted or None, then the current binding for app_name is used. + """ + try: + import locale + import gettext + locale.setlocale(locale.LC_ALL, "") + gtk.glade.bindtextdomain(app_name, locale_dir) + gettext.install(app_name, locale_dir, unicode=1) + except (IOError,locale.Error), e: + print "Warning", app_name, e + __builtins__.__dict__["_"] = lambda x : x + + +class SimpleGladeApp: + + def __init__(self, path, root=None, domain=None, **kwargs): + """ + Load a glade file specified by glade_filename, using root as + root widget and domain as the domain for translations. + + If it receives extra named arguments (argname=value), then they are used + as attributes of the instance. + + path: + path to a glade filename. + If glade_filename cannot be found, then it will be searched in the + same directory of the program (sys.argv[0]) + + root: + the name of the widget that is the root of the user interface, + usually a window or dialog (a top level widget). + If None or ommited, the full user interface is loaded. + + domain: + A domain to use for loading translations. + If None or ommited, no translation is loaded. + + **kwargs: + a dictionary representing the named extra arguments. + It is useful to set attributes of new instances, for example: + glade_app = SimpleGladeApp("ui.glade", foo="some value", bar="another value") + sets two attributes (foo and bar) to glade_app. + """ + if os.path.isfile(path): + self.glade_path = path + else: + glade_dir = os.path.dirname( sys.argv[0] ) + self.glade_path = os.path.join(glade_dir, path) + for key, value in kwargs.items(): + try: + setattr(self, key, weakref.proxy(value) ) + except TypeError: + setattr(self, key, value) + self.glade = None + self.install_custom_handler(self.custom_handler) + self.glade = self.create_glade(self.glade_path, root, domain) + if root: + self.main_widget = self.get_widget(root) + else: + self.main_widget = None + self.normalize_names() + self.add_callbacks(self) + self.new() + + def __repr__(self): + class_name = self.__class__.__name__ + if self.main_widget: + root = gtk.Widget.get_name(self.main_widget) + repr = '%s(path="%s", root="%s")' % (class_name, self.glade_path, root) + else: + repr = '%s(path="%s")' % (class_name, self.glade_path) + return repr + + def new(self): + """ + Method called when the user interface is loaded and ready to be used. + At this moment, the widgets are loaded and can be refered as self.widget_name + """ + pass + + def add_callbacks(self, callbacks_proxy): + """ + It uses the methods of callbacks_proxy as callbacks. + The callbacks are specified by using: + Properties window -> Signals tab + in glade-2 (or any other gui designer like gazpacho). + + Methods of classes inheriting from SimpleGladeApp are used as + callbacks automatically. + + callbacks_proxy: + an instance with methods as code of callbacks. + It means it has methods like on_button1_clicked, on_entry1_activate, etc. + """ + self.glade.signal_autoconnect(callbacks_proxy) + + def normalize_names(self): + """ + It is internally used to normalize the name of the widgets. + It means a widget named foo:vbox-dialog in glade + is refered self.vbox_dialog in the code. + + It also sets a data "prefixes" with the list of + prefixes a widget has for each widget. + """ + for widget in self.get_widgets(): + widget_name = gtk.Widget.get_name(widget) + prefixes_name_l = widget_name.split(":") + prefixes = prefixes_name_l[ : -1] + widget_api_name = prefixes_name_l[-1] + widget_api_name = "_".join( re.findall(tokenize.Name, widget_api_name) ) + gtk.Widget.set_name(widget, widget_api_name) + if hasattr(self, widget_api_name): + raise AttributeError("instance %s already has an attribute %s" % (self,widget_api_name)) + else: + setattr(self, widget_api_name, widget) + if prefixes: + gtk.Widget.set_data(widget, "prefixes", prefixes) + + def add_prefix_actions(self, prefix_actions_proxy): + """ + By using a gui designer (glade-2, gazpacho, etc) + widgets can have a prefix in theirs names + like foo:entry1 or foo:label3 + It means entry1 and label3 has a prefix action named foo. + + Then, prefix_actions_proxy must have a method named prefix_foo which + is called everytime a widget with prefix foo is found, using the found widget + as argument. + + prefix_actions_proxy: + An instance with methods as prefix actions. + It means it has methods like prefix_foo, prefix_bar, etc. + """ + prefix_s = "prefix_" + prefix_pos = len(prefix_s) + + is_method = lambda t : callable( t[1] ) + is_prefix_action = lambda t : t[0].startswith(prefix_s) + drop_prefix = lambda (k,w): (k[prefix_pos:],w) + + members_t = inspect.getmembers(prefix_actions_proxy) + methods_t = filter(is_method, members_t) + prefix_actions_t = filter(is_prefix_action, methods_t) + prefix_actions_d = dict( map(drop_prefix, prefix_actions_t) ) + + for widget in self.get_widgets(): + prefixes = gtk.Widget.get_data(widget, "prefixes") + if prefixes: + for prefix in prefixes: + if prefix in prefix_actions_d: + prefix_action = prefix_actions_d[prefix] + prefix_action(widget) + + def custom_handler(self, + glade, function_name, widget_name, + str1, str2, int1, int2): + """ + Generic handler for creating custom widgets, internally used to + enable custom widgets (custom widgets of glade). + + The custom widgets have a creation function specified in design time. + Those creation functions are always called with str1,str2,int1,int2 as + arguments, that are values specified in design time. + + Methods of classes inheriting from SimpleGladeApp are used as + creation functions automatically. + + If a custom widget has create_foo as creation function, then the + method named create_foo is called with str1,str2,int1,int2 as arguments. + """ + try: + handler = getattr(self, function_name) + return handler(str1, str2, int1, int2) + except AttributeError: + return None + + def gtk_widget_show(self, widget, *args): + """ + Predefined callback. + The widget is showed. + Equivalent to widget.show() + """ + widget.show() + + def gtk_widget_hide(self, widget, *args): + """ + Predefined callback. + The widget is hidden. + Equivalent to widget.hide() + """ + widget.hide() + + def gtk_widget_grab_focus(self, widget, *args): + """ + Predefined callback. + The widget grabs the focus. + Equivalent to widget.grab_focus() + """ + widget.grab_focus() + + def gtk_widget_destroy(self, widget, *args): + """ + Predefined callback. + The widget is destroyed. + Equivalent to widget.destroy() + """ + widget.destroy() + + def gtk_window_activate_default(self, window, *args): + """ + Predefined callback. + The default widget of the window is activated. + Equivalent to window.activate_default() + """ + widget.activate_default() + + def gtk_true(self, *args): + """ + Predefined callback. + Equivalent to return True in a callback. + Useful for stopping propagation of signals. + """ + return True + + def gtk_false(self, *args): + """ + Predefined callback. + Equivalent to return False in a callback. + """ + return False + + def gtk_main_quit(self, *args): + """ + Predefined callback. + Equivalent to self.quit() + """ + self.quit() + + def main(self): + """ + Starts the main loop of processing events. + The default implementation calls gtk.main() + + Useful for applications that needs a non gtk main loop. + For example, applications based on gstreamer needs to override + this method with gst.main() + + Do not directly call this method in your programs. + Use the method run() instead. + """ + gtk.main() + + def quit(self): + """ + Quit processing events. + The default implementation calls gtk.main_quit() + + Useful for applications that needs a non gtk main loop. + For example, applications based on gstreamer needs to override + this method with gst.main_quit() + """ + gtk.main_quit() + + def run(self): + """ + Starts the main loop of processing events checking for Control-C. + + The default implementation checks wheter a Control-C is pressed, + then calls on_keyboard_interrupt(). + + Use this method for starting programs. + """ + try: + self.main() + except KeyboardInterrupt: + self.on_keyboard_interrupt() + + def on_keyboard_interrupt(self): + """ + This method is called by the default implementation of run() + after a program is finished by pressing Control-C. + """ + pass + + def install_custom_handler(self, custom_handler): + gtk.glade.set_custom_handler(custom_handler) + + def create_glade(self, glade_path, root, domain): + return gtk.glade.XML(self.glade_path, root, domain) + + def get_widget(self, widget_name): + return self.glade.get_widget(widget_name) + + def get_widgets(self): + return self.glade.get_widget_prefix("") Added: software/email_alert/sample_behavior_script.py =================================================================== --- software/email_alert/sample_behavior_script.py (rev 0) +++ software/email_alert/sample_behavior_script.py 2007-02-27 12:33:26 UTC (rev 91) @@ -0,0 +1,22 @@ +#!/usr/bin/python +# -*- coding: latin-1 -*- +# ----------------------------------------------- +# Initalization of modules +# uses objects "tux" and "tss" +# ----------------------------------------------- +import sys +sys.path.append('/opt/kysoh/tuxdroid/pythonlibs') +from tux import * +# ----------------------------------------------- +# Your script +# ----------------------------------------------- + +tux.cmd.wings_on(4) +tux.cmd.eyes_on(4) + + +# ----------------------------------------------- +# End of script +# ----------------------------------------------- +tux.sys.wait(1) +tux.disconnect_from_daemon() Added: software/email_alert/tdema.glade =================================================================== --- software/email_alert/tdema.glade (rev 0) +++ software/email_alert/tdema.glade 2007-02-27 12:33:26 UTC (rev 91) @@ -0,0 +1,951 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> +<requires lib="gnome"/> + +<widget class="GtkWindow" id="window1"> + <property name="height_request">472</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Tux Droid E-Mail Alert</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Sun, 18 Feb 2007 01:31:20 GMT"/> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="e_server"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">72</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="width_request">40</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Server:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="e_port"> + <property name="width_request">86</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">110</property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">40</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="width_request">34</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Port:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="e_login"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">72</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="width_request">35</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Login:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed4"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="e_password"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">72</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="width_request">63</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Password:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="sb_check"> + <property name="width_request">56</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 100 1 10 10</property> + </widget> + <packing> + <property name="x">152</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="width_request">152</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Check for new mail every</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label10"> + <property name="width_request">51</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">minutes.</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">211</property> + <property name="y">4</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>POP3 Account</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFixed" id="fixed6"> + <property name="visible">True</property> + + <child> + <widget class="GtkRadioButton" id="rb_wav"> + <property name="width_request">95</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">.wav file</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">2</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="cb_behavior"> + <property name="width_request">102</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Behavior</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">66</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="rb_tts"> + <property name="width_request">95</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">TTS</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">rb_wav</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">34</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed7"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="e_tts"> + <property name="width_request">256</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">Enter text here.</property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="fcb_wav"> + <property name="width_request">256</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Sélectionner un fichier</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + <signal name="selection_changed" handler="on_fcb_wav_selection_changed" last_modification_time="Sun, 18 Feb 2007 01:29:35 GMT"/> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="fcb_behavior"> + <property name="width_request">256</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Sélectionner un fichier</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + <signal name="selection_changed" handler="on_fcb_behavior_selection_changed" last_modification_time="Sun, 18 Feb 2007 01:29:48 GMT"/> + </widget> + <packing> + <property name="x">0</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="bt_test"> + <property name="width_request">120</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Test</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bt_test_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:14 GMT"/> + </widget> + <packing> + <property name="x">9</property> + <property name="y">96</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Notification</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed8"> + <property name="visible">True</property> + + <child> + <widget class="GtkCheckButton" id="cb_body"> + <property name="width_request">125</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Body message</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="cb_subject"> + <property name="width_request">164</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Subject & sender</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Read E-mail</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFixed" id="fixed9"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="width_request">77</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Select voice:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="width_request">104</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Select pitch level:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">36</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed10"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="sb_pitch"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">100 100 250 1 10 10</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkComboBoxEntry" id="cbbe_voice"> + <property name="width_request">248</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="items" translatable="yes">FR male +FR female +US male +US female</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>TTS configuration</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed11"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="bt_cancel"> + <property name="width_request">100</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bt_cancel_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:51 GMT"/> + </widget> + <packing> + <property name="x">168</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="bt_accept"> + <property name="width_request">100</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bt_accept_clicked" last_modification_time="Sun, 18 Feb 2007 01:30:57 GMT"/> + </widget> + <packing> + <property name="x">272</property> + <property name="y">8</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/email_alert/tdema.gladep =================================================================== --- software/email_alert/tdema.gladep (rev 0) +++ software/email_alert/tdema.gladep 2007-02-27 12:33:26 UTC (rev 91) @@ -0,0 +1,7 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> + +<glade-project> + <name>TDEMA</name> + <program_name>tdema</program_name> +</glade-project> Added: software/email_alert/tdema.py =================================================================== --- software/email_alert/tdema.py (rev 0) +++ software/email_alert/tdema.py 2007-02-27 12:33:26 UTC (rev 91) @@ -0,0 +1,244 @@ +#!/usr/bin/env python +# -*- coding: UTF8 -*- + +# -------------------------------------------------------------------- +# Tux Droid - E-Mail Alert +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# -------------------------------------------------------------------- +# $Id: $ +# -------------------------------------------------------------------- + +# ----------------------------------------------- +# Initalization of modules +# use object "tux" +# ----------------------------------------------- +import sys +sys.path.append('/opt/kysoh/tuxdroid/pythonlibs') +from tux import * +# ----------------------------------------------- +# Your script +# ----------------------------------------------- + +import os + +import gtk +import gnome + +from poplib import * +import thread +import email +import string +import email.Parser +from email.Header import decode_header + +from SimpleGladeApp import SimpleGladeApp +from SimpleGladeApp import bindtextdomain + +app_name = "tdema" +app_version = "0.0.1" + +glade_dir = "" +locale_dir = "" + +bindtextdomain(app_name, locale_dir) + +#------------------------------------------------------------------------------ +# Window class +#------------------------------------------------------------------------------ +class Window1(SimpleGladeApp): + + #-------------------------------------------------------------------------- + # Class init + #-------------------------------------------------------------------------- + def __init__(self, path="tdema.glade", + root="window1", + domain=app_name, **kwargs): + path = os.path.join(glade_dir, path) + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + self.wav_filename="None" + self.py_filename="None" + self.viewed_mail_list=[] + self.check_enabled=False + + #-------------------------------------------------------------------------- + # On new window + #-------------------------------------------------------------------------- + def new(self): + self.get_widget("cbbe_voice").set_active(2) + self.get_widget("e_password").set_visibility(False) + + #-------------------------------------------------------------------------- + # On close windows + #-------------------------------------------------------------------------- + def on_window1_destroy(self, widget, *args): + self.check_enabled=False + tux.sys.wait(1) + tux.disconnect_from_daemon() + sys.exit(0) + + #-------------------------------------------------------------------------- + # On wav file selected + #-------------------------------------------------------------------------- + def on_fcb_wav_selection_changed(self, widget, *args): + filename=widget.get_filename() + ext=len(filename)-filename.find(".wav") + if ext == 4 : + self.wav_filename=filename + else: + self.wav_filename="None" + widget.unselect_filename(filename) + + #-------------------------------------------------------------------------- + # On behavior file selected + #-------------------------------------------------------------------------- + def on_fcb_behavior_selection_changed(self, widget, *args): + filename=widget.get_filename() + ext=len(filename)-filename.find(".py") + if ext == 3 : + self.py_filename=filename + else: + self.py_filename="None" + widget.unselect_filename(filename) + + #-------------------------------------------------------------------------- + # On test notification button clicked + #-------------------------------------------------------------------------- + def on_bt_test_clicked(self, widget, *args): + self.on_alert() + + #-------------------------------------------------------------------------- + # On cancel button clicked + #-------------------------------------------------------------------------- + def on_bt_cancel_clicked(self, widget, *args): + self.check_enabled=False + tux.sys.wait(1) + tux.disconnect_from_daemon() + sys.exit(0) + + #-------------------------------------------------------------------------- + # On accept button clicked + #-------------------------------------------------------------------------- + def on_bt_accept_clicked(self, widget, *args): + if self.check_enabled: return + self.check_enabled=True + thread.start_new_thread(self.check_email,()) + + #-------------------------------------------------------------------------- + # On alert event + #-------------------------------------------------------------------------- + def on_alert(self): + if self.get_widget("cb_behavior").get_active(): + if self.py_filename!="None": + tux.sys.shell_free("python "+self.py_filename) + if self.get_widget("rb_wav").get_active(): + if self.wav_filename!="None": + tux.sys.shell_free("aplay -D hw:1 "+self.wav_filename) + else: + voice_cb=self.get_widget("cbbe_voice") + pitch_sb=self.get_widget("sb_pitch") + text_e=self.get_widget("e_tts") + tux.tts.select_voice(voice_cb.get_active()+1,pitch_sb.get_value()) + tux.tts.speak(text_e.get_text()) + + #-------------------------------------------------------------------------- + # Check mail thread + #-------------------------------------------------------------------------- + def check_email(self): + # Select voice and pitch + voice_cb=self.get_widget("cbbe_voice") + pitch_sb=self.get_widget("sb_pitch") + tux.tts.select_voice(voice_cb.get_active()+1,pitch_sb.get_value()) + while self.check_enabled: + # Connect to pop server + conn=POP3(self.get_widget("e_server").get_text()) + conn.user(self.get_widget("e_login").get_text()) + conn.pass_(self.get_widget("e_password").get_text()) + liste=conn.list()[1:2] + if len(liste[0])>0: + for k in range(len(liste[0])): + # Check if mail is old + old_mail=False + if len(self.viewed_mail_list)>0: + for uidl in self.viewed_mail_list: + if uidl==conn.uidl(k+1): + old_mail=True + if old_mail: continue + # Make a single string with mail + strraw = "" + for z in conn.top(k+1,1)[1]: strraw=strraw+z+"\n" + # Mark the mail as read + self.viewed_mail_list.append(conn.uidl(k+1)) + # Parse the email + p = email.Parser.Parser() + msg=p.parsestr(strraw) + # Get subject + subjecttxt=get_header_info(msg,"Subject") + # Get sender + tmptext=get_header_info(msg,"From") + idx=tmptext.find("<") + if idx>0: + fromtxt=tmptext[0:idx-1] + else: + fromtxt=tmptext + # Play the notification + self.on_alert() + if self.get_widget("cb_subject").get_active(): + tux.tts.speak("Envoyé par. "+fromtxt+".") + tux.tts.speak("Le sujet est. "+subjecttxt+".") + if self.get_widget("cb_body").get_active(): + tux.tts.speak("Voici le contenu de l'email. "+get_body(msg)) + conn.quit() + tux.sys.wait(self.get_widget("sb_check").get_value()) + +#------------------------------------------------------------------------------ +# get_header_info +#------------------------------------------------------------------------------ +def get_header_info(msg,entry): + tmp1=decode_header(msg[entry]) + if str(tmp1[0][1])=="None": + return tmp1[0][0] + else: + tmp2=unicode(tmp1[0][0],tmp1[0][1]) + return tmp2.encode('utf-8','replace') + +#------------------------------------------------------------------------------ +# get_body +#----------------... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2007-02-27 12:34:02
|
Author: jaguarondi Date: 2007-02-27 13:33:19 +0100 (Tue, 27 Feb 2007) New Revision: 90 Modified: daemon/trunk/AUTHORS daemon/trunk/COPYING daemon/trunk/Makefile daemon/trunk/NEWS daemon/trunk/README daemon/trunk/TODO daemon/trunk/USBDaemon_main.c Log: - CLN: eol-style keyword added Property changes on: daemon/trunk/AUTHORS ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/COPYING ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/NEWS ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/README ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/TODO ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/USBDaemon_main.c ___________________________________________________________________ Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 12:32:58
|
Author: jaguarondi Date: 2007-02-27 13:32:44 +0100 (Tue, 27 Feb 2007) New Revision: 89 Modified: daemon/trunk/AUTHORS daemon/trunk/COPYING daemon/trunk/NEWS daemon/trunk/README daemon/trunk/TODO daemon/trunk/libs/USBDaemon_command_tux.c daemon/trunk/libs/USBDaemon_command_tux.h daemon/trunk/libs/USBDaemon_globals.h daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h daemon/trunk/libs/USBDaemon_tcp_server.c daemon/trunk/libs/USBDaemon_tcp_server.h daemon/trunk/libs/USBDaemon_usb_enum.c daemon/trunk/libs/USBDaemon_usb_enum.h daemon/trunk/libs/USBDaemon_usb_readWrite.c daemon/trunk/libs/USBDaemon_usb_readWrite.h Log: - CLN: Id keyword added Modified: daemon/trunk/AUTHORS =================================================================== --- daemon/trunk/AUTHORS 2007-02-27 12:27:55 UTC (rev 88) +++ daemon/trunk/AUTHORS 2007-02-27 12:32:44 UTC (rev 89) @@ -1,4 +1,4 @@ -$Id: $ +$Id$ TUX Daemon was written by: Property changes on: daemon/trunk/AUTHORS ___________________________________________________________________ Name: svn:keywords + Id Property changes on: daemon/trunk/COPYING ___________________________________________________________________ Name: svn:keywords + Id Modified: daemon/trunk/NEWS =================================================================== --- daemon/trunk/NEWS 2007-02-27 12:27:55 UTC (rev 88) +++ daemon/trunk/NEWS 2007-02-27 12:32:44 UTC (rev 89) @@ -1,4 +1,4 @@ -$Id: $ +$Id$ Approximate change log for TUX Daemon by version. Property changes on: daemon/trunk/NEWS ___________________________________________________________________ Name: svn:keywords + Id Modified: daemon/trunk/README =================================================================== --- daemon/trunk/README 2007-02-27 12:27:55 UTC (rev 88) +++ daemon/trunk/README 2007-02-27 12:32:44 UTC (rev 89) @@ -1,4 +1,4 @@ -$Id: $ +$Id$ TUX Daemon is a daemon to control the tuxdroid robot. Property changes on: daemon/trunk/README ___________________________________________________________________ Name: svn:keywords + Id Modified: daemon/trunk/TODO =================================================================== --- daemon/trunk/TODO 2007-02-27 12:27:55 UTC (rev 88) +++ daemon/trunk/TODO 2007-02-27 12:32:44 UTC (rev 89) @@ -1,3 +1,3 @@ -$Id: $ +$Id$ Property changes on: daemon/trunk/TODO ___________________________________________________________________ Name: svn:keywords + Id Property changes on: daemon/trunk/libs/USBDaemon_command_tux.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_command_tux.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_globals.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_status_table.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_status_table.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_tcp_server.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_tcp_server.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_usb_enum.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_usb_enum.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_usb_readWrite.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: daemon/trunk/libs/USBDaemon_usb_readWrite.h ___________________________________________________________________ Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 12:28:30
|
Author: jaguarondi Date: 2007-02-27 13:27:55 +0100 (Tue, 27 Feb 2007) New Revision: 88 Added: daemon/trunk/USBDaemon.mdsp Log: -CLN: added fixed USBDaemon.mdsp Added: daemon/trunk/USBDaemon.mdsp =================================================================== --- daemon/trunk/USBDaemon.mdsp (rev 0) +++ daemon/trunk/USBDaemon.mdsp 2007-02-27 12:27:55 UTC (rev 88) @@ -0,0 +1,113 @@ +[Project] +name=USBDaemon +target=Linux +type=linuxconsole +defaultConfig=0 + +[Debug] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Debug +outputFilesDirectory=Debug +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory=|usr|include|glib-2.0;|usr|lib|glib-2.0|include +noWarning=0 +defaultWarning=0 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningsAsErrors=0 +debugType=1 +debugLevel=2 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=0 + +// linker +libraryPath=|usr|include|glib-2.0;|usr|lib|glib-2.0|include +outputFilename=.|TUXDaemon +libraries=glib-2.0;gthread-2.0;usb +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=0 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory=|usr|include|glib-2.0;|usr|lib|glib-2.0|include +extraResourceOptions= + +[Release] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Release +outputFilesDirectory=Release +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory= +noWarning=0 +defaultWarning=0 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningsAsErrors=0 +debugType=0 +debugLevel=1 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=2 + +// linker +libraryPath= +outputFilename=USBDaemon +libraries= +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=1 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory= +extraResourceOptions= + +[Source] +1=USBDaemon_main.c +2=libs|USBDaemon_usb_enum.c +3=libs|USBDaemon_usb_readWrite.c +4=libs|USBDaemon_status_table.c +5=libs|USBDaemon_command_tux.c +6=libs|USBDaemon_tcp_server.c +[Header] +1=libs|USBDaemon_globals.h +2=libs|USBDaemon_usb_enum.h +3=libs|USBDaemon_usb_readWrite.h +4=libs|USBDaemon_status_table.h +5=libs|USBDaemon_command_tux.h +6=libs|USBDaemon_tcp_server.h +7=tuxdefs|commands.h +[Resource] +[Other] +[History] +libs|USBDaemon_tcp_server.h,1596 +libs|USBDaemon_usb_readWrite.h,0 +libs|USBDaemon_usb_enum.h,1112 +libs|USBDaemon_command_tux.h,225 +libs|USBDaemon_status_table.h,2555 +tuxdefs|commands.h,5471 +libs|USBDaemon_usb_enum.c,2733 +libs|USBDaemon_globals.h,1769 +libs|USBDaemon_status_table.c,2868 +libs|USBDaemon_usb_readWrite.c,4163 +libs|USBDaemon_command_tux.c,7790 +libs|USBDaemon_tcp_server.c,4562 +USBDaemon_main.c,4736 Property changes on: daemon/trunk/USBDaemon.mdsp ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2007-02-27 12:14:25
|
Author: jaguarondi Date: 2007-02-27 13:14:08 +0100 (Tue, 27 Feb 2007) New Revision: 87 Removed: daemon/trunk/USBDaemon.mdsp Log: - CLN: couldn't fix the inconsistent line endings so I'm going to remove/add the file Deleted: daemon/trunk/USBDaemon.mdsp =================================================================== --- daemon/trunk/USBDaemon.mdsp 2007-02-27 11:44:07 UTC (rev 86) +++ daemon/trunk/USBDaemon.mdsp 2007-02-27 12:14:08 UTC (rev 87) @@ -1,113 +0,0 @@ -[Project] -name=USBDaemon -target=Linux -type=linuxconsole -defaultConfig=0 - -[Debug] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Debug -outputFilesDirectory=Debug -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory=|usr|include|glib-2.0;|usr|lib|glib-2.0|include -noWarning=0 -defaultWarning=0 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningsAsErrors=0 -debugType=1 -debugLevel=2 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=0 - -// linker -libraryPath=|usr|include|glib-2.0;|usr|lib|glib-2.0|include -outputFilename=.|TUXDaemon -libraries=glib-2.0;gthread-2.0;usb -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=0 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory=|usr|include|glib-2.0;|usr|lib|glib-2.0|include -extraResourceOptions= - -[Release] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Release -outputFilesDirectory=Release -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory= -noWarning=0 -defaultWarning=0 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningsAsErrors=0 -debugType=0 -debugLevel=1 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=2 - -// linker -libraryPath= -outputFilename=USBDaemon -libraries= -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=1 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory= -extraResourceOptions= - -[Source] -1=USBDaemon_main.c -2=libs|USBDaemon_usb_enum.c -3=libs|USBDaemon_usb_readWrite.c -4=libs|USBDaemon_status_table.c -5=libs|USBDaemon_command_tux.c -6=libs|USBDaemon_tcp_server.c -[Header] -1=libs|USBDaemon_globals.h -2=libs|USBDaemon_usb_enum.h -3=libs|USBDaemon_usb_readWrite.h -4=libs|USBDaemon_status_table.h -5=libs|USBDaemon_command_tux.h -6=libs|USBDaemon_tcp_server.h -7=tuxdefs|commands.h -[Resource] -[Other] -[History] -libs|USBDaemon_tcp_server.h,1596 -libs|USBDaemon_usb_readWrite.h,0 -libs|USBDaemon_usb_enum.h,1112 -libs|USBDaemon_command_tux.h,225 -libs|USBDaemon_status_table.h,2555 -tuxdefs|commands.h,5471 -libs|USBDaemon_usb_enum.c,2733 -libs|USBDaemon_globals.h,1769 -libs|USBDaemon_status_table.c,2868 -libs|USBDaemon_usb_readWrite.c,4163 -libs|USBDaemon_command_tux.c,7790 -libs|USBDaemon_tcp_server.c,4562 -USBDaemon_main.c,4736 |
From: remi <c2m...@c2...> - 2007-02-27 11:50:30
|
Author: remi Date: 2007-02-27 12:44:07 +0100 (Tue, 27 Feb 2007) New Revision: 86 Modified: daemon/trunk/libs/USBDaemon_globals.h daemon/trunk/libs/USBDaemon_tcp_server.c daemon/trunk/libs/USBDaemon_usb_enum.c daemon/trunk/libs/USBDaemon_usb_enum.h daemon/trunk/libs/USBDaemon_usb_readWrite.c Log: ADD : The "handle" and "device" variables for the USB element are renamed for deleting the ambiguous compilation. Modified: daemon/trunk/libs/USBDaemon_globals.h =================================================================== --- daemon/trunk/libs/USBDaemon_globals.h 2007-02-27 11:02:57 UTC (rev 85) +++ daemon/trunk/libs/USBDaemon_globals.h 2007-02-27 11:44:07 UTC (rev 86) @@ -22,22 +22,19 @@ #include <usb.h> #include <pthread.h> /*_____________________ D E F I N E S ______________________________________*/ -#define VERSION_MAJOR 0 -#define VERSION_MINOR 1 -#define VERSION_RELEASE 7 -#define TUX_PID 0xFF07 // Product ID -#define TUX_VID 0x03EB // Vendor ID -#define TUX_INTERFACE 0x03 -#define TUX_INTERFACECONFIG 0x01 -#define TUX_RECV_LENGTH 0x05 -#define TUX_SEND_LENGTH 0x05 -#define TUX_WRITE_EP 0x05 -#define TUX_READ_EP 0x84 -#define TUX_WRITE_TIMEOUT 1000 -#define TUX_READ_TIMEOUT 1000 +#define VERSION_MAJOR 0 +#define VERSION_MINOR 1 +#define VERSION_RELEASE 7 +#define TUX_PID 0xFF07 +#define TUX_VID 0x03EB +#define TUX_INTERFACE 0x03 +#define TUX_RECV_LENGTH 0x05 +#define TUX_SEND_LENGTH 0x05 +#define TUX_WRITE_EP 0x05 +#define TUX_READ_EP 0x84 +#define TUX_WRITE_TIMEOUT 1000 +#define TUX_READ_TIMEOUT 1000 /*_____________________ G L O B A L S _ V A R I A B L E S _______________________*/ -usb_dev_handle *handle; -struct usb_device* device; unsigned char CLOSE_DAEMON; unsigned char SHOW_TRAMES; unsigned char SHOW_RAW_STATUS; Modified: daemon/trunk/libs/USBDaemon_tcp_server.c =================================================================== --- daemon/trunk/libs/USBDaemon_tcp_server.c 2007-02-27 11:02:57 UTC (rev 85) +++ daemon/trunk/libs/USBDaemon_tcp_server.c 2007-02-27 11:44:07 UTC (rev 86) @@ -135,7 +135,6 @@ { int i; int tmp_handle; - unsigned char datas_recv[16]; pthread_mutex_lock(&tcp_mutex); if(TUX_TCP_STATUS==0){ @@ -171,7 +170,6 @@ ) { int tmp_handle; - unsigned char datas_recv[16]; pthread_mutex_lock(&tcp_mutex); if(TUX_TCP_STATUS==0){ Modified: daemon/trunk/libs/USBDaemon_usb_enum.c =================================================================== --- daemon/trunk/libs/USBDaemon_usb_enum.c 2007-02-27 11:02:57 UTC (rev 85) +++ daemon/trunk/libs/USBDaemon_usb_enum.c 2007-02-27 11:44:07 UTC (rev 86) @@ -35,16 +35,16 @@ usb_find_TuxDroid() { struct usb_bus *bus; - struct usb_device *device; + struct usb_device *tux_dev; usb_init(); usb_find_busses(); usb_find_devices(); for(bus=usb_busses;bus;bus=bus->next){ - for (device = bus->devices;device;device=device->next){ - if ((device->descriptor.idVendor == TUX_VID) &&(device->descriptor.idProduct == TUX_PID)){ - return device; + for (tux_dev = bus->devices;tux_dev;tux_dev=tux_dev->next){ + if ((tux_dev->descriptor.idVendor == TUX_VID) &&(tux_dev->descriptor.idProduct == TUX_PID)){ + return tux_dev; } } } @@ -56,29 +56,29 @@ // *********************************************************************** struct usb_dev_handle* usb_open_TuxDroid( - struct usb_device* device + struct usb_device* tux_dev ) { - usb_dev_handle *handle; + usb_dev_handle *tux_hdl; int error; // Open usb device - if (!(handle=usb_open(device))){ + if (!(tux_hdl=usb_open(tux_dev))){ printf("Open USB error\n"); return NULL; } // Claim device interface - error=usb_claim_interface(handle,TUX_INTERFACE); + error=usb_claim_interface(tux_hdl,TUX_INTERFACE); if (error!=0){ - usb_detach_kernel_driver_np(handle,TUX_INTERFACE); - error=usb_claim_interface(handle,TUX_INTERFACE); + usb_detach_kernel_driver_np(tux_hdl,TUX_INTERFACE); + error=usb_claim_interface(tux_hdl,TUX_INTERFACE); if (error!=0){ printf("Claim interface error\n"); return NULL; } } - return handle; + return tux_hdl; } // *********************************************************************** @@ -91,16 +91,16 @@ TUX_USB_STATUS=0; // Find Tux do{ - device=usb_find_TuxDroid() ; - if (device==NULL){ + tux_device=usb_find_TuxDroid() ; + if (tux_device==NULL){ printf("Tux dongle not found\n"); } sleep(1); - }while(!device); + }while(!tux_device); // Get Device handle - handle=usb_open_TuxDroid(device); - if(handle==NULL){ + tux_handle=usb_open_TuxDroid(tux_device); + if(tux_handle==NULL){ printf("You must load the daemon in root mode\n"); exit(1); } @@ -110,7 +110,7 @@ send_usb_dongle_cmd(0x02,0,0,0); current_audio_channel=0; // Read loop - while(handle){ + while(tux_handle){ usb_get_status_TuxDroid(); usleep(50000); } Modified: daemon/trunk/libs/USBDaemon_usb_enum.h =================================================================== --- daemon/trunk/libs/USBDaemon_usb_enum.h 2007-02-27 11:02:57 UTC (rev 85) +++ daemon/trunk/libs/USBDaemon_usb_enum.h 2007-02-27 11:44:07 UTC (rev 86) @@ -22,6 +22,8 @@ #include <usb.h> /*_____________________ D E F I N E S ______________________________________*/ /*_____________________ V A R I A B L E S ___________________________________*/ +usb_dev_handle *tux_handle; +struct usb_device* tux_device; int TUX_USB_STATUS; pthread_mutex_t usb_mutex; /*_____________________ F U N C T I O N S __________________________________*/ Modified: daemon/trunk/libs/USBDaemon_usb_readWrite.c =================================================================== --- daemon/trunk/libs/USBDaemon_usb_readWrite.c 2007-02-27 11:02:57 UTC (rev 85) +++ daemon/trunk/libs/USBDaemon_usb_readWrite.c 2007-02-27 11:44:07 UTC (rev 86) @@ -39,7 +39,7 @@ if (!TUX_USB_STATUS) return; for(i=0;i<5;i++){ pthread_mutex_lock(&usb_mutex); - idx=usb_bulk_read(handle,TUX_READ_EP,(char*)datas,TUX_RECV_LENGTH,TUX_READ_TIMEOUT); + idx=usb_bulk_read(tux_handle,TUX_READ_EP,(char*)datas,TUX_RECV_LENGTH,TUX_READ_TIMEOUT); pthread_mutex_unlock(&usb_mutex); if(idx!=TUX_RECV_LENGTH) i=0; @@ -68,14 +68,14 @@ pthread_mutex_unlock(&usb_mutex); return; } - idx=usb_bulk_write(handle,TUX_WRITE_EP,(char*)cmd_send,5,TUX_WRITE_TIMEOUT); + idx=usb_bulk_write(tux_handle,TUX_WRITE_EP,(char*)cmd_send,5,TUX_WRITE_TIMEOUT); if (idx<=0) { printf("Error : Tux dongle is busy or disconnected\n"); send_daemon_disconnected(); pthread_mutex_unlock(&usb_mutex); exit(1); } - idx=usb_bulk_read(handle,TUX_READ_EP,(char*)datas,64,TUX_READ_TIMEOUT); + idx=usb_bulk_read(tux_handle,TUX_READ_EP,(char*)datas,64,TUX_READ_TIMEOUT); if (idx<=0){ pthread_mutex_unlock(&usb_mutex); return; @@ -122,7 +122,7 @@ } // Send datas CMD_STATUS_FLAG=1; - idx=usb_bulk_write(handle,TUX_WRITE_EP,(char*)datas,TUX_SEND_LENGTH,TUX_WRITE_TIMEOUT); + idx=usb_bulk_write(tux_handle,TUX_WRITE_EP,(char*)datas,TUX_SEND_LENGTH,TUX_WRITE_TIMEOUT); counter=0; CSF=CMD_STATUS_FLAG; pthread_mutex_unlock(&usb_mutex); |
From: jaguarondi <c2m...@c2...> - 2007-02-27 11:19:48
|
Author: jaguarondi Date: 2007-02-27 12:02:57 +0100 (Tue, 27 Feb 2007) New Revision: 85 Modified: firmware/tuxdefs/commands.h firmware/tuxdefs/config.h firmware/tuxdefs/remote.h Log: - ADD: svn:eol-style properties Property changes on: firmware/tuxdefs/commands.h ___________________________________________________________________ Name: svn:eol-style + native Modified: firmware/tuxdefs/config.h =================================================================== --- firmware/tuxdefs/config.h 2007-02-27 09:56:22 UTC (rev 84) +++ firmware/tuxdefs/config.h 2007-02-27 11:02:57 UTC (rev 85) @@ -1,124 +1,124 @@ -/* KySoH iTux agent - * - * Config options for tux - * David Bourgeois - * -------------------------------------------------------- - * $Id$ - */ - -#ifndef _CONFIG_H_ -#define _CONFIG_H_ - -#include <avr/eeprom.h> - -#include "commands.h" - -/* - * Standalone events - */ - -#define SHORT_EVENT 16 -#define LONG_EVENT 31 -#define END_OF_ACTIONS 0xFF /* action time that indicates the end of commands */ - -/* Startup event */ -#define STARTUP_E_SEQ {\ - 24, RESET_WINGS_CMD, OPEN_EYES_CMD, LED_ON_CMD, 0, /* set wings low, open the eyes if closed and light them */\ - 20, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ - 18, PLAY_SOUND_CMD, 4, 0, 0, /* play the 'hello' sound */\ - 10, LED_OFF_CMD, CLOSE_MOUTH_CMD, 0, 0,\ - 0, COND_RESET_CMD, INFO_TUXCORE_CMD, 0, 0, /* reset the conditional flags */\ - END_OF_ACTIONS\ -} - -/* Head button event */ -#define HEAD_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ - END_OF_ACTIONS\ -} - -/* Left flipper button event */ -#define LEFT_FLIP_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ - END_OF_ACTIONS\ -} - -/* Right flipper event */ -#define RIGHT_FLIP_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ - END_OF_ACTIONS\ -} - -/* Start charging event */ -#define CHARGER_START_E_SEQ {\ - 0, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ - 0, LED_BLINK_CMD, 4, 50, 0, /* blink led's twice */\ - 0, PLAY_SOUND_CMD, 3, 0, 0, /* play a sound */\ - END_OF_ACTIONS\ -} - -/* Unplug event */ -#define UNPLUG_E_SEQ {\ - 3, PLAY_SOUND_CMD, 2, 0, 0, /* play a sound */\ - 0, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ - END_OF_ACTIONS\ -} - -/* RF connection event */ -#define RF_CONN_E_SEQ {\ - 0, LED_ON_CMD, 0, 0, 0, /* tun on the leds */\ - END_OF_ACTIONS\ -} - -/* RF disconnection event */ -#define RF_DISCONN_E_SEQ {\ - 0, LED_OFF_CMD, 0, 0, 0, /* tun off the leds */\ - END_OF_ACTIONS\ -} - -/* Tux greeting event */ -#define TUX_GR_E_SEQ {\ - 5, PLAY_SOUND_CMD, 6, 0, 0, /* play a sound */\ - 5, MOVE_MOUTH_CMD, 2, 0, 0,\ - END_OF_ACTIONS\ -} - -/* Tux greeting reply event */ -#define TUX_GR_REPL_E_SEQ {\ - 10, PLAY_SOUND_CMD, 7, 0, 0, /* play a sound */\ - 10, MOVE_MOUTH_CMD, 2, 0, 0,\ - 10, WAVE_WINGS_CMD, 2, 5, 0,\ - END_OF_ACTIONS\ -} - -/* Tux greeting second reply event */ -#define TUX_GR_REPL2_E_SEQ {\ - 10, PLAY_SOUND_CMD, 8, 0, 0, /* play a sound */\ - 10, MOVE_MOUTH_CMD, 2, 0, 0,\ - 0, WAVE_WINGS_CMD, 2, 5, 0,\ - END_OF_ACTIONS\ -} - -/* - * Configuration settings - */ -typedef struct -{ - uint8_t ir_feedback; /* flashes the leds when an ir code is received */ - uint8_t led_off_when_closed_eyes; /* turns off the leds when the eyes are closed */ - uint8_t tux_greeting; /* greeting when another tux is seen */ -} -tuxcore_config_t; - -typedef struct -{ - uint8_t automute; /* mutes the speaker when no sounds are played and unmute it when sound arrives, you can't use the line in in this mode as the insertion of a plug is not detected so the speaker won't be unmuted */ -} -tuxaudio_config_t; - -/* Default configurations */ -#define TUXCORE_CONFIG {1, 1, 0} -#define TUXAUDIO_CONFIG {0} - - -#endif /* _CONFIG_H_ */ +/* KySoH iTux agent + * + * Config options for tux + * David Bourgeois + * -------------------------------------------------------- + * $Id$ + */ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +#include <avr/eeprom.h> + +#include "commands.h" + +/* + * Standalone events + */ + +#define SHORT_EVENT 16 +#define LONG_EVENT 31 +#define END_OF_ACTIONS 0xFF /* action time that indicates the end of commands */ + +/* Startup event */ +#define STARTUP_E_SEQ {\ + 24, RESET_WINGS_CMD, OPEN_EYES_CMD, LED_ON_CMD, 0, /* set wings low, open the eyes if closed and light them */\ + 20, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ + 18, PLAY_SOUND_CMD, 4, 0, 0, /* play the 'hello' sound */\ + 10, LED_OFF_CMD, CLOSE_MOUTH_CMD, 0, 0,\ + 0, COND_RESET_CMD, INFO_TUXCORE_CMD, 0, 0, /* reset the conditional flags */\ + END_OF_ACTIONS\ +} + +/* Head button event */ +#define HEAD_E_SEQ {\ + 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + END_OF_ACTIONS\ +} + +/* Left flipper button event */ +#define LEFT_FLIP_E_SEQ {\ + 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + END_OF_ACTIONS\ +} + +/* Right flipper event */ +#define RIGHT_FLIP_E_SEQ {\ + 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + END_OF_ACTIONS\ +} + +/* Start charging event */ +#define CHARGER_START_E_SEQ {\ + 0, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ + 0, LED_BLINK_CMD, 4, 50, 0, /* blink led's twice */\ + 0, PLAY_SOUND_CMD, 3, 0, 0, /* play a sound */\ + END_OF_ACTIONS\ +} + +/* Unplug event */ +#define UNPLUG_E_SEQ {\ + 3, PLAY_SOUND_CMD, 2, 0, 0, /* play a sound */\ + 0, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ + END_OF_ACTIONS\ +} + +/* RF connection event */ +#define RF_CONN_E_SEQ {\ + 0, LED_ON_CMD, 0, 0, 0, /* tun on the leds */\ + END_OF_ACTIONS\ +} + +/* RF disconnection event */ +#define RF_DISCONN_E_SEQ {\ + 0, LED_OFF_CMD, 0, 0, 0, /* tun off the leds */\ + END_OF_ACTIONS\ +} + +/* Tux greeting event */ +#define TUX_GR_E_SEQ {\ + 5, PLAY_SOUND_CMD, 6, 0, 0, /* play a sound */\ + 5, MOVE_MOUTH_CMD, 2, 0, 0,\ + END_OF_ACTIONS\ +} + +/* Tux greeting reply event */ +#define TUX_GR_REPL_E_SEQ {\ + 10, PLAY_SOUND_CMD, 7, 0, 0, /* play a sound */\ + 10, MOVE_MOUTH_CMD, 2, 0, 0,\ + 10, WAVE_WINGS_CMD, 2, 5, 0,\ + END_OF_ACTIONS\ +} + +/* Tux greeting second reply event */ +#define TUX_GR_REPL2_E_SEQ {\ + 10, PLAY_SOUND_CMD, 8, 0, 0, /* play a sound */\ + 10, MOVE_MOUTH_CMD, 2, 0, 0,\ + 0, WAVE_WINGS_CMD, 2, 5, 0,\ + END_OF_ACTIONS\ +} + +/* + * Configuration settings + */ +typedef struct +{ + uint8_t ir_feedback; /* flashes the leds when an ir code is received */ + uint8_t led_off_when_closed_eyes; /* turns off the leds when the eyes are closed */ + uint8_t tux_greeting; /* greeting when another tux is seen */ +} +tuxcore_config_t; + +typedef struct +{ + uint8_t automute; /* mutes the speaker when no sounds are played and unmute it when sound arrives, you can't use the line in in this mode as the insertion of a plug is not detected so the speaker won't be unmuted */ +} +tuxaudio_config_t; + +/* Default configurations */ +#define TUXCORE_CONFIG {1, 1, 0} +#define TUXAUDIO_CONFIG {0} + + +#endif /* _CONFIG_H_ */ Property changes on: firmware/tuxdefs/config.h ___________________________________________________________________ Name: svn:eol-style + native Modified: firmware/tuxdefs/remote.h =================================================================== --- firmware/tuxdefs/remote.h 2007-02-27 09:56:22 UTC (rev 84) +++ firmware/tuxdefs/remote.h 2007-02-27 11:02:57 UTC (rev 85) @@ -1,57 +1,57 @@ -/* KySoH iTux agent - * - * General command listing - * David Bourgeois - * -------------------------------------------------------- - * $Id$ - */ - -#ifndef _REMOTE_H_ -#define _REMOTE_H_ - -#define K_0 0x00 -#define K_1 0x01 -#define K_2 0x02 -#define K_3 0x03 -#define K_4 0x04 -#define K_5 0x05 -#define K_6 0x06 -#define K_7 0x07 -#define K_8 0x08 -#define K_9 0x09 -#define K_STANDBY 0X0C -#define K_MUTE 0X0D -#define K_VOLUMEPLUS 0X10 -#define K_VOLUMEMINUS 0X11 -#define K_ESCAPE 0X12 -#define K_YES 0X13 -#define K_NO 0X14 -#define K_BACKSPACE 0X15 -#define K_STARTVOIP 0X16 -#define K_RECEIVECALL 0X17 -#define K_HANGUP 0X18 -#define K_STAR 0X19 -#define K_SHARP 0X1A -#define K_RED 0X1B -#define K_GREEN 0X1C -#define K_BLUE 0X1D -#define K_YELLOW 0X1E -#define K_CHANNELPLUS 0X20 -#define K_CHANNELMINUS 0X21 -#define K_UP 0X22 -#define K_DOWN 0X23 -#define K_LEFT 0X24 -#define K_RIGHT 0X25 -#define K_OK 0X26 -#define K_FASTREWIND 0X32 -#define K_FASTFORWARD 0X34 -#define K_PLAYPAUSE 0X35 -#define K_STOP 0X36 -#define K_RECORDING 0X37 -#define K_PREVIOUS 0X38 -#define K_NEXT 0X39 -#define K_MENU 0X3A -#define K_MOUSE 0X3B -#define K_ALT 0X3C - -#endif /* _REMOTE_H_ */ +/* KySoH iTux agent + * + * General command listing + * David Bourgeois + * -------------------------------------------------------- + * $Id$ + */ + +#ifndef _REMOTE_H_ +#define _REMOTE_H_ + +#define K_0 0x00 +#define K_1 0x01 +#define K_2 0x02 +#define K_3 0x03 +#define K_4 0x04 +#define K_5 0x05 +#define K_6 0x06 +#define K_7 0x07 +#define K_8 0x08 +#define K_9 0x09 +#define K_STANDBY 0X0C +#define K_MUTE 0X0D +#define K_VOLUMEPLUS 0X10 +#define K_VOLUMEMINUS 0X11 +#define K_ESCAPE 0X12 +#define K_YES 0X13 +#define K_NO 0X14 +#define K_BACKSPACE 0X15 +#define K_STARTVOIP 0X16 +#define K_RECEIVECALL 0X17 +#define K_HANGUP 0X18 +#define K_STAR 0X19 +#define K_SHARP 0X1A +#define K_RED 0X1B +#define K_GREEN 0X1C +#define K_BLUE 0X1D +#define K_YELLOW 0X1E +#define K_CHANNELPLUS 0X20 +#define K_CHANNELMINUS 0X21 +#define K_UP 0X22 +#define K_DOWN 0X23 +#define K_LEFT 0X24 +#define K_RIGHT 0X25 +#define K_OK 0X26 +#define K_FASTREWIND 0X32 +#define K_FASTFORWARD 0X34 +#define K_PLAYPAUSE 0X35 +#define K_STOP 0X36 +#define K_RECORDING 0X37 +#define K_PREVIOUS 0X38 +#define K_NEXT 0X39 +#define K_MENU 0X3A +#define K_MOUSE 0X3B +#define K_ALT 0X3C + +#endif /* _REMOTE_H_ */ Property changes on: firmware/tuxdefs/remote.h ___________________________________________________________________ Name: svn:eol-style + native |
From: <c2m...@c2...> - 2007-02-27 09:56:38
|
Author: jaguarondi Date: 2007-02-27 10:56:22 +0100 (Tue, 27 Feb 2007) New Revision: 84 Added: api/ Removed: libs/ tux-api/ Log: - CLN: moved libs to api - CLN: removed old tux-api folder that only contained old broken stuff Copied: api (from rev 83, libs) |
From: jaguarondi - 2007-02-26 18:09:45
|
Author: jaguarondi Date: 2007-02-26 19:08:34 +0100 (Mon, 26 Feb 2007) New Revision: 83 Added: software/ Removed: software/bootloader/ softwares/ Log: -CLN: renamed softwares to software -CLN: deleted software/bootloader which was not done from the previous commit Copied: software (from rev 82, softwares) |
From: jaguarondi - 2007-02-26 18:01:33
|
Author: jaguarondi Date: 2007-02-26 18:59:13 +0100 (Mon, 26 Feb 2007) New Revision: 82 Added: firmware/tuxup/ Log: -CLN: moved software/bootloader into firmware/tuxup Copied: firmware/tuxup (from rev 81, softwares/bootloader) |
From: added by p. f. a. <ap...@c2...> - 2007-02-26 13:46:13
|
Author: remi Date: 2007-02-26 14:45:05 +0100 (Mon, 26 Feb 2007) New Revision: 80 Modified: daemon/trunk/README daemon/trunk/USBDaemon.mdsp daemon/trunk/USBDaemon_main.c daemon/trunk/libs/USBDaemon_command_tux.c daemon/trunk/libs/USBDaemon_command_tux.h daemon/trunk/libs/USBDaemon_globals.h daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h daemon/trunk/libs/USBDaemon_tcp_server.c daemon/trunk/libs/USBDaemon_tcp_server.h daemon/trunk/libs/USBDaemon_usb_enum.c daemon/trunk/libs/USBDaemon_usb_enum.h daemon/trunk/libs/USBDaemon_usb_readWrite.c Log: ADD : Mutexes for stability. Client disconnecting bug corrected. Tabs to 4 spaces for indentation. Modified: daemon/trunk/README =================================================================== --- daemon/trunk/README 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/README 2007-02-26 13:45:05 UTC (rev 80) @@ -2,6 +2,14 @@ TUX Daemon is a daemon to control the tuxdroid robot. +usage : tuxdaemon [options] +options: + -d start in daemon mode + -v view in shell ( for daemon mode ) + -st show the structure of the usb trames + -sr show all raw statutes + -si show only invalid raw statutes + -h show this usage list For all information about tuxdroid, please visit: Modified: daemon/trunk/USBDaemon.mdsp =================================================================== --- daemon/trunk/USBDaemon.mdsp 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/USBDaemon.mdsp 2007-02-26 13:45:05 UTC (rev 80) @@ -98,19 +98,16 @@ [Resource] [Other] [History] -libs|USBDaemon_tcp_server.h,0 +libs|USBDaemon_tcp_server.h,1596 libs|USBDaemon_usb_readWrite.h,0 -libs|USBDaemon_usb_enum.h,0 -libs|USBDaemon_command_tux.h,273 -libs|USBDaemon_status_table.h,78 -libs|USBDaemon_tcp_server.c,1254 -libs|commands.h,2602 -libs|USBDaemon_status_table.c,17847 +libs|USBDaemon_usb_enum.h,1112 +libs|USBDaemon_command_tux.h,225 +libs|USBDaemon_status_table.h,2555 tuxdefs|commands.h,5471 -libs|USBDaemon_daemon_inf.c,501 -libs|USBDaemon_usb_enum.c,1806 -libs|USBDaemon_usb_readWrite.c,2716 -libs|USBDaemon_globals.h,841 -libs|USBDaemon_daemon_inf.h,0 -libs|USBDaemon_command_tux.c,7045 -USBDaemon_main.c,1789 +libs|USBDaemon_usb_enum.c,2733 +libs|USBDaemon_globals.h,1769 +libs|USBDaemon_status_table.c,2868 +libs|USBDaemon_usb_readWrite.c,4163 +libs|USBDaemon_command_tux.c,7790 +libs|USBDaemon_tcp_server.c,4562 +USBDaemon_main.c,4736 Modified: daemon/trunk/USBDaemon_main.c =================================================================== --- daemon/trunk/USBDaemon_main.c 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/USBDaemon_main.c 2007-02-26 13:45:05 UTC (rev 80) @@ -36,164 +36,164 @@ #include "libs/USBDaemon_status_table.h" /*_____________________ F U N C T I O N S __________________________________*/ - // *********************************************************************** - // Print_info_daemon - // *********************************************************************** - void - print_info_daemon() - { - printf("-----------------------------------\n"); - printf("Tux USB Daemon V%d.%d.%d\n",VERSION_MAJOR,VERSION_MINOR,VERSION_RELEASE); - printf("Kysoh 2007.\n"); - printf("-----------------------------------\n"); - } + // *********************************************************************** + // Print_info_daemon + // *********************************************************************** + void + print_info_daemon() + { + printf("-----------------------------------\n"); + printf("Tux USB Daemon V%d.%d.%d\n",VERSION_MAJOR,VERSION_MINOR,VERSION_RELEASE); + printf("Kysoh 2007.\n"); + printf("-----------------------------------\n"); + } - // *********************************************************************** - // On_close_daemon - // *********************************************************************** - void - on_close_daemon() - { - send_daemon_disconnected(); - printf("Daemon closed\n"); - exit(0); - } - - // *********************************************************************** - // Daemonizer - // *********************************************************************** - void - daemonize(unsigned char shell_view) - { - pid_t pid,sid; - - pid=fork(); - switch(pid){ - case 0: - break; - case -1: //erreur - exit(1); - break; - default : - exit(0); - } - umask(0); - sid=setsid(); - if(sid<0){ - perror("sid"); - exit(1); - } - if(chdir("/")<0){ - perror("chdir"); - exit(1); - } - DAEMON_PID=(unsigned short)getpid(); - printf("Daemon started : pid=%d\n",(int)getpid()); - // No shell - if(!shell_view) - { - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); - } - } - - // *********************************************************************** - // Show usages of tux daemon - // *********************************************************************** - void - usage() - { - printf("usage : tuxdaemon [options]\n"); - printf("options:\n"); - printf(" -d start in daemon mode\n"); - printf(" -v view in shell ( for daemon mode )\n"); - printf(" -st show the structure of the usb trames\n"); - printf(" -sr show all raw statutes\n"); - printf(" -si show only invalid raw statutes\n"); - printf(" -h show this usage list\n"); - } + // *********************************************************************** + // On_close_daemon + // *********************************************************************** + void + on_close_daemon() + { + send_daemon_disconnected(); + printf("Daemon closed\n"); + exit(0); + } + + // *********************************************************************** + // Daemonizer + // *********************************************************************** + void + daemonize(unsigned char shell_view) + { + pid_t pid,sid; + + pid=fork(); + switch(pid){ + case 0: + break; + case -1: //erreur + exit(1); + break; + default : + exit(0); + } + umask(0); + sid=setsid(); + if(sid<0){ + perror("sid"); + exit(1); + } + if(chdir("/")<0){ + perror("chdir"); + exit(1); + } + DAEMON_PID=(unsigned short)getpid(); + printf("Daemon started : pid=%d\n",(int)getpid()); + // No shell + if(!shell_view) + { + close(STDIN_FILENO); + close(STDOUT_FILENO); + close(STDERR_FILENO); + } + } + + // *********************************************************************** + // Show usages of tux daemon + // *********************************************************************** + void + usage() + { + printf("usage : tuxdaemon [options]\n"); + printf("options:\n"); + printf(" -d start in daemon mode\n"); + printf(" -v view in shell ( for daemon mode )\n"); + printf(" -st show the structure of the usb trames\n"); + printf(" -sr show all raw statutes\n"); + printf(" -si show only invalid raw statutes\n"); + printf(" -h show this usage list\n"); + } - // *********************************************************************** - // USBDaemon main function - // *********************************************************************** - int - main( - int argc, - char *argv[] - ) - { - GMainLoop *loop; - GThread *UsbThread; - GThread *TcpThread; - GError *error=NULL; - unsigned char i; - unsigned char shell_view; - unsigned char daemonized; - - // Print daemon informations - print_info_daemon(); - // Program arguments - daemonized=0; - shell_view=0; - SHOW_TRAMES=0; - SHOW_RAW_STATUS=0; - SHOW_INVALID_RAW=0; - if(argc>1){ - for(i=1;i<argc;i++){ - if(!strcmp("-v", argv[i])) - shell_view=1; - else if(!strcmp("-d", argv[i])) - daemonized=1; - else if(!strcmp("-st", argv[i])) - SHOW_TRAMES=1; - else if(!strcmp("-sr", argv[i])) - SHOW_RAW_STATUS=1; - else if(!strcmp("-si", argv[i])) - SHOW_INVALID_RAW=1; - else if(!strcmp("-h", argv[i])){ - usage(); - exit(1); - }else{ - usage(); - exit(1); - } - } - } - if(daemonized) - daemonize(shell_view); - // On exiting - signal(SIGINT, on_close_daemon); - signal(SIGKILL, on_close_daemon); - // Gestion Multithread - if (!g_thread_supported()) { - g_thread_init(NULL); - }else{ - printf("g_thread NOT supported\n"); - return 1; - } - - TUX_USB_STATUS=0; - TUX_TCP_STATUS=0; - CLOSE_DAEMON=0; - last_remote_key=0xFF; - last_toggle_key=0xFF; - sound_flash_count=0; - - // Start USB task thread - if ((UsbThread = g_thread_create((GThreadFunc)usb_start_task,NULL,TRUE,&error))== NULL ) { - printf("Thread creation failed: %s \n",error->message); - return 2; - } - - // Start TCP task thread - if ((TcpThread = g_thread_create((GThreadFunc)tcp_server_start_task,NULL,TRUE,&error))== NULL ) { - printf("Thread creation failed: %s \n",error->message); - return 2; - } - loop = g_main_loop_new(NULL,FALSE); - g_main_loop_run(loop); - return 0; - } + // *********************************************************************** + // USBDaemon main function + // *********************************************************************** + int + main( + int argc, + char *argv[] + ) + { + GMainLoop *loop; + GThread *UsbThread; + GThread *TcpThread; + GError *error=NULL; + unsigned char i; + unsigned char shell_view; + unsigned char daemonized; + + // Print daemon informations + print_info_daemon(); + // Program arguments + daemonized=0; + shell_view=0; + SHOW_TRAMES=0; + SHOW_RAW_STATUS=0; + SHOW_INVALID_RAW=0; + if(argc>1){ + for(i=1;i<argc;i++){ + if(!strcmp("-v", argv[i])) + shell_view=1; + else if(!strcmp("-d", argv[i])) + daemonized=1; + else if(!strcmp("-st", argv[i])) + SHOW_TRAMES=1; + else if(!strcmp("-sr", argv[i])) + SHOW_RAW_STATUS=1; + else if(!strcmp("-si", argv[i])) + SHOW_INVALID_RAW=1; + else if(!strcmp("-h", argv[i])){ + usage(); + exit(1); + }else{ + usage(); + exit(1); + } + } + } + if(daemonized) + daemonize(shell_view); + // On exiting + signal(SIGINT, on_close_daemon); + signal(SIGKILL, on_close_daemon); + // Gestion Multithread + if (!g_thread_supported()) { + g_thread_init(NULL); + }else{ + printf("g_thread NOT supported\n"); + return 1; + } + + TUX_USB_STATUS=0; + TUX_TCP_STATUS=0; + CLOSE_DAEMON=0; + last_remote_key=0xFF; + last_toggle_key=0xFF; + sound_flash_count=0; + + // Start USB task thread + if ((UsbThread = g_thread_create((GThreadFunc)usb_start_task,NULL,TRUE,&error))== NULL ) { + printf("Thread creation failed: %s \n",error->message); + return 2; + } + + // Start TCP task thread + if ((TcpThread = g_thread_create((GThreadFunc)tcp_server_start_task,NULL,TRUE,&error))== NULL ) { + printf("Thread creation failed: %s \n",error->message); + return 2; + } + loop = g_main_loop_new(NULL,FALSE); + g_main_loop_run(loop); + return 0; + } - + Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2007-02-26 13:45:05 UTC (rev 80) @@ -32,566 +32,621 @@ // *************************************************************************** // COMMANDS FROM CLIENTS DISPATCHER // *************************************************************************** - void - commands_dispatcher( - unsigned char client_id, // Client source - unsigned char src_trame[16] // Source trame - ) - { - unsigned char ACK_DP; // daemon processing ack - unsigned char data[12]; // data part of source trame - unsigned char result[12]; // result data to return - unsigned char tcp_trame[16];// tcp trame to send - unsigned char ack_dp_trame[16]; - unsigned char i; - + void + commands_dispatcher( + unsigned char client_id, // Client source + unsigned char src_trame[16] // Source trame + ) + { + unsigned char ACK_DP; // daemon processing ack + unsigned char data[12]; // data part of source trame + unsigned char result[12]; // result data to return + unsigned char tcp_trame[16];// tcp trame to send + unsigned char ack_dp_trame[16]; + unsigned char i; + unsigned char no_ack; + - // Cut data part of source trame - for(i=0;i<12;i++){ - result[i]=0; - data[i]=src_trame[i+4]; - } - // Make source header - tcp_trame[0]=src_trame[0]; // return source - tcp_trame[1]=src_trame[1]; // return sub source - - // -------------------- Data disencapsulation ----------------------// - ACK_DP=ACK_DP_OK; // Init ACK daemon processing - // B1 ---- : Destination - switch(src_trame[0]){ - // To Master Daemon ---------------------------------------------- - case DEST_MASTER_DAEMON: - // Not implemented - ACK_DP=ACK_DP_NI; - break; - // To Sub Daemon ------------------------------------------------- - case DEST_SUB_DAEMON: - // B3 ---- Data Type - switch(src_trame[2]){ - // Data type command - case DATA_TP_CMD: - // B4 ---- Command type - tcp_trame[2]=DATA_TP_ACK_CMD; - tcp_trame[3]=src_trame[3]; - switch(src_trame[3]){ - // Command type raw - case SUBDATA_TP_RAW: - // Not implemented - ACK_DP=ACK_DP_NI; - break; - // Command type structured - case SUBDATA_TP_STRUCT: - sub_daemon_cmd_struct(data,result,client_id); - break; - // Unknowed command type - default: - ACK_DP=ACK_DP_UKN_SUBDATA_TP; - break; - } - break; - // Data type request - case DATA_TP_REQ: - tcp_trame[2]=DATA_TP_RSP; - tcp_trame[3]=src_trame[3]; - // B4 ---- Request type - switch(src_trame[3]){ - // Request type status - case SUBDATA_TP_STATUS: - // Not implemented - ACK_DP=ACK_DP_NI; - break; - // Request type information - case SUBDATA_TP_INFO: - sub_daemon_req_info(data,result,client_id); - break; - // Unknowed request type - default: - ACK_DP=ACK_DP_UKN_SUBDATA_TP; - break; - } - break; - // Unknowed data type - default: - ACK_DP=ACK_DP_UKN_DATA_TP; - break; - } - break; - // To Tux -------------------------------------------------------- - case DEST_TUX: - // TODO sub destinations - // B3 ---- Data Type - switch(src_trame[2]){ - // Data type command - case DATA_TP_CMD: - tcp_trame[2]=DATA_TP_ACK_CMD; - tcp_trame[3]=src_trame[3]; - // B4 ---- Command type - switch(src_trame[3]){ - // Command type raw - case SUBDATA_TP_RAW: - tux_cmd_raw(data,result); - break; - // Command type structured - case SUBDATA_TP_STRUCT: - tux_cmd_struct(data,result); - break; - // Unknowed command type - default: - ACK_DP=ACK_DP_UKN_SUBDATA_TP; - break; - } - break; - // Data type request - case DATA_TP_REQ: - tcp_trame[2]=DATA_TP_RSP; - tcp_trame[3]=src_trame[3]; - // B4 ---- Request type - switch(src_trame[3]){ - // Request type status - case SUBDATA_TP_STATUS: - tux_req_status(data,result); - break; - // Request type information - case SUBDATA_TP_INFO: - tux_req_info(data,result); - break; - // Unknowed request type - default: - ACK_DP=ACK_DP_UKN_SUBDATA_TP; - break; - } - break; - // Unknowed data type - default: - ACK_DP=ACK_DP_UKN_DATA_TP; - break; - } - break; - // To Resource --------------------------------------------------- - case DEST_RESOURCE: - // Not implemented - ACK_DP=ACK_DP_NI; - break; - // To Client ----------------------------------------------------- - case DEST_CLIENT: - // Not implemented - ACK_DP=ACK_DP_NI; - break; - // Unknowed destination ------------------------------------------ - default: - ACK_DP=ACK_DP_UKN_DEST; - break; - } - - // Paste result treatement into tcp trame - for(i=0;i<12;i++) - tcp_trame[i+4]=result[i]; - // Send daemon processing ack to client - for(i=0;i<16;i++)ack_dp_trame[i]=0; - ack_dp_trame[0]=src_trame[0]; - ack_dp_trame[1]=src_trame[1]; - ack_dp_trame[2]=DATA_TP_ACK_DP; - ack_dp_trame[3]=src_trame[3]; - ack_dp_trame[4]=ACK_DP; - tcp_server_send_raw_to_client(client_id,ack_dp_trame, 16); - // Send tcp trame to client - if(ACK_DP==ACK_DP_OK){ - tcp_server_send_raw_to_client(client_id,tcp_trame, 16); - } - } - + no_ack=0; + // Cut data part of source trame + for(i=0;i<12;i++){ + result[i]=0; + data[i]=src_trame[i+4]; + } + // Make source header + tcp_trame[0]=src_trame[0]; // return source + tcp_trame[1]=src_trame[1]; // return sub source + + // -------------------- Data disencapsulation ----------------------// + ACK_DP=ACK_DP_OK; // Init ACK daemon processing + // B1 ---- : Destination + switch(src_trame[0]){ + // To Master Daemon ---------------------------------------------- + case DEST_MASTER_DAEMON: + // Not implemented + ACK_DP=ACK_DP_NI; + break; + // To Sub Daemon ------------------------------------------------- + case DEST_SUB_DAEMON: + // B3 ---- Data Type + switch(src_trame[2]){ + // Data type command + case DATA_TP_CMD: + // B4 ---- Command type + tcp_trame[2]=DATA_TP_ACK_CMD; + tcp_trame[3]=src_trame[3]; + switch(src_trame[3]){ + // Command type raw + case SUBDATA_TP_RAW: + // Not implemented + ACK_DP=ACK_DP_NI; + break; + // Command type structured + case SUBDATA_TP_STRUCT: + sub_daemon_cmd_struct(data,result,client_id); + if(result[0]==ACK_CMD_NO_ACK) no_ack=1; + break; + // Unknowed command type + default: + ACK_DP=ACK_DP_UKN_SUBDATA_TP; + break; + } + break; + // Data type request + case DATA_TP_REQ: + tcp_trame[2]=DATA_TP_RSP; + tcp_trame[3]=src_trame[3]; + // B4 ---- Request type + switch(src_trame[3]){ + // Request type status + case SUBDATA_TP_STATUS: + // Not implemented + ACK_DP=ACK_DP_NI; + break; + // Request type information + case SUBDATA_TP_INFO: + sub_daemon_req_info(data,result,client_id); + break; + // Unknowed request type + default: + ACK_DP=ACK_DP_UKN_SUBDATA_TP; + break; + } + break; + // Unknowed data type + default: + ACK_DP=ACK_DP_UKN_DATA_TP; + break; + } + break; + // To Tux -------------------------------------------------------- + case DEST_TUX: + // TODO sub destinations + // B3 ---- Data Type + switch(src_trame[2]){ + // Data type command + case DATA_TP_CMD: + tcp_trame[2]=DATA_TP_ACK_CMD; + tcp_trame[3]=src_trame[3]; + // B4 ---- Command type + switch(src_trame[3]){ + // Command type raw + case SUBDATA_TP_RAW: + tux_cmd_raw(data,result); + break; + // Command type structured + case SUBDATA_TP_STRUCT: + tux_cmd_struct(data,result); + break; + // Unknowed command type + default: + ACK_DP=ACK_DP_UKN_SUBDATA_TP; + break; + } + break; + // Data type request + case DATA_TP_REQ: + tcp_trame[2]=DATA_TP_RSP; + tcp_trame[3]=src_trame[3]; + // B4 ---- Request type + switch(src_trame[3]){ + // Request type status + case SUBDATA_TP_STATUS: + tux_req_status(data,result); + break; + // Request type information + case SUBDATA_TP_INFO: + tux_req_info(data,result); + break; + // Unknowed request type + default: + ACK_DP=ACK_DP_UKN_SUBDATA_TP; + break; + } + break; + // Unknowed data type + default: + ACK_DP=ACK_DP_UKN_DATA_TP; + break; + } + break; + // To Resource --------------------------------------------------- + case DEST_RESOURCE: + // Not implemented + ACK_DP=ACK_DP_NI; + break; + // To Client ----------------------------------------------------- + case DEST_CLIENT: + // Not implemented + ACK_DP=ACK_DP_NI; + break; + // Unknowed destination ------------------------------------------ + default: + ACK_DP=ACK_DP_UKN_DEST; + break; + } + + // Paste result treatement into tcp trame + for(i=0;i<12;i++) + tcp_trame[i+4]=result[i]; + // Send daemon processing ack to client + for(i=0;i<16;i++)ack_dp_trame[i]=0; + ack_dp_trame[0]=src_trame[0]; + ack_dp_trame[1]=src_trame[1]; + ack_dp_trame[2]=DATA_TP_ACK_DP; + ack_dp_trame[3]=src_trame[3]; + ack_dp_trame[4]=ACK_DP; + if(!no_ack){ + tcp_server_send_raw_to_client(client_id,ack_dp_trame, 16); + // Send tcp trame to client + if(ACK_DP==ACK_DP_OK){ + tcp_server_send_raw_to_client(client_id,tcp_trame, 16); + } + } + } + // *********************************************************************** // FOR Sub daemon // *********************************************************************** - - // ******************************************************************* - // sub_daemon_cmd_struct() - // ******************************************************************* - void - sub_daemon_cmd_struct( - unsigned char data[], - unsigned char result[], - int id_client - ) - { - unsigned char i; - - switch(data[0]){ - case SUB_D_CMD_STRUC_DISCONNECT_CLIENT: - // Byte 2 equal id client to disconnect - if (tcp_clients_handle[data[1]]!=0){ - tcp_clients_handle[data[1]]=0; - tcp_clients_count--; - printf("TCP socket : Client %d is disconnected\n",data[1]); - result[0]=ACK_CMD_OK; - }else{ // Bad id client - result[0]=ACK_CMD_KO; - } - break; - case SUB_D_CMD_STRUC_KILL_DAEMON: - send_daemon_disconnected(); - result[0]=ACK_CMD_OK; - exit(0); - break; - case SUB_D_CMD_STRUC_DEFINE_CLIENT_NAME: - for(i=0;i<11;i++) - tcp_clients_name[id_client][i]=data[i+1]; - result[0]=ACK_CMD_OK; - printf("Name of client %d is %s\n",id_client,tcp_clients_name[id_client]); - break; - } - } - - // *********************************************************************** - // sub_daemon_req_info() - // *********************************************************************** - void - sub_daemon_req_info( - unsigned char data[], - unsigned char result[], - int id_client - ) - { - unsigned char i; - - result[0]=data[0]; - switch(data[0]){ - case SUB_D_REQ_INFO_VERSION: - result[1]=VERSION_MAJOR; - result[2]=VERSION_MINOR; - result[3]=VERSION_RELEASE; - break; - case SUB_D_REQ_INFO_CLIENT_COUNT: - result[1]=tcp_clients_count; - break; - case SUB_D_REQ_INFO_CLIENT_NAME: - for(i=0;i<11;i++) - result[i+1]=tcp_clients_name[data[1]][i]; - break; - case SUB_D_REQ_INFO_MY_CLIENT_ID: - result[1]=id_client; - break; - case SUB_D_REQ_INFO_PID: - result[1]=(DAEMON_PID && 0xFF00)>>8; - result[2]=(DAEMON_PID && 0x00FF); - break; - } - } - + + // ******************************************************************* + // sub_daemon_cmd_struct() + // ******************************************************************* + void + sub_daemon_cmd_struct( + unsigned char data[], + unsigned char result[], + int id_client + ) + { + unsigned char i; + int my_client_handle; + + switch(data[0]){ + case SUB_D_CMD_STRUC_DISCONNECT_CLIENT: + pthread_mutex_lock(&tcp_mutex); + // Byte 2 equal id client to disconnect + if (tcp_clients_handle[data[1]]!=0){ + tcp_clients_handle[data[1]]=0; + tcp_clients_count--; + printf("TCP socket : Client %d is disconnected\n",data[1]); + result[0]=ACK_CMD_OK; + }else{ // Bad id client + result[0]=ACK_CMD_KO; + } + pthread_mutex_unlock(&tcp_mutex); + break; + case SUB_D_CMD_STRUC_DISCONNECT_CLIENT_ME: + pthread_mutex_lock(&tcp_mutex); + my_client_handle=tcp_clients_handle[id_client]; + tcp_clients_handle[id_client]=0; + tcp_clients_count--; + printf("TCP socket : Client %d is disconnected\n",id_client); + close(my_client_handle); + result[0]=ACK_CMD_NO_ACK; + pthread_mutex_unlock(&tcp_mutex); + break; + case SUB_D_CMD_STRUC_KILL_DAEMON: + printf("WARNING : daemon killed by user\n"); + send_daemon_disconnected(); + result[0]=ACK_CMD_OK; + exit(0); + break; + case SUB_D_CMD_STRUC_DEFINE_CLIENT_NAME: + for(i=0;i<11;i++) + tcp_clients_name[id_client][i]=data[i+1]; + result[0]=ACK_CMD_OK; + printf("Name of client %d is %s\n",id_client,tcp_clients_name[id_client]); + break; + } + } + + // *********************************************************************** + // sub_daemon_req_info() + // *********************************************************************** + void + sub_daemon_req_info( + unsigned char data[], + unsigned char result[], + int id_client + ) + { + unsigned char i; + + result[0]=data[0]; + switch(data[0]){ + case SUB_D_REQ_INFO_VERSION: + result[1]=VERSION_MAJOR; + result[2]=VERSION_MINOR; + result[3]=VERSION_RELEASE; + break; + case SUB_D_REQ_INFO_CLIENT_COUNT: + result[1]=tcp_clients_count; + break; + case SUB_D_REQ_INFO_CLIENT_NAME: + for(i=0;i<11;i++) + result[i+1]=tcp_clients_name[data[1]][i]; + break; + case SUB_D_REQ_INFO_MY_CLIENT_ID: + result[1]=id_client; + break; + case SUB_D_REQ_INFO_PID: + result[1]=(DAEMON_PID && 0xFF00)>>8; + result[2]=(DAEMON_PID && 0x00FF); + break; + } + } + // *************************************************************************** // FOR Tux droid // *************************************************************************** - - // *********************************************************************** - // tux_cmd_raw() - // *********************************************************************** - void - tux_cmd_raw( - unsigned char data[], - unsigned char result[] - ) - { - unsigned char usb_send[5]; - unsigned char i; - - usb_send[0]=0; - for(i=1;i<5;i++) - usb_send[i]=data[i-1]; - result[0]=usb_write_TuxDroid(usb_send); - } - - // *********************************************************************** - // tux_cmd_struct() - // *********************************************************************** - void - tux_cmd_struct( - unsigned char data[], - unsigned char result[] - ) - { - unsigned char ACK; - - // Command type - switch(data[0]){ - case TUX_CMD_STRUCT_EYES: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(BLINK_EYES_CMD,data[2],0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(STOP_EYES_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_MOUTH: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(MOVE_MOUTH_CMD,data[2],0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(STOP_MOUTH_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_WINGS: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(WAVE_WINGS_CMD,data[2],data[3],0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(STOP_WINGS_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_SPINL: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(SPIN_LEFT_CMD,data[2],data[3],0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(STOP_SPIN_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_SPINR: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(SPIN_RIGHT_CMD,data[2],data[3],0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(STOP_SPIN_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_IR: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(TURN_IR_ON_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(TURN_IR_OFF_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_SEND: - ACK=send_usb_tux_cmd(IR_SEND_RC5_CMD,data[2],data[3],0); - break; - } - break; - case TUX_CMD_STRUCT_LEDS: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(LED_ON_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(LED_OFF_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_BLINK: - ACK=send_usb_tux_cmd(LED_BLINK_CMD,data[2],data[3],0); - break; - } - break; - case TUX_CMD_STRUCT_LEDL: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(LED_L_ON_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(LED_L_OFF_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_LEDR: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(LED_R_ON_CMD,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(LED_R_OFF_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_SOUND: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_PLAY: - ACK=send_usb_tux_cmd(PLAY_SOUND_CMD,data[2],data[3],0); - break; - case TUX_CMD_STRUCT_SUB_STORING: - ACK=send_usb_tux_cmd(STORE_SOUND_CMD,data[2],0,0); - break; - case TUX_CMD_STRUCT_SUB_STORE_INDEX: - ACK=send_usb_tux_cmd(STORE_INDEX_CMD,data[2],data[3],data[4]); - break; - case TUX_CMD_STRUCT_SUB_TEST: - ACK=send_usb_tux_cmd(TEST_SOUND_CMD,0,0,0); - break; - } - break; - case TUX_CMD_STRUCT_PING: - pong_received=0; - ACK=send_usb_tux_cmd(PING_CMD,data[2],0,0); - break; - case TUX_CMD_STRUCT_SLEEP: - switch(data[1]){ - case TUX_CMD_STRUCT_SUB_ON: - ACK=send_usb_tux_cmd(0x20,0,0,0); - break; - case TUX_CMD_STRUCT_SUB_OFF: - ACK=send_usb_tux_cmd(0x21,0,0,0); - break; - } - break; - } - result[0]=ACK; - } - - // *********************************************************************** - // tux_req_status() - // *********************************************************************** - void - tux_req_status( - unsigned char data[], - unsigned char result[] - ) - { - result[0]=data[0]; - switch(data[0]){ - case DATA_STATUS_WINGS_MOTOR_BACKWARD: - if (portb.bits.PB0){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_SPIN_MOTOR_BACKWARD: - if (portb.bits.PB1){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_SPIN_MOTOR_FORWARD: - if (portb.bits.PB2){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_MOUTH_OPEN_POSITION: - if (portb.bits.PB3){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_MOUTH_CLOSED_POSITION: - if (portb.bits.PB4){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_HEAD_PUSH_POSITION: - if (portb.bits.PB5){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_CHARGER_INHIBIT_SIGNAL: - result[0]=DATA_STATUS_CHARGER_INHIBIT_SIGNAL; - if (portb.bits.PB6){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_WINGS_POSITION_SWITCH: - if (portc.bits.PB0){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_MOTOR_FOR_WINGS: - if (portc.bits.PB1){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_LEFT_BLUE_LED: - if (portc.bits.PB2){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_HEAD_MOTOR_FOR_MOUTH: - if (portd.bits.PB1){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_HEAD_MOTOR_FOR_EYES: - result[0]=DATA_STATUS_HEAD_MOTOR_FOR_EYES; - if (portd.bits.PB0){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_SPIN_POSITION_SWITCH: - if (portd.bits.PB3){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_WINGS_MOTOR_FORWARD: - result[0]=DATA_STATUS_WINGS_MOTOR_FORWARD; - if (portd.bits.PB4){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_IR_LED: - if (portd.bits.PB5){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_EYES_OPEN_POSITION_SWITCH: - if (portd.bits.PB6){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_EYES_CLOSED_POSITION_SWITCH: - if (portd.bits.PB7){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_LEFT_WING_PUSH: - if (sensors1.bits.PB0){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_RIGHT_WING_PUSH: - if (sensors1.bits.PB1){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_POWER_PLUG_SWITCH: - if (sensors1.bits.PB2){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_HEAD_PUSH_SWITCH: - if (sensors1.bits.PB3){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_CHARGER_LED_STATUS: - if (sensors1.bits.PB4){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_MUTE_STATUS: - if (sensors1.bits.PB7){result[1]=1;}else{result[1]=0;} - break; - case DATA_STATUS_LIGHT_LEVEL: - result[1]=sensors2.level_light_high.Byte; - result[2]=sensors2.level_light_low.Byte; - result[3]=sensors2.light_mode.Byte; - break; - case DATA_STATUS_EYES_POSITION_COUNTER: - result[1]=position1.eyes_position.Byte; - break; - case DATA_STATUS_MOUTH_POSITION_COUNTER: - result[1]=position1.mouth_position.Byte; - break; - case DATA_STATUS_WINGS_POSITION_COUNTER: - result[1]=position1.wings_position.Byte; - break; - case DATA_STATUS_SPIN_POSITION_COUNTER: - result[1]=position2.Byte; - break; - case DATA_STATUS_RF_CONNECTED: - result[1]=RF_status; - break; - case DATA_STATUS_SOUND_COUNT: - result[1]=sound_flash_count; - break; - } - } - - // *********************************************************************** - // tux_req_info() - // *********************************************************************** - void - tux_req_info( - unsigned char data[], - unsigned char result[] - ) - { - result[0]=data[0]; - switch(data[0]){ - case TUX_REQ_INFO_VERSION: - result[1]=hw_version[data[1]].ver_major; - result[2]=hw_version[data[1]].ver_minor; - result[3]=hw_version[data[1]].ver_update; - result[4]=(unsigned char)((hw_revision[data[1]].revision)&0xFF00)>>8; - result[5]=(unsigned char)(hw_revision[data[1]].revision)&0x00FF; - result[6]=(unsigned char)((hw_author[data[1]].author_id)&0xFF00)>>8; - result[7]=(unsigned char)(hw_author[data[1]].author_id)&0x00FF; - break; - } - } + + // *********************************************************************** + // tux_cmd_raw() + // *********************************************************************** + void + tux_cmd_raw( + unsigned char data[], + unsigned char result[] + ) + { + unsigned char usb_send[5]; + unsigned char i; + + usb_send[0]=0; + for(i=1;i<5;i++) + usb_send[i]=data[i-1]; + result[0]=usb_write_TuxDroid(usb_send); + } + + // *********************************************************************** + // tux_cmd_struct() + // *********************************************************************** + void + tux_cmd_struct( + unsigned char data[], + unsigned char result[] + ) + { + unsigned char ACK; + + // Command type + switch(data[0]){ + case TUX_CMD_STRUCT_EYES: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(BLINK_EYES_CMD,data[2],0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(STOP_EYES_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_MOUTH: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(MOVE_MOUTH_CMD,data[2],0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(STOP_MOUTH_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_WINGS: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(WAVE_WINGS_CMD,data[2],data[3],0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(STOP_WINGS_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_SPINL: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(SPIN_LEFT_CMD,data[2],data[3],0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(STOP_SPIN_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_SPINR: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(SPIN_RIGHT_CMD,data[2],data[3],0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(STOP_SPIN_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_IR: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(TURN_IR_ON_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(TURN_IR_OFF_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_SEND: + ACK=send_usb_tux_cmd(IR_SEND_RC5_CMD,data[2],data[3],0); + break; + } + break; + case TUX_CMD_STRUCT_LEDS: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(LED_ON_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(LED_OFF_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_BLINK: + ACK=send_usb_tux_cmd(LED_BLINK_CMD,data[2],data[3],0); + break; + } + break; + case TUX_CMD_STRUCT_LEDL: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(LED_L_ON_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(LED_L_OFF_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_LEDR: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(LED_R_ON_CMD,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(LED_R_OFF_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_SOUND: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_PLAY: + ACK=send_usb_tux_cmd(PLAY_SOUND_CMD,data[2],data[3],0); + break; + case TUX_CMD_STRUCT_SUB_STORING: + ACK=send_usb_tux_cmd(STORE_SOUND_CMD,data[2],0,0); + break; + case TUX_CMD_STRUCT_SUB_STORE_INDEX: + ACK=send_usb_tux_cmd(STORE_INDEX_CMD,data[2],data[3],data[4]); + break; + case TUX_CMD_STRUCT_SUB_TEST: + ACK=send_usb_tux_cmd(TEST_SOUND_CMD,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_PING: + pong_received=0; + ACK=send_usb_tux_cmd(PING_CMD,data[2],0,0); + break; + case TUX_CMD_STRUCT_SLEEP: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_ON: + ACK=send_usb_tux_cmd(0x20,0,0,0); + break; + case TUX_CMD_STRUCT_SUB_OFF: + ACK=send_usb_tux_cmd(0x21,0,0,0); + break; + } + break; + case TUX_CMD_STRUCT_AUDIO_CHANNEL: + switch(data[1]){ + case TUX_CMD_STRUCT_SUB_CH_GENERAL: + if(current_audio_channel!=0){ + ACK=send_usb_dongle_cmd(0x02,0,0,0); + current_audio_channel=0; + }else + ACK=ACK_CMD_OK; + break; + case TUX_CMD_STRUCT_SUB_CH_TTS: + if(current_audio_channel!=1){ + ACK=send_usb_dongle_cmd(0x02,1,0,0); + current_audio_channel=1; + }else + ACK=ACK_CMD_OK; + break; + } + break; + } + result[0]=ACK; + } + + // *********************************************************************** + // tux_req_status() + // *********************************************************************** + void + tux_req_status( + unsigned char data[], + unsigned char result[] + ) + { + result[0]=data[0]; + switch(data[0]){ + case DATA_STATUS_WINGS_MOTOR_BACKWARD: + if (portb.bits.PB0){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_SPIN_MOTOR_BACKWARD: + if (portb.bits.PB1){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_SPIN_MOTOR_FORWARD: + if (portb.bits.PB2){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_MOUTH_OPEN_POSITION: + if (portb.bits.PB3){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_MOUTH_CLOSED_POSITION: + if (portb.bits.PB4){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_HEAD_PUSH_POSITION: + if (portb.bits.PB5){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_CHARGER_INHIBIT_SIGNAL: + result[0]=DATA_STATUS_CHARGER_INHIBIT_SIGNAL; + if (portb.bits.PB6){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_WINGS_POSITION_SWITCH: + if (portc.bits.PB0){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_MOTOR_FOR_WINGS: + if (portc.bits.PB1){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_LEFT_BLUE_LED: + if (portc.bits.PB2){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_HEAD_MOTOR_FOR_MOUTH: + if (portd.bits.PB1){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_HEAD_MOTOR_FOR_EYES: + result[0]=DATA_STATUS_HEAD_MOTOR_FOR_EYES; + if (portd.bits.PB0){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_SPIN_POSITION_SWITCH: + if (portd.bits.PB3){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_WINGS_MOTOR_FORWARD: + result[0]=DATA_STATUS_WINGS_MOTOR_FORWARD; + if (portd.bits.PB4){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_IR_LED: + if (portd.bits.PB5){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_EYES_OPEN_POSITION_SWITCH: + if (portd.bits.PB6){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_EYES_CLOSED_POSITION_SWITCH: + if (portd.bits.PB7){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_LEFT_WING_PUSH: + if (sensors1.bits.PB0){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_RIGHT_WING_PUSH: + if (sensors1.bits.PB1){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_POWER_PLUG_SWITCH: + if (sensors1.bits.PB2){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_HEAD_PUSH_SWITCH: + if (sensors1.bits.PB3){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_CHARGER_LED_STATUS: + if (sensors1.bits.PB4){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_MUTE_STATUS: + if (sensors1.bits.PB7){result[1]=1;}else{result[1]=0;} + break; + case DATA_STATUS_LIGHT_LEVEL: + result[1]=sensors2.level_light_high.Byte; + result[2]=sensors2.level_light_low.Byte; + result[3]=sensors2.light_mode.Byte; + break; + case DATA_STATUS_EYES_POSITION_COUNTER: + result[1]=position1.eyes_position.Byte; + break; + case DATA_STATUS_MOUTH_POSITION_COUNTER: + result[1]=position1.mouth_position.Byte; + break; + case DATA_STATUS_WINGS_POSITION_COUNTER: + result[1]=position1.wings_position.Byte; + break; + case DATA_STATUS_SPIN_POSITION_COUNTER: + result[1]=position2.Byte; + break; + case DATA_STATUS_RF_CONNECTED: + result[1]=RF_status; + break; + case DATA_STATUS_SOUND_COUNT: + result[1]=sound_flash_count; + break; + } + } + + // *********************************************************************** + // tux_req_info() + // *********************************************************************** + void + tux_req_info( + unsigned char data[], + unsigned char result[] + ) + { + result[0]=data[0]; + switch(data[0]){ + case TUX_REQ_INFO_VERSION: + result[1]=hw_version[data[1]].ver_major; + result[2]=hw_version[data[1]].ver_minor; + result[3]=hw_version[data[1]].ver_update; + result[4]=(unsigned char)((hw_revision[data[1]].revision)&0xFF00)>>8; + result[5]=(unsigned char)(hw_revision[data[1]].revision)&0x00FF; + result[6]=(unsigned char)((hw_author[data[1]].author_id)&0xFF00)>>8; + result[7]=(unsigned char)(hw_author[data[1]].author_id)&0x00FF; + break; + } + } // *************************************************************************** // TUX USB // *************************************************************************** - // *********************************************************************** - // send_usb_tuxcmd() - // *********************************************************************** - unsigned char send_usb_tux_cmd( - unsigned char cmd, - unsigned char param1, - unsigned char param2, - unsigned char param3 - ) - { - unsigned char usb_trame[TUX_SEND_LENGTH]; - - usb_trame[0]=0; - usb_trame[1]=cmd; - usb_trame[2]=param1; usb_trame[3]=param2; usb_trame[4]=param3; - return usb_write_TuxDroid(usb_trame); - } + // *********************************************************************** + // send_usb_tuxcmd() + // *********************************************************************** + unsigned char send_usb_tux_cmd( + unsigned char cmd, + unsigned char param1, + unsigned char param2, + unsigned char param3 + ) + { + unsigned char usb_trame[TUX_SEND_LENGTH]; + + usb_trame[0]=0; + usb_trame[1]=cmd; + usb_trame[2]=param1; usb_trame[3]=param2; usb_trame[4]=param3; + return usb_write_TuxDroid(usb_trame); + } + + // *********************************************************************** + // send_usb_donglecmd() + // *********************************************************************** + unsigned char send_usb_dongle_cmd( + unsigned char cmd, + unsigned char param1, + unsigned char param2, + unsigned char param3 + ) + { + unsigned char usb_trame[TUX_SEND_LENGTH]; + + usb_trame[0]=1; + usb_trame[1]=cmd; + usb_trame[2]=param1; usb_trame[3]=param2; usb_trame[4]=param3; + return usb_write_TuxDroid(usb_trame); + } Modified: daemon/trunk/libs/USBDaemon_command_tux.h =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.h 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/libs/USBDaemon_command_tux.h 2007-02-26 13:45:05 UTC (rev 80) @@ -31,6 +31,7 @@ void tux_req_info(unsigned char data[],unsigned char result[]); // TUX PHYSICAL CHANGES unsigned char send_usb_tux_cmd(unsigned char cmd, unsigned char param1,unsigned char param2,unsigned char param3); +unsigned char send_usb_dongle_cmd(unsigned char cmd, unsigned char param1,unsigned char param2,unsigned char param3); unsigned char send_wave_wings(unsigned char count, unsigned char speed); unsigned char send_stop_wings(); unsigned char send_blink_eyes(unsigned char count); Modified: daemon/trunk/libs/USBDaemon_globals.h =================================================================== --- daemon/trunk/libs/USBDaemon_globals.h 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/libs/USBDaemon_globals.h 2007-02-26 13:45:05 UTC (rev 80) @@ -20,20 +20,21 @@ /* $Id$ */ /*_____________________ I N C L U D E S____________________________________ */ #include <usb.h> +#include <pthread.h> /*_____________________ D E F I N E S ______________________________________*/ -#define VERSION_MAJOR 0 -#define VERSION_MINOR 1 -#define VERSION_RELEASE 5 -#define TUX_PID 0xFF07 // Product ID -#define TUX_VID 0x03EB // Vendor ID -#define TUX_INTERFACE 0x03 -#define TUX_INTERFACECONFIG 0x01 -#define TUX_RECV_LENGTH 0x05 -#define TUX_SEND_LENGTH 0x05 -#define TUX_WRITE_EP 0x05 -#define TUX_READ_EP 0x84 -#define TUX_WRITE_TIMEOUT 1000 -#define TUX_READ_TIMEOUT 1000 +#define VERSION_MAJOR 0 +#define VERSION_MINOR 1 +#define VERSION_RELEASE 7 +#define TUX_PID 0xFF07 // Product ID +#define TUX_VID 0x03EB // Vendor ID +#define TUX_INTERFACE 0x03 +#define TUX_INTERFACECONFIG 0x01 +#define TUX_RECV_LENGTH 0x05 +#define TUX_SEND_LENGTH 0x05 +#define TUX_WRITE_EP 0x05 +#define TUX_READ_EP 0x84 +#define TUX_WRITE_TIMEOUT 1000 +#define TUX_READ_TIMEOUT 1000 /*_____________________ G L O B A L S _ V A R I A B L E S _______________________*/ usb_dev_handle *handle; struct usb_device* device; Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-02-22 00:21:22 UTC (rev 79) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-02-26 13:45:05 UTC (rev 80) @@ -28,677 +28,678 @@ unsigned char pong_received; /*_____________________ F U N C T I O N S __________________________________*/ - // *********************************************************************** - // update_raw_status_table() - // *********************************************************************** - void - update_raw_status_table( - unsigned char new_status[TUX_RECV_LENGTH] - ) - { - switch(new_status[0]){ - case STATUS_PORTS_CMD: - if(portb.Byte!=new_status[1]) portb_changed(new_status[1]); - if(portc.Byte!=new_status[2]) portc_changed(new_status[2]); - if(portd.Byte!=new_status[3]) portd_changed(new_status[3]); - break; - case STATUS_SENSORS1_CMD: - if(sensors1.Byte!=new_status[1]) sensors1_changed(new_status[1]); - break; - case STATUS_LIGHT_CMD: - if((sensors2.level_light_high.Byte!=new_status[1]) || (sensors2.level_light_low.Byte!=new_status[2]) ) sensors2_changed(new_status[1],new_status[2],new_status[3]); - break; - case STATUS_POSITION1_CMD: - if((position1.eyes_position.Byte!=new_status[1])||(position1.mouth_position.Byte!=new_status[2])||(position1.wings_position.Byte!=new_status[3])) position1_changed(new_status[1], new_status[2], new_status[3]); - break; - case STATUS_POSITION2_CMD: - if(position2.Byte!=new_status[1]) position2_changed(new_status[1]); - break; - case PONG_CMD: - pong_received++; - pong_event(new_status[1],pong_received); - break; - case VERSION_CMD: - update_version_table(new_status); - break; - case REVISION_CMD: - update_revision_table(new_status); - break; - case AUTHOR_CMD: - update_author_table(new_status); - break; - case SOUND_VAR_CMD: - update_sound_flash_count(new_status); - break; - case STATUS_IR_CMD: - update_ir(new_status); - break; - default: - if(SHOW_INVALID_RAW) - printf("%.2x %.2x %.2x %.2x\n", new_status[0],new_status[1],new_status[2],new_status[3]); - break; - } - } - - // *********************************************************************** - // update_system_status_table() - // *********************************************************************** - void - update_system_status_table( - unsigned char new_status[4] - ) - { - unsigned char tcp_trame[16]; - unsigned char i; - - for(i=0;i<16;i++)tcp_trame[i]=0; - tcp_trame[0]=SOURCE_TUX; - tcp_trame[1]=SS_DEFAULT; - tcp_trame[2]=DATA_TP_RSP; - tcp_trame[3]=SUBDATA_TP_STATUS; - - DONGLE_status=new_status[0]; - //RF status change - if(RF_status!=new_status[1]){ - RF_status=new_status[1]; - tcp_trame[4]=DATA_STATUS_RF_CONNECTED; - tcp_trame[5]=RF_status; - tcp_server_send_raw(tcp_trame, 16); - } - // Command status change - if(CMD_status!=new_status[2]){ - CMD_status=new_status[2]; - if((CMD_status==2)||(CMD_status==3)) - CMD_STATUS_FLAG=0; - } - NUMBER_trames=new_status[3]; - } - - // *********************************************************************** - // update_version_table() - // *********************************************************************** - void - update_version_table( - unsigned char new_status[4] - ) - { - unsigned long tmp; - version_t *hw_ver; - - tmp=(new_status[3] << 24)+(new_status[2] << 16)+ - (new_status[1] << 8)+(new_status[0]); - hw_ver=(version_t *)&tmp; - last_cpu_ver=hw_ver->cpu_nbr; - hw_version[last_cpu_ver]=*hw_ver; - } - - // *********************************************************************** - // update_revision_table() - // *********************************************************************** - void - update_revision_table( - unsigned char new_status[4] - ) - { - unsigned long tmp; - revision_t *hw_rev; - - tmp=(new_sta... [truncated message content] |
From: admin <c2m...@c2...> - 2007-02-26 12:19:35
|
Author: jaguarondi Date: 2007-02-22 01:21:22 +0100 (Thu, 22 Feb 2007) New Revision: 79 Modified: softwares/bootloader/trunk/main.c Log: - UPD: improved the pretend usage - UPD: added one verbose message when checking for the dongle bootloading mode at startup Modified: softwares/bootloader/trunk/main.c =================================================================== --- softwares/bootloader/trunk/main.c 2007-02-21 13:33:00 UTC (rev 78) +++ softwares/bootloader/trunk/main.c 2007-02-22 00:21:22 UTC (rev 79) @@ -64,7 +64,7 @@ fprintf (stream, " -m --main Reprogram tuxcore and tuxaudio (flash and eeprom) with hex files located in path.\n" " -a --all Reprogram all cpu's with hex files located in path.\n" - " -p --pretend Don't reprogram but check all files.\n" + " -p --pretend Don't do the programming, just simulates.\n" " -h --help Display this usage information.\n" " -v --verbose Print verbose messages.\n" " -V --version Print the version number.\n" @@ -272,7 +272,13 @@ if (pretend) return 0; /* Check if the dongle is already in bootloader mode */ - ret = system("dfu-programmer at89c5130 get bootloader-version 2> /dev/null"); + if (verbose) + { + fprintf(stdout,"Testing if the dongle is already in bootloader mode. If it is not, 'no device present' will be reported, don't worry about it\n"); + ret = system("dfu-programmer at89c5130 get bootloader-version"); + } + else + ret = system("dfu-programmer at89c5130 get bootloader-version 2> /dev/null"); if (ret) { fux_connect(); |