-rw-r--r-- | libopie/odevice.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index bc43c52..a33d4ad 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -693,73 +693,88 @@ int iPAQ::readLightSensor ( ) if ( *endptr != 0 ) val = -1; } ::close ( fd ); } return val; } int iPAQ::lightSensorResolution ( ) const { return 256; } /************************************************** * * Zaurus * **************************************************/ void Zaurus::init ( ) { - d-> m_modelstr = "Zaurus SL5000"; - d-> m_model = Model_Zaurus_SL5000; d-> m_vendorstr = "Sharp"; d-> m_vendor = Vendor_Sharp; QFile f ( "/proc/filesystems" ); if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { d-> m_systemstr = "OpenZaurus"; d-> m_system = System_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 = System_Zaurus; } + f. setName ( "/proc/deviceinfo/product" ); + if ( f. open ( IO_ReadOnly ) ) { + QTextStream ts ( &f ); + QString model = ts. readLine ( ); + f. close ( ); + if ( model == "SL-5000D" ) { + d-> m_model = Model_Zaurus_SL5000; + d-> m_modelstr = "Zaurus SL-5000D"; + } else if ( model == "SL-5500" ) { + d-> m_model = Model_Zaurus_SL5500; + d-> m_modelstr = "Zaurus SL-5500"; + } + } + else { + d-> m_model = Model_Zaurus_SL5000; + d-> m_modelstr = "Zaurus SL-5000D (unverified)"; + } m_leds [0] = Led_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) |