Imported Debian patch 5.2+dfsg-1
Philipp Huebner
9 years ago
0 | * Wed Aug 25 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.2 | |
1 | - Enhanced support for Get(password) command. Properly handle ampersand in file | |
2 | names. | |
3 | ||
0 | 4 | * Thu Jul 8 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.1.3 |
1 | 5 | - Some configuration files and documentation were corrected. |
2 | 6 | Added configuration file for QMMP. |
23 | 23 | |
24 | 24 | install-data-local: |
25 | 25 | test -z $(DESTDIR)$(pkgdatadir) || mkdir -p -- . $(DESTDIR)$(pkgdatadir) |
26 | test -z $(DESTDIR)$(datadir)/doc/anyremote || mkdir -p -- . $(DESTDIR)$(datadir)/doc/anyremote | |
26 | test -z $(DESTDIR)$(docdir) || mkdir -p -- . $(DESTDIR)$(docdir) | |
27 | 27 | cp -r cfg-data $(DESTDIR)$(pkgdatadir) |
28 | 28 | rm -rf $(DESTDIR)$(pkgdatadir)/cfg-data/obsoleted |
29 | cp -r doc-html ChangeLog README COPYING AUTHORS $(DESTDIR)$(datadir)/doc/anyremote/ | |
30 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(datadir)/doc/anyremote -type f -exec chmod 644 {} \; | |
29 | cp -r doc-html ChangeLog README COPYING AUTHORS $(DESTDIR)$(docdir)/ | |
30 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(docdir) -type f -exec chmod 644 {} \; | |
31 | 31 | chmod a+x $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/all-in-1.py $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/message.sh |
32 | 32 | chmod a+x $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/xmms_is_playing $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/getPlayList.sh |
33 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(datadir)/doc/anyremote -type d -exec chmod 755 {} \; | |
33 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(docdir) -type d -exec chmod 755 {} \; | |
34 | 34 | test -z $(DESTDIR)$(datadir)/man/man1 || mkdir -p -- . $(DESTDIR)$(datadir)/man/man1 |
35 | 35 | cp -r anyremote.1.gz $(DESTDIR)$(datadir)/man/man1 |
36 | 36 | chmod 644 $(DESTDIR)$(datadir)/man/man1/anyremote.1.gz |
37 | 37 | |
38 | 38 | uninstall-local: |
39 | 39 | rm -rf $(DESTDIR)$(pkgdatadir) |
40 | rm -rf $(DESTDIR)$(datadir)/doc/anyremote | |
40 | rm -rf $(DESTDIR)$(docdir) | |
41 | 41 | rm -f $(DESTDIR)$(datadir)/man/man1/anyremote.1.gz |
696 | 696 | |
697 | 697 | install-data-local: |
698 | 698 | test -z $(DESTDIR)$(pkgdatadir) || mkdir -p -- . $(DESTDIR)$(pkgdatadir) |
699 | test -z $(DESTDIR)$(datadir)/doc/anyremote || mkdir -p -- . $(DESTDIR)$(datadir)/doc/anyremote | |
699 | test -z $(DESTDIR)$(docdir) || mkdir -p -- . $(DESTDIR)$(docdir) | |
700 | 700 | cp -r cfg-data $(DESTDIR)$(pkgdatadir) |
701 | 701 | rm -rf $(DESTDIR)$(pkgdatadir)/cfg-data/obsoleted |
702 | cp -r doc-html ChangeLog README COPYING AUTHORS $(DESTDIR)$(datadir)/doc/anyremote/ | |
703 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(datadir)/doc/anyremote -type f -exec chmod 644 {} \; | |
702 | cp -r doc-html ChangeLog README COPYING AUTHORS $(DESTDIR)$(docdir)/ | |
703 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(docdir) -type f -exec chmod 644 {} \; | |
704 | 704 | chmod a+x $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/all-in-1.py $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/message.sh |
705 | 705 | chmod a+x $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/xmms_is_playing $(DESTDIR)$(pkgdatadir)/cfg-data/Utils/getPlayList.sh |
706 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(datadir)/doc/anyremote -type d -exec chmod 755 {} \; | |
706 | find $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(docdir) -type d -exec chmod 755 {} \; | |
707 | 707 | test -z $(DESTDIR)$(datadir)/man/man1 || mkdir -p -- . $(DESTDIR)$(datadir)/man/man1 |
708 | 708 | cp -r anyremote.1.gz $(DESTDIR)$(datadir)/man/man1 |
709 | 709 | chmod 644 $(DESTDIR)$(datadir)/man/man1/anyremote.1.gz |
710 | 710 | |
711 | 711 | uninstall-local: |
712 | 712 | rm -rf $(DESTDIR)$(pkgdatadir) |
713 | rm -rf $(DESTDIR)$(datadir)/doc/anyremote | |
713 | rm -rf $(DESTDIR)$(docdir) | |
714 | 714 | rm -f $(DESTDIR)$(datadir)/man/man1/anyremote.1.gz |
715 | 715 | |
716 | 716 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
0 | 0 | % |
1 | 1 | % anyremote configuration file for amarok management. (Server-mode) |
2 | % v.4 | |
3 | % * Improved tracklist | |
4 | % * Track number, Track Info | |
5 | % * Fixed problem with spaces in path to a cover | |
6 | % * Fixed problem with commas in name of a track | |
7 | 2 | % |
8 | 3 | % Made by Carlos Sanchez (chukysoria@gmail.com) |
9 | 4 | % --- modified to run with amarok/kde4 (johann bauer, johann.bauer1@gmail.com ) |
10 | 5 | % --- --- modified (Dmirty Ashkadov, dmitry.ashkadov@gmail.com) |
11 | 6 | |
12 | % STATUS non-stable | |
7 | % STATUS stable | |
13 | 8 | % XTEST no |
14 | 9 | % SOUND app |
15 | 10 | % ENV no |
17 | 12 | GuiAppName=Amarok v4 |
18 | 13 | GuiAppBinary=amarok |
19 | 14 | GuiAppVersion=echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x4" ]; then echo OK; else echo NOK; fi'|bash -f -s |
20 | GuiAppRun=echo 'A=`pgrep amarok`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s | |
15 | GuiAppRun=echo 'qdbus org.kde.amarok > /dev/null; if [ $? == "1" ]; then echo NOK; else echo OK; fi '| bash -f -s | |
21 | 16 | GuiAppIcon=amarok.png |
22 | 17 | GuiAppType=Application |
23 | 18 | GuiAppDesc=Amarok is the music player for Linux and Unix with an intuitive interface. Amarok makes playing the music you love easier than ever before - and looks good doing it. This configuration supports cover art. This configuration file is for Amarok/KDE4. |
27 | 22 | (Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\ |
28 | 23 | Make(var,from_utf,by_value,);\ |
29 | 24 | Make(var, to_utf,by_value,);\ |
25 | Make(var, tmp_dir,by_value,/tmp);\ | |
30 | 26 | Exec(echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`;if [ "x$V" != "x4" ]; then $(CfgDir)/Utils/message.sh "ERROR: this configuration file is for KDE3"; fi'|bash -f -s);\ |
31 | 27 | Exec(echo 'P=`which convert 2> /dev/null|grep convert|grep -v no|wc -l|tr -d " "`;if [ "x$P" == "x1" ]; then true; else $(CfgDir)/Utils/message.sh "ERROR: ImageMagic is not installed"; fi'|bash -f -s);\ |
32 | 28 | Macro(INIT_VARIABLES); |
33 | 29 | |
34 | 30 | INIT_VARIABLES=Make(var,arDir,echo $HOME/.anyRemote/);\ |
35 | Make(var,cvDir,by_value,$(arDir)amarok_covers/);\ | |
31 | Make(var,cvDir,by_value,$(tmp_dir)/amarok_covers/);Exec(if [[ ! -d $(cvDir) ]]; then mkdir $(cvDir); fi);\ | |
36 | 32 | Make(var,am_track_index,by_value,0);\ |
37 | 33 | Make(var,am_track_index_saved,by_value,-2);\ |
38 | 34 | Make(var,am_num_of_tracks,by_value,-2);\ |
39 | 35 | Make(var,am_saved_mode,by_value,amarok-v4);\ |
40 | 36 | Make(var,am_track_pos,by_value,0);\ |
37 | Make(var,am_track_pos_old,by_value,0);\ | |
41 | 38 | Make(var,am_track_length,by_value,1);\ |
42 | Make(var,am_volume,by_value,0); | |
39 | Make(var,am_volume,by_value,0);\ | |
40 | Make(var,am_cover,by_value,);\ | |
41 | Make(var,am_cover_old,by_value,); | |
43 | 42 | |
44 | 43 | MODE_SAVE=Make(var,am_saved_mode,by_value,$(Mode)); |
45 | 44 | MODE_LOAD=Make(mode,$(am_saved_mode)); |
65 | 64 | AMAROK_V2_START_TIMER=Timer(AMAROK_V2_SETINFO,5,0); |
66 | 65 | AMAROK_V2_STOP_TIMER =Timer(AMAROK_V2_SETINFO,cancel); |
67 | 66 | |
68 | AMAROK_V2_UPDATE_STATUS=ExecAndSet(status, echo 'min=`expr $(am_track_length) / 60`; sec=`expr $(am_track_length) % 60`; pos_min=`expr $(am_track_pos) / 60`; pos_sec=`expr $(am_track_pos) % 60`; echo "$pos_min:$pos_sec / $min:$sec";'|bash -s -f); | |
67 | AMAROK_V2_UPDATE_STATUS=ExecAndSet(status, echo 'min=`expr $(am_track_length) / 60`; sec=`expr $(am_track_length) % 60`; pos_min=`expr $(am_track_pos) / 60`; pos_sec=`expr $(am_track_pos) % 60`; echo "$pos_min:`if [[ $pos_sec -lt 10 ]]; then echo 0; fi`$pos_sec / $min:`if [[ $sec -lt 10 ]]; then echo 0; fi`$sec";'|bash -s -f); | |
69 | 68 | AMAROK_V2_UPDATE_PROGRESSBAR=ExecAndSet(volume, if [ $(am_track_length) == 0 ]; then echo 0; else expr $(am_track_pos) \* 100 \/ $(am_track_length); fi); |
70 | AMAROK_V2_UPDATE_PLAY_ICON=Make(var,am_play_icon,if [ $(am_track_pos) == 0 ]; then echo 'play'; else echo 'pause'; fi);Set(icons,SAME,2,$(am_play_icon)); | |
69 | % AMAROK_V2_UPDATE_PLAY_ICON=Make(var,am_play_icon,if [ $(am_track_pos) == 0 ]; then echo 'play'; else echo 'pause'; fi);Set(icons,SAME,2,$(am_play_icon)); | |
70 | AMAROK_V2_UPDATE_PLAY_ICON=Make(var,am_play_icon,if [ $(am_track_pos) == $(am_track_pos_old) ]; then echo 'play'; else echo 'pause'; fi);Make(var,am_track_pos_old,by_value,$(am_track_pos));Set(icons,SAME,2,$(am_play_icon)); | |
71 | 71 | AMAROK_V2_UPDATE_TITLE=ExecAndSet(title, echo 'T=`qdbus org.kde.amarok /TrackList GetMetadata $(am_track_index)|grep title:|cut -f 2 -d ":"`; A=`qdbus org.kde.amarok /TrackList GetMetadata $(am_track_index)|grep artist:|cut -f 2 -d ":"`;echo "`expr $(am_track_index) + 1`. $T" by"$A" '|bash -f -s); |
72 | AMAROK_V2_UPDATE_COVER=ExecAndSet(cover, echo 'I=`qdbus org.kde.amarok /TrackList GetMetadata $(am_track_index)|grep arturl:|cut -f 2 -d " "|sed "s/%20/ /g"|cut -f 2 -d ":"` ;F=`basename "$I"`; if [ "x$F" == "x" ]; then echo ""; else convert "$I" -resize $(cover_size)x$(cover_size) -append "$(cvDir)$F"; echo "$(cvDir)$F"; fi'|bash -f -s); | |
73 | ||
72 | AMAROK_V2_UPDATE_COVER=Make(var,am_cover, qdbus org.kde.amarok /TrackList GetMetadata $(am_track_index)|grep arturl:|cut -f 2 -d " "|sed "s/%20/ /g"|cut -f 2 -d ":");\ | |
73 | Macro(AMAROK_V2_UPDATE_COVER_SUB, if [[ '$(am_cover)' == '$(am_cover_old)' ]]; then echo 1; else echo 0; fi); | |
74 | AMAROK_V2_UPDATE_COVER_SUB=ExecAndSet(cover, echo 'F=`basename "$(am_cover)"`; if [ "x$F" == "x" ]; then echo ""; else convert "$(am_cover)" -resize $(cover_size)x$(cover_size) -append "$(cvDir)$F"; echo "$(cvDir)$F"; fi'|bash -f -s);\ | |
75 | Make(var,am_cover_old,by_value,$(am_cover)); | |
76 | ||
74 | 77 | |
75 | 78 | AMAROK_V2_GET_TRACK_INDEX=Make(var,am_track_index, qdbus org.kde.amarok /TrackList GetCurrentTrack | tr -d " "); |
76 | 79 | AMAROK_V2_GET_POSITION=Make(var,am_track_pos, expr `qdbus org.kde.amarok /Player PositionGet` / 1000); |
120 | 123 | |
121 | 124 | Track Info=Macro(MODE_SAVE);Macro(AMAROK_V2_GET_TRACK_INDEX);Make(mode,TrackInfo); |
122 | 125 | |
123 | CoverSize($$)=Make(var,cover_size,by_value,$(Index));Macro(AMAROK_V2_UPDATE_COVER); | |
126 | CoverSize($$)=Make(var,cover_size,by_value,$(Index));Macro(AMAROK_V2_UPDATE_COVER_SUB); | |
124 | 127 | |
125 | 128 | Run Player=Macro(AMAROK_V2_RUN_IF); |
126 | 129 | Quit Player=Exec(qdbus org.kde.amarok /MainApplication quit);\ |
127 | 130 | Macro(AMAROK_V2_STOP_TIMER);\ |
128 | Set(title,);Set(status,); | |
131 | Set(title,);Set(status,);Set(cover,);Set(volume,0); | |
129 | 132 | |
130 | 133 | Show Player=Exec(qdbus org.kde.amarok /amarok/MainWindow show); |
131 | 134 | Hide Player=Exec(qdbus org.kde.amarok /amarok/MainWindow hide); |
133 | 136 | Help=Macro(MODE_SAVE);Make(mode,Help); |
134 | 137 | |
135 | 138 | |
136 | 1=Exec(qdbus org.kde.amarok /Player Prev);Set(icons,SAME,2,pause);Macro(AMAROK_V2_SETINFO); | |
139 | 1=Exec(qdbus org.kde.amarok /Player Prev);Macro(AMAROK_V2_SETINFO); | |
137 | 140 | * 1=Exec(qdbus org.kde.amarok /Player Backward 300000);Macro(AMAROK_V2_SETINFO); |
138 | 2=Exec(qdbus org.kde.amarok /Player PlayPause);Set(icons,SAME,2,pause);Macro(AMAROK_V2_SETINFO); | |
139 | 3=Exec(qdbus org.kde.amarok /Player Next);Set(icons,SAME,2,pause);Macro(AMAROK_V2_SETINFO); | |
141 | 2=Exec(qdbus org.kde.amarok /Player PlayPause);Macro(AMAROK_V2_SETINFO); | |
142 | 3=Exec(qdbus org.kde.amarok /Player Next);Macro(AMAROK_V2_SETINFO); | |
140 | 143 | * 3=Exec(qdbus org.kde.amarok /Player Forward 300000);Macro(AMAROK_V2_SETINFO); |
141 | 144 | 4=Exec(qdbus org.kde.amarok /Player Backward 10000);Macro(AMAROK_V2_SETINFO); |
142 | 145 | * 4=Exec(qdbus org.kde.amarok /Player Backward 60000);Macro(AMAROK_V2_SETINFO); |
143 | 5=Exec(qdbus org.kde.amarok /Player Stop);Set(icons,SAME,2,play);Macro(AMAROK_V2_SETINFO); | |
146 | 5=Exec(qdbus org.kde.amarok /Player Stop);Macro(AMAROK_V2_SETINFO); | |
144 | 147 | 6=Exec(qdbus org.kde.amarok /Player Forward 10000);Macro(AMAROK_V2_SETINFO); |
145 | 148 | * 6=Exec(qdbus org.kde.amarok /Player Forward 60000);Macro(AMAROK_V2_SETINFO); |
146 | 149 | 7=Macro(ToggleMute); |
150 | * 7=Exec(qdbus org.kde.kmix /kmix/KMixWindow/actions/mute trigger); | |
147 | 151 | 8=Macro(Vol-); |
152 | * 8=Exec(qdbus org.kde.kmix /kmix/KMixWindow/actions/decrease_volume trigger); | |
148 | 153 | 9=Macro(Vol+); |
154 | * 9=Exec(qdbus org.kde.kmix /kmix/KMixWindow/actions/increase_volume trigger); | |
149 | 155 | 0=Macro(ToggleFullscreen); |
150 | 156 | #=Macro(Playlist); |
151 | 157 | * *=Macro(Help); |
152 | ||
153 | ||
154 | 158 | |
155 | 159 | [ModeEnd] |
156 | 160 | |
166 | 170 | Macro(SET_LIST_ITEM, expr $(am_track_index) \< 0); |
167 | 171 | |
168 | 172 | SET_LIST_ITEM=ExecAndSet(list,select, expr $(am_track_index) + 1); |
169 | SET_LIST_IF_EMPTY=Set(menu,add,Add);Set(list,replace,Playlist, -- empty --); | |
170 | SET_LIST_IF_NOT_EMPTY=Set(menu,add,Play,Info,Add,Remove);ExecAndSet(list,replace,Playlist,$(CfgDir)/Utils/getPlayList.sh); | |
173 | SET_LIST_IF_EMPTY=Set(menu,replace,Add,Refresh);Set(list,replace,Playlist, -- empty --); | |
174 | SET_LIST_IF_NOT_EMPTY=Set(menu,replace,Play,Add,Remove,Info,Refresh,Clear);ExecAndSet(list,replace,Playlist,$(CfgDir)/Utils/getPlayList.sh); | |
171 | 175 | |
172 | 176 | (ExitMode)=Set(list,close); |
173 | 177 | |
177 | 181 | Info($$)=Make(var,am_track_index,expr $(Index) - 1);Macro(MODE_SAVE);Make(mode,TrackInfo); |
178 | 182 | Remove($$)=Exec(qdbus org.kde.amarok /TrackList DelTrack `expr $(Index) - 1`);Make(mode,amarok_playlist_v2); |
179 | 183 | Add($$)=Macro(MODE_SAVE);Make(mode,FileBrowser); |
184 | Clear($$)=Macro(AMAROK_V2_GET_NUM_OF_TRACKS);\ | |
185 | Exec(for (( i=0; i<$(am_num_of_tracks); ++i)) do qdbus org.kde.amarok /TrackList DelTrack 0; done);\ | |
186 | Set(menu,replace,Add,Refresh);Macro(SET_LIST_IF_EMPTY); | |
187 | Refresh($$)=Make(mode,amarok_playlist_v2); | |
188 | ||
180 | 189 | |
181 | 190 | [ModeEnd] |
182 | 191 |
0 | % | |
1 | % anyremote configuration file for Nokia-E75 management. (Server-mode) | |
2 | % | |
3 | ||
4 | GuiAppName=Nokia E75 | |
5 | GuiAppType=Example | |
6 | GuiAppProtocols=Server | |
7 | GuiAppDesc=Example of keypad handling for Nokia-E75 | |
8 | ||
9 | [Protocol]=Server | |
10 | ||
11 | (Connect)=Set(skin,default,keypad_only);\ | |
12 | Set(status,);\ | |
13 | Set(title,Nokia-E75); | |
14 | ||
15 | K8=Emulate(key,BackSpace) | |
16 | ||
17 | 0=Emulate(key,0) | |
18 | 1=Emulate(key,1) | |
19 | 2=Emulate(key,2) | |
20 | 3=Emulate(key,3) | |
21 | 4=Emulate(key,4) | |
22 | 5=Emulate(key,5) | |
23 | 6=Emulate(key,6) | |
24 | 7=Emulate(key,7) | |
25 | 8=Emulate(key,8) | |
26 | 9=Emulate(key,9) | |
27 | #=Emulate(keydown,Shift_L,key,numbersign,keyup,Shift_L) | |
28 | *=Emulate(keydown,Shift_L,key,asterisk,keyup,Shift_L) | |
29 | ||
30 | 10=Emulate(key,Return) | |
31 | ||
32 | 32=Emulate(key,space) | |
33 | 33=Emulate(keydown,Shift_L,key,exclam,keyup,Shift_L) | |
34 | 36=Emulate(keydown,Shift_L,key,dollar,keyup,Shift_L) | |
35 | 38=Emulate(keydown,Shift_L,key,ampersand,keyup,Shift_L) | |
36 | ||
37 | 40=Emulate(key,braceleft) | |
38 | 41=Emulate(key,braceright) | |
39 | ||
40 | 43=Emulate(keydown,Shift_L,key,plus,keyup,Shift_L) | |
41 | 44=Emulate(key,comma) | |
42 | 45=Emulate(key,minus) | |
43 | 46=Emulate(key,period) | |
44 | ||
45 | 58=Emulate(keydown,Shift_L,key,colon,keyup,Shift_L) | |
46 | 59=Emulate(key,semicolon) | |
47 | ||
48 | 63=Emulate(keydown,Shift_L,key,question,keyup,Shift_L) | |
49 | 64=Emulate(keydown,Shift_L,key,at,keyup,Shift_L) | |
50 | 65=Emulate(keydown,Shift_L,key,A,keyup,Shift_L) | |
51 | 66=Emulate(keydown,Shift_L,key,B,keyup,Shift_L) | |
52 | 67=Emulate(keydown,Shift_L,key,C,keyup,Shift_L) | |
53 | 68=Emulate(keydown,Shift_L,key,D,keyup,Shift_L) | |
54 | 69=Emulate(keydown,Shift_L,key,E,keyup,Shift_L) | |
55 | 70=Emulate(keydown,Shift_L,key,F,keyup,Shift_L) | |
56 | 71=Emulate(keydown,Shift_L,key,G,keyup,Shift_L) | |
57 | 72=Emulate(keydown,Shift_L,key,H,keyup,Shift_L) | |
58 | 73=Emulate(keydown,Shift_L,key,I,keyup,Shift_L) | |
59 | 74=Emulate(keydown,Shift_L,key,J,keyup,Shift_L) | |
60 | 75=Emulate(keydown,Shift_L,key,K,keyup,Shift_L) | |
61 | 76=Emulate(keydown,Shift_L,key,L,keyup,Shift_L) | |
62 | 77=Emulate(keydown,Shift_L,key,M,keyup,Shift_L) | |
63 | 78=Emulate(keydown,Shift_L,key,N,keyup,Shift_L) | |
64 | 79=Emulate(keydown,Shift_L,key,O,keyup,Shift_L) | |
65 | 80=Emulate(keydown,Shift_L,key,P,keyup,Shift_L) | |
66 | 81=Emulate(keydown,Shift_L,key,Q,keyup,Shift_L) | |
67 | 82=Emulate(keydown,Shift_L,key,R,keyup,Shift_L) | |
68 | 83=Emulate(keydown,Shift_L,key,S,keyup,Shift_L) | |
69 | 84=Emulate(keydown,Shift_L,key,T,keyup,Shift_L) | |
70 | 85=Emulate(keydown,Shift_L,key,U,keyup,Shift_L) | |
71 | 86=Emulate(keydown,Shift_L,key,V,keyup,Shift_L) | |
72 | 87=Emulate(keydown,Shift_L,key,W,keyup,Shift_L) | |
73 | 88=Emulate(keydown,Shift_L,key,X,keyup,Shift_L) | |
74 | 89=Emulate(keydown,Shift_L,key,Y,keyup,Shift_L) | |
75 | 90=Emulate(keydown,Shift_L,key,Z,keyup,Shift_L) | |
76 | ||
77 | 97=Emulate(key,a) | |
78 | 98=Emulate(key,b) | |
79 | 99=Emulate(key,c) | |
80 | 100=Emulate(key,d) | |
81 | 101=Emulate(key,e) | |
82 | 102=Emulate(key,f) | |
83 | 103=Emulate(key,g) | |
84 | 104=Emulate(key,h) | |
85 | 105=Emulate(key,i) | |
86 | 106=Emulate(key,j) | |
87 | 107=Emulate(key,k) | |
88 | 108=Emulate(key,l) | |
89 | 109=Emulate(key,m) | |
90 | 110=Emulate(key,n) | |
91 | 111=Emulate(key,o) | |
92 | 112=Emulate(key,p) | |
93 | 113=Emulate(key,q) | |
94 | 114=Emulate(key,r) | |
95 | 115=Emulate(key,s) | |
96 | 116=Emulate(key,t) | |
97 | 117=Emulate(key,u) | |
98 | 118=Emulate(key,v) | |
99 | 119=Emulate(key,w) | |
100 | 120=Emulate(key,x) | |
101 | 121=Emulate(key,y) | |
102 | 122=Emulate(key,z) | |
103 | 123=Emulate(key,braceleft) | |
104 | 124=Emulate(key,bar) | |
105 | 125=Emulate(key,braceright) | |
106 | 126=Emulate(key,asciitilde) | |
107 | ||
108 | 163=Emulate(keydown,Shift_L,key,bar,keyup,Shift_L) | |
109 | ||
110 | 8364=Emulate(keydown,Shift_L,key,euro,keyup,Shift_L) | |
111 | ||
112 | ||
113 | FIRE=Emulate(key,Return) | |
114 | LEFT=Emulate(key,Left) | |
115 | UP=Emulate(key,Up) | |
116 | RIGHT=Emulate(key,Right) | |
117 | DOWN=Emulate(key,Down) | |
118 | ||
119 | [End] |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.65 for anyremote 5.1.3. | |
2 | # Generated by GNU Autoconf 2.65 for anyremote 5.2. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
548 | 548 | # Identity of this package. |
549 | 549 | PACKAGE_NAME='anyremote' |
550 | 550 | PACKAGE_TARNAME='anyremote' |
551 | PACKAGE_VERSION='5.1.3' | |
552 | PACKAGE_STRING='anyremote 5.1.3' | |
551 | PACKAGE_VERSION='5.2' | |
552 | PACKAGE_STRING='anyremote 5.2' | |
553 | 553 | PACKAGE_BUGREPORT='' |
554 | 554 | PACKAGE_URL='' |
555 | 555 | |
1260 | 1260 | # Omit some internal or obsolete options to make the list less imposing. |
1261 | 1261 | # This message is too long to be a string in the A/UX 3.1 sh. |
1262 | 1262 | cat <<_ACEOF |
1263 | \`configure' configures anyremote 5.1.3 to adapt to many kinds of systems. | |
1263 | \`configure' configures anyremote 5.2 to adapt to many kinds of systems. | |
1264 | 1264 | |
1265 | 1265 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1266 | 1266 | |
1330 | 1330 | |
1331 | 1331 | if test -n "$ac_init_help"; then |
1332 | 1332 | case $ac_init_help in |
1333 | short | recursive ) echo "Configuration of anyremote 5.1.3:";; | |
1333 | short | recursive ) echo "Configuration of anyremote 5.2:";; | |
1334 | 1334 | esac |
1335 | 1335 | cat <<\_ACEOF |
1336 | 1336 | |
1430 | 1430 | test -n "$ac_init_help" && exit $ac_status |
1431 | 1431 | if $ac_init_version; then |
1432 | 1432 | cat <<\_ACEOF |
1433 | anyremote configure 5.1.3 | |
1433 | anyremote configure 5.2 | |
1434 | 1434 | generated by GNU Autoconf 2.65 |
1435 | 1435 | |
1436 | 1436 | Copyright (C) 2009 Free Software Foundation, Inc. |
1849 | 1849 | This file contains any messages produced by compilers while |
1850 | 1850 | running configure, to aid debugging if configure makes a mistake. |
1851 | 1851 | |
1852 | It was created by anyremote $as_me 5.1.3, which was | |
1852 | It was created by anyremote $as_me 5.2, which was | |
1853 | 1853 | generated by GNU Autoconf 2.65. Invocation command line was |
1854 | 1854 | |
1855 | 1855 | $ $0 $@ |
2658 | 2658 | |
2659 | 2659 | # Define the identity of the package. |
2660 | 2660 | PACKAGE=anyremote |
2661 | VERSION=5.1.3 | |
2661 | VERSION=5.2 | |
2662 | 2662 | |
2663 | 2663 | |
2664 | 2664 | cat >>confdefs.h <<_ACEOF |
6115 | 6115 | # report actual input values of CONFIG_FILES etc. instead of their |
6116 | 6116 | # values after options handling. |
6117 | 6117 | ac_log=" |
6118 | This file was extended by anyremote $as_me 5.1.3, which was | |
6118 | This file was extended by anyremote $as_me 5.2, which was | |
6119 | 6119 | generated by GNU Autoconf 2.65. Invocation command line was |
6120 | 6120 | |
6121 | 6121 | CONFIG_FILES = $CONFIG_FILES |
6172 | 6172 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
6173 | 6173 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
6174 | 6174 | ac_cs_version="\\ |
6175 | anyremote config.status 5.1.3 | |
6175 | anyremote config.status 5.2 | |
6176 | 6176 | configured by $0, generated by GNU Autoconf 2.65, |
6177 | 6177 | with options \\"\$ac_cs_config\\" |
6178 | 6178 |
22 | 22 | |
23 | 23 | AC_PREREQ(2.59) |
24 | 24 | |
25 | AC_INIT(anyremote,5.1.3) | |
25 | AC_INIT(anyremote,5.2) | |
26 | 26 | AC_CONFIG_SRCDIR([src/main.c]) |
27 | 27 | AM_INIT_AUTOMAKE(anyremote, AC_PACKAGE_VERSION) |
28 | 28 |
0 | anyremote (5.2+dfsg-1) unstable; urgency=low | |
1 | ||
2 | * New upstream release | |
3 | ||
4 | -- Philipp Huebner <debalance@debian.org> Fri, 27 Aug 2010 11:18:40 +0200 | |
5 | ||
0 | 6 | anyremote (5.1.3+dfsg-1) unstable; urgency=low |
1 | 7 | |
2 | 8 | * New upstream release |
205 | 205 | </tr> |
206 | 206 | <tr class="alt"> |
207 | 207 | <td class="manufact">Motorola</td> |
208 | <td class="model">V551</td> | |
209 | <td><img src="data/img/question.png" alt="N/A" /></td> | |
210 | <td><img src="data/img/question.png" alt="N/A" /></td> | |
208 | <td class="model">E2, V551</td> | |
209 | <td><img src="data/img/question.png" alt="N/A" /></td> | |
210 | <td><img src="data/img/no.png" alt="N/A" /></td> | |
211 | 211 | <td><img src="data/img/no.png" alt="no" /></td> |
212 | 212 | <td><img src="data/img/yes.png" alt="yes" /></td> |
213 | 213 | <td><img src="data/img/no.png" alt="no" /></td> |
206 | 206 | <h2>*Ubuntu</h2> |
207 | 207 | |
208 | 208 | <p><a href="http://ununtu.com"><strong>*Ubuntu</strong></a> users can download packages (a bit outdated, see note below) from official <a href="http://packages.ubuntu.com/search?searchon=names&keywords=anyremote">repository</a>.</p> |
209 | <p>The latest versions of packages can be obtained from <a href="https://launchpad.net/~anyremote/+archive">Launchpad PPA</a> for anyRemote.</p> | |
210 | ||
209 | <p>The latest versions of packages can be obtained from <a href="https://launchpad.net/~anyremote/+archive">Launchpad PPA</a> for anyRemote.</p> | |
211 | 210 | <p>For details take a look <a href="https://help.launchpad.net/Packaging/PPA#Adding%20a%20PPA%20to%20your%20Ubuntu%20repositories">here</a></p> |
211 | <p><strong>Beware:</strong> You must not mix Launchpad's and official packages.</p> | |
212 | 212 | |
213 | 213 | <h2>Other</h2> |
214 | 214 |
0 | 0 | Summary: Remote control through bluetooth or IR connection |
1 | 1 | Name: anyremote |
2 | Version: 5.1.3 | |
2 | Version: 5.2 | |
3 | 3 | Release: 1%{?dist} |
4 | 4 | License: GPLv2+ |
5 | 5 | Group: Applications/System |
6 | 6 | Source0: http://downloads.sourceforge.net/anyremote/%{name}-%{version}.tar.gz |
7 | 7 | URL: http://anyremote.sourceforge.net/ |
8 | 8 | Requires: bc,dbus-glib,anyremote-data >= 5.1.3 |
9 | BuildRequires:bluez-libs-devel >= 3.35, libX11-devel, libXtst-devel, xorg-x11-proto-devel, glib2-devel >= 2.18, dbus-devel >= 1.2.4, dbus-glib-devel >= 0.76 | |
9 | BuildRequires:bluez-libs-devel >= 4.64, libX11-devel, libXtst-devel, xorg-x11-proto-devel, glib2-devel >= 2.24.1, dbus-devel >= 1.2.24, dbus-glib-devel >= 0.86 | |
10 | 10 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
11 | 11 | |
12 | 12 | %description |
58 | 58 | |
59 | 59 | |
60 | 60 | %changelog |
61 | ||
62 | * Wed Aug 25 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.2 | |
63 | - Enhanced support for Get(password) command. Properly handle ampersand in file | |
64 | names. | |
61 | 65 | |
62 | 66 | * Thu Jul 8 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.1.3 |
63 | 67 | - Some configuration files and documentation were corrected. |
0 | 0 | %define name anyremote |
1 | %define version 5.1.3 | |
1 | %define version 5.2 | |
2 | 2 | %define release %mkrel 1 |
3 | 3 | |
4 | 4 | Summary: Remote control through bluetooth or IR connection |
10 | 10 | Source0: %{name}-%{version}.tar.gz |
11 | 11 | URL: http://anyremote.sourceforge.net/ |
12 | 12 | |
13 | BuildRequires: libbluez-devel >= 3.35, x11-proto-devel | |
13 | BuildRequires: libbluez-devel, x11-proto-devel | |
14 | 14 | BuildRequires: glib2-devel >= 2.20.1, dbus-devel, dbus-devel >= 0.80 |
15 | 15 | BuildRequires: dbus-glib-devel >= 0.80 |
16 | 16 | BuildRequires: libxtst-devel >= 1.0.3 |
45 | 45 | %{_datadir}/man/man1/anyremote.1.lzma |
46 | 46 | |
47 | 47 | %changelog |
48 | ||
49 | * Wed Aug 25 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.2 | |
50 | - Enhanced support for Get(password) command. Properly handle ampersand in file | |
51 | names. | |
48 | 52 | |
49 | 53 | * Thu Jul 8 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.1.3 |
50 | 54 | - Some configuration files and documentation were corrected. |
0 | 0 | # norootforbuild |
1 | 1 | |
2 | 2 | %define name anyremote |
3 | %define version 5.1.3 | |
3 | %define version 5.2 | |
4 | 4 | |
5 | 5 | Summary: Remote control through bluetooth or IR connection |
6 | 6 | Name: %{name} |
43 | 43 | %{_mandir}/man1/anyremote.1.gz |
44 | 44 | |
45 | 45 | %changelog |
46 | ||
47 | * Wed Aug 25 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.2 | |
48 | - Enhanced support for Get(password) command. Properly handle ampersand in file | |
49 | names. | |
46 | 50 | |
47 | 51 | * Thu Jul 8 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.1.3 |
48 | 52 | - Some configuration files and documentation were corrected. |
0 | 0 | # norootforbuild |
1 | 1 | |
2 | 2 | %define name anyremote |
3 | %define version 5.1.3 | |
3 | %define version 5.2 | |
4 | 4 | |
5 | 5 | Summary: Remote control through bluetooth or IR connection |
6 | 6 | Name: %{name} |
96 | 96 | |
97 | 97 | %changelog |
98 | 98 | |
99 | * Wed Aug 25 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.2 | |
100 | - Enhanced support for Get(password) command. Properly handle ampersand in file | |
101 | names. | |
102 | ||
99 | 103 | * Thu Jul 8 2010 Mikhail Fedotov <anyremote at mail.ru> - 5.1.3 |
100 | 104 | - Some configuration files and documentation were corrected. |
101 | 105 | Added configuration file for QMMP. |
0 | 0 | # |
1 | 1 | # anyRemote - a bluetooth remote for your PC. |
2 | 2 | # |
3 | # Copyright (C) 2007,2008,2009 Mikhail Fedotov <anyremote@mail.ru> | |
3 | # Copyright (C) 2007,2008,2009,2010 Mikhail Fedotov <anyremote@mail.ru> | |
4 | 4 | # |
5 | 5 | # This program is free software; you can redistribute it and/or modify |
6 | 6 | # it under the terms of the GNU General Public License as published by |
17 | 17 | # |
18 | 18 | # anyRemote - a bluetooth remote for your PC. |
19 | 19 | # |
20 | # Copyright (C) 2007,2008,2009 Mikhail Fedotov <anyremote@mail.ru> | |
20 | # Copyright (C) 2007,2008,2009,2010 Mikhail Fedotov <anyremote@mail.ru> | |
21 | 21 | # |
22 | 22 | # This program is free software; you can redistribute it and/or modify |
23 | 23 | # it under the terms of the GNU General Public License as published by |
138 | 138 | int bt_close_port(int final) |
139 | 139 | { |
140 | 140 | int retval = 0; |
141 | ||
142 | logger("INF", "bt_close_port"); | |
141 | 143 | |
142 | 144 | if (!portfd) { /* already closed */ |
143 | 145 | if (final) logger("INF", "Already closed ?"); |
165 | 167 | return read(portfd, buf, len); |
166 | 168 | } |
167 | 169 | |
168 | int bt_read_tmo(char* buf, int len, int timeout) | |
170 | static int bt_read_tmo(char* buf, int len, int timeout) | |
169 | 171 | { |
170 | 172 | int ok; |
171 | 173 | fd_set rdfds; |
219 | 221 | *c = 0; |
220 | 222 | |
221 | 223 | int rv = bt_read_tmo(buf, 1, timeout); |
222 | ||
224 | /*if (rv != 0) { | |
225 | sprintf(tmp, "bt_read_tmo returns: %d", rv); | |
226 | logger("DBG", tmp); | |
227 | }*/ | |
228 | ||
223 | 229 | if (rv == 1) { |
224 | 230 | *c = buf[0]; |
225 | 231 | return 1; |
774 | 780 | |
775 | 781 | int closeSocketPort(int type, int final) |
776 | 782 | { |
777 | if (final) logger("INF", "closeSocketPort"); | |
783 | /*if (final)*/ logger("INF", "closeSocketPort"); | |
778 | 784 | |
779 | 785 | if (portfd) { |
780 | 786 | close(portfd); |
826 | 832 | |
827 | 833 | while (stillRun) { |
828 | 834 | |
829 | //logger("INF", "listenAndAcceptSocketConn: accept"); | |
835 | logger("INF", "listenAndAcceptSocketConn: accept"); | |
830 | 836 | |
831 | 837 | listen(sportfd,5); |
832 | 838 |
25 | 25 | int bt_close_port(int final); |
26 | 26 | |
27 | 27 | int bt_read(char* buf, int len); |
28 | int bt_read_tmo(char* buf, int len, int timeout); | |
29 | 28 | int bt_readchar(char* c, int timeout); |
30 | 29 | int bt_write(char* buf, int len); |
31 | 30 | int bt_put_command(char* command, |
21 | 21 | #define _GNU_SOURCE |
22 | 22 | #include <stdio.h> |
23 | 23 | |
24 | #include <ctype.h> | |
24 | 25 | #include <stdlib.h> |
25 | 26 | #include <string.h> |
26 | 27 | #include <time.h> |
564 | 565 | |
565 | 566 | static int execSimpleCmd(const char *cmd, int toFile) |
566 | 567 | { |
567 | if (cmd == NULL || remoteOn != 1) { | |
568 | if (cmd == NULL || strlen(cmd) == 0 || remoteOn != 1) { | |
568 | 569 | logger("DBG", "execSimpleCmd null input or remote if OFF"); |
569 | 570 | return EXIT_OK; |
570 | 571 | } |
587 | 588 | strcat(p, " > "); |
588 | 589 | strcat(p, getResFile()); |
589 | 590 | } else { |
590 | if (!index(p, '&')) { | |
591 | // How to handle & inside file names ? | |
592 | //if (!index(p, '&') ) { | |
593 | ||
594 | int idx = strlen(cmd)-1; | |
595 | while (idx > 0 && isspace(cmd[idx])) { idx--; } | |
596 | ||
597 | if (cmd[idx] != '&') { | |
591 | 598 | strcat(p, "&"); |
592 | 599 | } |
593 | 600 | } |
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
264 | static void handleActiveCall(void) | |
265 | { | |
266 | if (callTimer >= 20) { | |
267 | logger("DBG", "[DS]: Get call list again"); | |
268 | ||
269 | // Will set global callerId [MAXLEN]; | |
270 | int ret = getClip(callerId); | |
271 | if (ret == EXIT_EXACT) { | |
272 | DEBUG2("[DS]: Call still active (%s)", callerId); | |
273 | } else { | |
274 | logger("DBG","[DS]: Call was finished"); | |
275 | callOn = 0; | |
276 | strcpy(callerId, "NO CALLER ID"); | |
277 | ||
278 | sendEventToExecutor(ID_EVT_ENDCALL); | |
279 | } | |
280 | callTimer = 0; | |
281 | } else { | |
282 | callTimer++; | |
283 | } | |
284 | } | |
285 | ||
264 | 286 | // |
265 | // retuencodeis used in case of exit only | |
287 | // return code is used in case of exit only | |
266 | 288 | // |
267 | 289 | static int proceedDisconnect(void) |
268 | 290 | { |
658 | 680 | { |
659 | 681 | char answer[MAXCMDLEN]; |
660 | 682 | int ret = EXIT_OK; |
661 | int retRead; | |
683 | int retRead = 0; | |
662 | 684 | |
663 | 685 | logger("DBG","[DS]: start dispatcher thread"); |
664 | 686 | |
685 | 707 | char* dv = getDevice(); |
686 | 708 | |
687 | 709 | logger("DBG","[DS]: ************ outer loop **********"); |
710 | //printf("opening server socket ...\n"); | |
688 | 711 | |
689 | 712 | // try to open port |
690 | 713 | if(openPort(dv) == 1) { // Open device |
705 | 728 | |
706 | 729 | if (initPort() == 1 ) { // Init modem: AT, ATE0, AT+CMER, in server mode waits for connection |
707 | 730 | |
708 | dispIsJoinable = TRUE; | |
731 | dispIsJoinable = TRUE; | |
709 | 732 | |
710 | isConnected = 1; | |
733 | isConnected = 1; | |
711 | 734 | |
712 | 735 | if (usePassword()) { |
713 | int PassOk = 0; | |
714 | ||
736 | ||
715 | 737 | char *pass = getStoredPass(); |
716 | ||
717 | 738 | if (pass) { |
718 | ||
719 | sendToFrontEnd("Verifying password"); | |
739 | int gotReply = 1; | |
740 | while (1) { | |
741 | ||
742 | if (gotReply == 1) { | |
743 | sendToFrontEnd("Verifying password"); | |
720 | 744 | |
721 | ret = writeSocketConn("Get(password);", 14); | |
722 | if (ret != EXIT_OK) { | |
723 | logger("DBG","[DS]: Fails in writeSocketConn()"); | |
724 | continue; | |
725 | } | |
745 | ret = writeSocketConn("Get(password);", 14); | |
746 | if (ret != EXIT_OK) { | |
747 | logger("DBG","[DS]: Fails in writeSocketConn()"); | |
748 | continue; | |
749 | } | |
750 | if (getHttp()) { | |
751 | ret = writeSocketConn("End();", 6); | |
752 | if (ret != EXIT_OK) { | |
753 | logger("DBG","[DS]: Fails in writeSocketConn()"); | |
754 | continue; | |
755 | } | |
756 | } | |
757 | gotReply = 0; | |
758 | } | |
726 | 759 | |
727 | while (1) { | |
728 | 760 | retRead = read_command(answer, sizeof(answer)); |
729 | 761 | |
730 | 762 | if (retRead == EOF) { |
763 | logger("DBG","[DS]: Got disconnect on verifying password"); | |
731 | 764 | sendToFrontEnd("Disconnected"); |
732 | 765 | sendDisconnect(); |
733 | 766 | break; |
735 | 768 | DEBUG2("[DS]: Password => %s\n",answer); |
736 | 769 | DEBUG2("[DS]: Password => %s\n",answer+16); |
737 | 770 | DEBUG2("[DS]: Compare to => %s\n",pass); |
771 | ||
772 | gotReply = 1; | |
738 | 773 | |
739 | 774 | if (memcmp(answer, DEF_MSG, 4) == 0 && |
740 | 775 | memcmp(answer+4, "_PASSWORD_(,", 12) == 0) { // Got verification response from Java client |
742 | 777 | int plen = strlen(pass); |
743 | 778 | if (memcmp(answer+16, pass, plen) == 0) { // _PASSWORD_(,<password here>) |
744 | 779 | logger("INF","[DS]: Password OK"); |
745 | PassOk = 1; | |
780 | free(pass); | |
781 | break; | |
746 | 782 | } else { |
747 | 783 | logger("INF","[DS]: Verification failed. Incorrect password."); |
748 | 784 | sendToFrontEnd("Verification failed"); |
752 | 788 | logger("INF","[DS]: Verification failed. Incorrect response."); |
753 | 789 | sendToFrontEnd("Verification failed"); |
754 | 790 | } |
755 | break; | |
756 | 791 | } |
757 | 792 | |
758 | 793 | if (checkMsgQueue() == EXIT_ABORT) { |
759 | 794 | free(dv); |
760 | 795 | return NULL; |
761 | 796 | } |
762 | ||
763 | 797 | usleep(50000); |
764 | 798 | } |
765 | 799 | } else { |
766 | 800 | logger("DBG","[DS]: No password specified. Skip check."); |
767 | 801 | } |
802 | } | |
803 | ||
804 | if (retRead != EOF) { | |
805 | sendToFrontEnd("Connected"); | |
806 | sendEventToExecutor(ID_EVT_CONNECT); | |
807 | ||
808 | logger("INF","[DS]: Start event forwarding"); | |
809 | ||
810 | while (1) { | |
811 | //logger("DBG","[DS]: main loop"); | |
812 | ||
813 | retRead = read_command(answer, sizeof(answer)); | |
814 | //if (retRead != 0) printf("GOT %d\n",retRead); | |
768 | 815 | |
769 | free(pass); | |
770 | if (PassOk == 0) { | |
771 | writeSocketConn("Set(title,PASSWORD INVALID);", 28); | |
816 | if (retRead == EOF) { | |
817 | logger("INF", "[DS]: Got disconnected"); | |
818 | //printf("Got disconnected\n"); | |
772 | 819 | |
773 | sleep(1); | |
820 | freeBtAddress(); | |
774 | 821 | |
775 | closePort(1); | |
776 | isConnected = 0; | |
822 | if (gotExitSignal) { | |
823 | logger("INF", "[DS]: Got signal, exiting"); | |
824 | closePort(1); | |
825 | free(dv); | |
826 | return NULL; | |
827 | ||
828 | } | |
829 | sendToFrontEnd("Disconnected"); | |
830 | sendDisconnect(); | |
831 | sendEventToExecutor(ID_EVT_DISCONNECT); | |
832 | ||
833 | if (serverMode == CLIENT_AT || | |
834 | serverMode == CLIENT_ILIRC || | |
835 | serverMode == CLIENT_NOAT) { // In server mode we will reuse already opened socket | |
836 | ||
837 | logger("INF", "[DS]: Closing the port"); | |
838 | closePort(1); | |
839 | } | |
840 | ret = EXIT_NOK; | |
841 | ||
842 | isConnected = 0; | |
843 | ||
844 | break; | |
777 | 845 | |
778 | sleep(5); | |
779 | continue; | |
780 | } | |
781 | } | |
782 | ||
783 | sendToFrontEnd("Connected"); | |
784 | sendEventToExecutor(ID_EVT_CONNECT); | |
785 | ||
786 | logger("INF","[DS]: Start event forwarding"); | |
787 | ||
788 | while (1) { | |
789 | //logger("DBG","[DS]: main loop"); | |
846 | } else if (retRead > 0) { | |
847 | ||
848 | if (serverMode == CLIENT_NOAT) { // in IR communication a lot of 'empty' chars (= -1) could be added | |
849 | char * k2 = answer; | |
850 | while (*k2 != '\0') { | |
851 | if (*k2 == -1) { | |
852 | *k2 = '\r'; | |
853 | } | |
854 | k2++; | |
855 | } | |
856 | } | |
857 | ||
858 | parseCommand(answer); | |
859 | if (getHttp()) { | |
860 | ||
861 | eMessage* em = malloc(sizeof(eMessage)); | |
862 | em->type = EM_AS_IS; | |
863 | em->value = strdup("End();"); | |
864 | sendToExecutor(em); | |
865 | } | |
866 | } | |
790 | 867 | |
791 | retRead = read_command(answer, sizeof(answer)); | |
792 | //printf("GOT %d\n",retRead); | |
793 | ||
794 | if (retRead == EOF) { | |
795 | logger("INF", "[DS]: Got disconnected"); | |
796 | printf("Got disconnected\n"); | |
797 | ||
798 | freeBtAddress(); | |
799 | ||
800 | if (gotExitSignal) { | |
801 | logger("INF", "[DS]: Got signal, exiting"); | |
802 | closePort(1); | |
868 | // Is call still active (timeout about 1 seconds) ? | |
869 | if (callOn) { | |
870 | handleActiveCall(); | |
871 | } | |
872 | ||
873 | ret = checkMsgQueue(); | |
874 | if (ret == EXIT_ABORT) { | |
803 | 875 | free(dv); |
804 | 876 | return NULL; |
805 | ||
877 | } else if (ret == EXIT_DISCON) { | |
878 | break; | |
806 | 879 | } |
807 | sendToFrontEnd("Disconnected"); | |
808 | sendDisconnect(); | |
809 | sendEventToExecutor(ID_EVT_DISCONNECT); | |
810 | ||
811 | if (serverMode == CLIENT_AT || | |
812 | serverMode == CLIENT_ILIRC || | |
813 | serverMode == CLIENT_NOAT) { // In server mode we will reuse already opened socket | |
814 | ||
815 | logger("INF", "[DS]: Closing the port"); | |
816 | closePort(1); | |
817 | } | |
818 | ret = EXIT_NOK; | |
819 | ||
820 | isConnected = 0; | |
821 | ||
822 | break; | |
823 | } else if (retRead > 0) { | |
824 | ||
825 | if (serverMode == CLIENT_NOAT) { // in IR communication a lot of 'empty' chars (= -1) could be added | |
826 | char * k2 = answer; | |
827 | while (*k2 != '\0') { | |
828 | if (*k2 == -1) { | |
829 | *k2 = '\r'; | |
830 | } | |
831 | k2++; | |
832 | } | |
833 | } | |
834 | ||
835 | parseCommand(answer); | |
836 | if (getHttp()) { | |
837 | ||
838 | eMessage* em = malloc(sizeof(eMessage)); | |
839 | em->type = EM_AS_IS; | |
840 | em->value = strdup("End();"); | |
841 | sendToExecutor(em); | |
842 | } | |
843 | } | |
844 | ||
845 | // Is call still active (timeout about 1 seconds) ? | |
846 | if (callOn) { | |
847 | if (callTimer >= 20) { | |
848 | logger("DBG", "[DS]: Get call list again"); | |
849 | ||
850 | // Will set global callerId [MAXLEN]; | |
851 | ret = getClip(callerId); | |
852 | if (ret == EXIT_EXACT) { | |
853 | DEBUG2("[DS]: Call still active (%s)", callerId); | |
854 | } else { | |
855 | logger("DBG","[DS]: Call was finished"); | |
856 | callOn = 0; | |
857 | strcpy(callerId, "NO CALLER ID"); | |
858 | ||
859 | sendEventToExecutor(ID_EVT_ENDCALL); | |
860 | } | |
861 | ||
862 | callTimer = 0; | |
863 | } else { | |
864 | callTimer++; | |
865 | } | |
866 | } | |
867 | ||
868 | ret = checkMsgQueue(); | |
869 | if (ret == EXIT_ABORT) { | |
870 | free(dv); | |
871 | return NULL; | |
872 | } else if (ret == EXIT_DISCON) { | |
873 | break; | |
874 | } | |
875 | 880 | |
876 | // Main loop timer (1/50 of second) | |
877 | usleep(20000); | |
878 | } | |
879 | } // init port | |
880 | } // open port | |
881 | // Main loop timer (1/50 of second) | |
882 | usleep(20000); | |
883 | } | |
884 | } // not EOF after password verification | |
885 | } // init port | |
886 | } // open port | |
881 | 887 | |
882 | 888 | free(dv); |
883 | 889 | |
884 | printf("Connection closed or lost\n"); | |
890 | //printf("Connection closed or lost\n"); | |
891 | logger("INF", "[DS]: Connection closed or lost"); | |
885 | 892 | |
886 | 893 | // Can't open port or it closed again |
887 | if (dmn || | |
888 | serverMode == SERVER_BT || | |
889 | #ifdef USE_L2CAP | |
890 | serverMode == SERVER_L2CAP || | |
891 | #endif | |
892 | serverMode == SERVER_TCP || | |
893 | serverMode == SERVER_UX || | |
894 | serverMode == CLIENT_NOAT || | |
895 | ret == EXIT_DISCON) { | |
894 | if (!gotExitSignal && | |
895 | (dmn || | |
896 | serverMode == SERVER_BT || | |
897 | #ifdef USE_L2CAP | |
898 | serverMode == SERVER_L2CAP || | |
899 | #endif | |
900 | serverMode == SERVER_TCP || | |
901 | serverMode == SERVER_UX || | |
902 | serverMode == CLIENT_NOAT || | |
903 | ret == EXIT_DISCON)) { | |
896 | 904 | |
897 | 905 | int timeout; |
898 | 906 | |
904 | 912 | serverMode == SERVER_UX || |
905 | 913 | serverMode == CLIENT_NOAT) { |
906 | 914 | |
907 | timeout = 5; // wait only 5 seconds | |
915 | timeout = 2; // wait only 2 seconds | |
908 | 916 | |
909 | 917 | } else if (ret == EXIT_DISCON) { |
910 | 918 | |
916 | 924 | } |
917 | 925 | |
918 | 926 | INFO2("[DS]: Wait %d seconds to connect/open server socket ...", timeout); |
919 | printf("Wait %d seconds to connect/open server socket ...\n", timeout); | |
927 | //printf("Wait %d seconds to connect/open server socket ...\n", timeout); | |
920 | 928 | |
921 | 929 | dispIsJoinable = FALSE; |
922 | 930 | sleep(timeout); |
109 | 109 | void sig_int() { |
110 | 110 | signal(SIGINT, SIG_DFL); |
111 | 111 | printf("\nProcess %d: got SIGINT\n",getpid()); |
112 | //sig_handle(); | |
113 | 112 | aboutToExit(); |
114 | 113 | } |
115 | 114 | |
116 | 115 | void sig_quit() { |
117 | 116 | signal(SIGQUIT, SIG_DFL); |
118 | 117 | printf("\nProcess %d: got SIGQUIT\n",getpid()); |
119 | //sig_handle(); | |
120 | 118 | aboutToExit(); |
121 | 119 | } |
122 | 120 | |
123 | 121 | void sig_kill() { |
124 | 122 | signal(SIGKILL, SIG_DFL); |
125 | 123 | printf("\nProcess %d: got SIGKILL\n",getpid()); |
126 | //sig_handle(); | |
127 | 124 | aboutToExit(); |
128 | 125 | } |
129 | 126 |