author | kergoth <kergoth> | 2002-09-27 23:35:30 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-09-27 23:35:30 (UTC) |
commit | 996c0d02d16c185acc3190baa5b4a1fc934e730c (patch) (side-by-side diff) | |
tree | 837e0d9f0fef522964d28e3e841686d63521dadd | |
parent | d7bcdda1857ff31830705921d8248200d881cf93 (diff) | |
download | opie-996c0d02d16c185acc3190baa5b4a1fc934e730c.zip opie-996c0d02d16c185acc3190baa5b4a1fc934e730c.tar.gz opie-996c0d02d16c185acc3190baa5b4a1fc934e730c.tar.bz2 |
Check for /etc/oz_version.. tired of seeing OpenZaurus v0.0 in opie-login.
-rw-r--r-- | libopie/odevice.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 9871e80..3bc1e0c 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -488,134 +488,142 @@ bool ODeviceIPAQ::setPowerButtonHandler ( ODevice::PowerButtonHandler p ) ::close ( fd ); } else ::perror ( "/proc/sys/ts/suspend_button_mode" ); return res; } bool ODeviceIPAQ::setDisplayBrightness ( int bright ) { bool res = false; int fd; if ( bright > 255 ) bright = 255; if ( bright < 0 ) bright = 0; // 128 is the maximum if you want a decent lifetime for the LCD bright = (int) (( ::pow ( 2, double( bright ) / 255.0 ) - 1 ) * 128.0 ); // logarithmic // bright = ( bright + 1 ) / 2; if ((( fd = ::open ( "/dev/ts", O_WRONLY )) >= 0 ) || (( fd = ::open ( "/dev/h3600_ts", O_WRONLY )) >= 0 )) { FLITE_IN bl; bl. mode = 1; bl. pwr = bright ? 1 : 0; bl. brightness = bright; res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 ); ::close ( fd ); } return res; } int ODeviceIPAQ::displayBrightnessResolution ( ) const { return 255; // really 128, but logarithmic control is smoother this way } /************************************************** * * Zaurus * **************************************************/ void ODeviceZaurus::init ( ) { d-> m_modelstr = "Zaurus SL5000"; d-> m_model = OMODEL_Zaurus_SL5000; d-> m_vendorstr = "Sharp"; d-> m_vendor = OVENDOR_Sharp; QFile f ( "/proc/filesystems" ); if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { d-> m_systemstr = "OpenZaurus"; d-> m_system = OSYSTEM_OpenZaurus; f. close ( ); + + f. setName ( "/etc/oz_version" ); + if ( f. open ( IO_ReadOnly )) { + QTextStream ts ( &f ); + d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); + f. close ( ); + } } else { d-> m_systemstr = "Zaurus"; d-> m_system = OSYSTEM_Zaurus; } + d-> m_leds [0] = OLED_Off; } #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> //#include <asm/sharp_char.h> // including kernel headers is evil ... #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ #define SHARP_BUZ_KEYSOUND 2 /* key sound */ #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ /* --- for SHARP_BUZZER device --- */ //#define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ //#define SHARP_PDA_APPSTART 9 /* application start */ //#define SHARP_PDA_APPQUIT 10 /* application ends */ //#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ //#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ // #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) typedef struct sharp_led_status { int which; /* select which LED status is wanted. */ int status; /* set new led status if you call SHARP_LED_SETSTATUS */ } sharp_led_status; #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ // #include <asm/sharp_apm.h> // including kernel headers is evil ... #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) |