-rw-r--r-- | libopie2/examples/opiedb/sqltest/main.cpp | 2 | ||||
-rw-r--r-- | libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp | 2 | ||||
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/examples/opiedb/sqltest/main.cpp b/libopie2/examples/opiedb/sqltest/main.cpp index 24b7b21..f4338e9 100644 --- a/libopie2/examples/opiedb/sqltest/main.cpp +++ b/libopie2/examples/opiedb/sqltest/main.cpp | |||
@@ -1,62 +1,62 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the Opie Project | 2 | =. This file is part of the Opie Project |
3 | .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> | 3 | .=l. Copyright (C) 2004 Opie Team <opie-devel@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* OPIE */ | 29 | /* OPIE */ |
30 | #include <opie2/osqlmanager.h> | 30 | #include <opie2/osqlmanager.h> |
31 | #include <opie2/osqlquery.h> | 31 | #include <opie2/osqlquery.h> |
32 | #include <opie2/osqldriver.h> | 32 | #include <opie2/osqldriver.h> |
33 | #include <opie2/osqlresult.h> | 33 | #include <opie2/osqlresult.h> |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | 35 | ||
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | 37 | ||
38 | /* QT */ | 38 | /* QT */ |
39 | #include <qdir.h> | 39 | #include <qdir.h> |
40 | 40 | ||
41 | using namespace Opie::DB; | 41 | using namespace Opie::DB; |
42 | int main( int argc, char* argv[] ) { | 42 | int main( int argc, char* argv[] ) { |
43 | 43 | ||
44 | QPEApplication app( argc, argv ); | 44 | QPEApplication app( argc, argv ); |
45 | OSQLManager man; | 45 | OSQLManager man; |
46 | man.registerPath( QDir::currentDirPath() ); | 46 | man.registerPath( QDir::currentDirPath() ); |
47 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 47 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
48 | 48 | ||
49 | OSQLDriver *driver = man.standard(); | 49 | OSQLDriver *driver = man.standard(); |
50 | owarn << "testmain" + driver->id() << oendl; | 50 | owarn << "testmain" + driver->id() << oendl; |
51 | driver->setUrl("/home/ich/test2vhgytry"); | 51 | driver->setUrl("/home/ich/test2vhgytry"); |
52 | if ( driver->open() ) { | 52 | if ( driver->open() ) { |
53 | owarn << "could open" << oendl; | 53 | owarn << "could open" << oendl; |
54 | }else | 54 | }else |
55 | owarn << "wasn't able to open" << oendl; | 55 | owarn << "wasn't able to open" << oendl; |
56 | OSQLRawQuery raw("select * from t2" ); | 56 | OSQLRawQuery raw("select * from t2" ); |
57 | OSQLResult res = driver->query( &raw ); | 57 | OSQLResult res = driver->query( &raw ); |
58 | 58 | ||
59 | OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); | 59 | OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); |
60 | res = driver->query(&raw2); | 60 | res = driver->query(&raw2); |
61 | 61 | ||
62 | }; | 62 | }; |
diff --git a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp index bdf2149..b522441 100644 --- a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp +++ b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp | |||
@@ -1,65 +1,65 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the Opie Project | 2 | =. This file is part of the Opie Project |
3 | .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> | 3 | .=l. Copyright (C) 2004 Opie Team <opie-devel@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* OPIE */ | 29 | /* OPIE */ |
30 | #include <opie2/osoundsystem.h> | 30 | #include <opie2/osoundsystem.h> |
31 | #include <opie2/odebug.h> | 31 | #include <opie2/odebug.h> |
32 | 32 | ||
33 | using namespace Opie::MM; | 33 | using namespace Opie::MM; |
34 | 34 | ||
35 | int main( int argc, char** argv ) | 35 | int main( int argc, char** argv ) |
36 | { | 36 | { |
37 | odebug << "OPIE Sound System Demo" << oendl; | 37 | odebug << "OPIE Sound System Demo" << oendl; |
38 | 38 | ||
39 | OSoundSystem* sound = OSoundSystem::instance(); | 39 | OSoundSystem* sound = OSoundSystem::instance(); |
40 | 40 | ||
41 | OSoundSystem::CardIterator it = sound->iterator(); | 41 | OSoundSystem::CardIterator it = sound->iterator(); |
42 | /* | 42 | /* |
43 | while ( it.current() ) | 43 | while ( it.current() ) |
44 | { | 44 | { |
45 | odebug << "DEMO: OSoundSystem contains Interface '" << it.current()->name() << "'" << oendl; | 45 | odebug << "DEMO: OSoundSystem contains Interface '" << it.current()->name() << "'" << oendl; |
46 | ++it; | 46 | ++it; |
47 | } | 47 | } |
48 | 48 | ||
49 | */ | 49 | */ |
50 | OSoundCard* card = it.current(); | 50 | OSoundCard* card = it.current(); |
51 | 51 | ||
52 | OMixerInterface* mixer = card->mixer(); | 52 | OMixerInterface* mixer = card->mixer(); |
53 | 53 | ||
54 | QStringList channels = mixer->allChannels(); | 54 | QStringList channels = mixer->allChannels(); |
55 | 55 | ||
56 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) | 56 | for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) |
57 | { | 57 | { |
58 | odebug << "OSSDEMO: Mixer has channel " << *it << "" << oendl; | 58 | odebug << "OSSDEMO: Mixer has channel " << *it << "" << oendl; |
59 | odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff ) | 59 | odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff ) |
60 | << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl; | 60 | << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl; |
61 | } | 61 | } |
62 | 62 | ||
63 | return 0; | 63 | return 0; |
64 | 64 | ||
65 | } | 65 | } |
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 65866af..e0c93a2 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | |||
@@ -1,99 +1,99 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the Opie Project | 2 | =. This file is part of the Opie Project |
3 | .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> | 3 | .=l. Copyright (C) 2004 Opie Team <opie-devel@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* OPIE */ | 29 | /* OPIE */ |
30 | #include <opie2/onetwork.h> | 30 | #include <opie2/onetwork.h> |
31 | #include <opie2/ostation.h> | 31 | #include <opie2/ostation.h> |
32 | #include <opie2/omanufacturerdb.h> | 32 | #include <opie2/omanufacturerdb.h> |
33 | #include <opie2/odebug.h> | 33 | #include <opie2/odebug.h> |
34 | 34 | ||
35 | /* STD */ | 35 | /* STD */ |
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | 37 | ||
38 | using namespace Opie::Net; | 38 | using namespace Opie::Net; |
39 | 39 | ||
40 | int main( int argc, char** argv ) | 40 | int main( int argc, char** argv ) |
41 | { | 41 | { |
42 | odebug << "OPIE Network Demo" << oendl; | 42 | odebug << "OPIE Network Demo" << oendl; |
43 | 43 | ||
44 | ONetwork* net = ONetwork::instance(); | 44 | ONetwork* net = ONetwork::instance(); |
45 | 45 | ||
46 | ONetwork::InterfaceIterator it = net->iterator(); | 46 | ONetwork::InterfaceIterator it = net->iterator(); |
47 | 47 | ||
48 | while ( it.current() ) | 48 | while ( it.current() ) |
49 | { | 49 | { |
50 | odebug << "DEMO: ONetwork contains Interface '" << it.current()->name() << "'" << oendl; | 50 | odebug << "DEMO: ONetwork contains Interface '" << it.current()->name() << "'" << oendl; |
51 | odebug << "DEMO: Datalink code is '" << it.current()->dataLinkType() << "'" << oendl; | 51 | odebug << "DEMO: Datalink code is '" << it.current()->dataLinkType() << "'" << oendl; |
52 | odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString() << "'" << oendl; | 52 | odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString() << "'" << oendl; |
53 | odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString(true) << "'" << oendl; | 53 | odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString(true) << "'" << oendl; |
54 | odebug << "DEMO: MAC Manufacturer seems to be '" << it.current()->macAddress().manufacturer() << "'" << oendl; | 54 | odebug << "DEMO: MAC Manufacturer seems to be '" << it.current()->macAddress().manufacturer() << "'" << oendl; |
55 | odebug << "DEMO: Manufacturertest1 = '" << OManufacturerDB::instance()->lookupExt( "08:00:87" ) << "'" << oendl; | 55 | odebug << "DEMO: Manufacturertest1 = '" << OManufacturerDB::instance()->lookupExt( "08:00:87" ) << "'" << oendl; |
56 | odebug << "DEMO: Manufacturertest2 = '" << OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) << "'" << oendl; | 56 | odebug << "DEMO: Manufacturertest2 = '" << OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) << "'" << oendl; |
57 | odebug << "Demo: IPv4 Address is '" << it.current()->ipV4Address() << "'" << oendl; | 57 | odebug << "Demo: IPv4 Address is '" << it.current()->ipV4Address() << "'" << oendl; |
58 | if ( it.current()->isWireless() ) | 58 | if ( it.current()->isWireless() ) |
59 | { | 59 | { |
60 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); | 60 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); |
61 | odebug << "DEMO: '" << iface->name() << "' seems to feature the wireless extensions." << oendl; | 61 | odebug << "DEMO: '" << iface->name() << "' seems to feature the wireless extensions." << oendl; |
62 | odebug << "DEMO: Current SSID is '" << iface->SSID() << "'" << oendl; | 62 | odebug << "DEMO: Current SSID is '" << iface->SSID() << "'" << oendl; |
63 | odebug << "DEMO: Antenna is tuned to '" << iface->frequency() << "', that is channel " << iface->channel() << "" << oendl; | 63 | odebug << "DEMO: Antenna is tuned to '" << iface->frequency() << "', that is channel " << iface->channel() << "" << oendl; |
64 | 64 | ||
65 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) | 65 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) |
66 | //{ | 66 | //{ |
67 | //odebug << "DEMO: Associated AP has MAC Address '" << iface->associatedAP().toString() << "'" << oendl; | 67 | //odebug << "DEMO: Associated AP has MAC Address '" << iface->associatedAP().toString() << "'" << oendl; |
68 | //} | 68 | //} |
69 | 69 | ||
70 | /* | 70 | /* |
71 | 71 | ||
72 | // nickname | 72 | // nickname |
73 | odebug << "DEMO: Current NickName is '" << iface->nickName() << "'" << oendl; | 73 | odebug << "DEMO: Current NickName is '" << iface->nickName() << "'" << oendl; |
74 | iface->setNickName( "MyNickName" ); | 74 | iface->setNickName( "MyNickName" ); |
75 | if ( iface->nickName() != "MyNickName" ) | 75 | if ( iface->nickName() != "MyNickName" ) |
76 | odebug << "DEMO: Warning! Can't change nickname" << oendl; | 76 | odebug << "DEMO: Warning! Can't change nickname" << oendl; |
77 | else | 77 | else |
78 | odebug << "DEMO: Nickname change successful." << oendl; | 78 | odebug << "DEMO: Nickname change successful." << oendl; |
79 | 79 | ||
80 | /* | 80 | /* |
81 | 81 | ||
82 | // operation mode | 82 | // operation mode |
83 | odebug << "DEMO: Current OperationMode is '" << iface->mode() << "'" << oendl; | 83 | odebug << "DEMO: Current OperationMode is '" << iface->mode() << "'" << oendl; |
84 | iface->setMode( "adhoc" ); | 84 | iface->setMode( "adhoc" ); |
85 | if ( iface->mode() != "adhoc" ) | 85 | if ( iface->mode() != "adhoc" ) |
86 | odebug << "DEMO: Warning! Can't change operation mode" << oendl; | 86 | odebug << "DEMO: Warning! Can't change operation mode" << oendl; |
87 | else | 87 | else |
88 | odebug << "DEMO: Operation Mode change successful." << oendl; | 88 | odebug << "DEMO: Operation Mode change successful." << oendl; |
89 | 89 | ||
90 | // RF channel | 90 | // RF channel |
91 | odebug << "DEMO: Current Channel is '" << iface->channel() << "'" << oendl; | 91 | odebug << "DEMO: Current Channel is '" << iface->channel() << "'" << oendl; |
92 | iface->setChannel( 1 ); | 92 | iface->setChannel( 1 ); |
93 | if ( iface->channel() != 1 ) | 93 | if ( iface->channel() != 1 ) |
94 | odebug << "DEMO: Warning! Can't change RF channel" << oendl; | 94 | odebug << "DEMO: Warning! Can't change RF channel" << oendl; |
95 | else | 95 | else |
96 | odebug << "DEMO: RF channel change successful." << oendl; | 96 | odebug << "DEMO: RF channel change successful." << oendl; |
97 | 97 | ||
98 | iface->setMode( "managed" ); | 98 | iface->setMode( "managed" ); |
99 | 99 | ||