2003-09-24 14:08:01 +00:00
|
|
|
/* @file plustek-pp_misc.c
|
|
|
|
* @brief here we have some helpful functions
|
|
|
|
*
|
2003-09-23 07:10:53 +00:00
|
|
|
* based on sources acquired from Plustek Inc.
|
|
|
|
* Copyright (C) 1998 Plustek Inc.
|
2013-02-13 13:29:52 +00:00
|
|
|
* Copyright (C) 2000-2013 Gerhard Jaeger <gerhard@gjaeger.de>
|
2003-09-23 07:10:53 +00:00
|
|
|
* also based on the work done by Rick Bronson
|
|
|
|
*
|
2003-09-24 14:08:01 +00:00
|
|
|
* History:
|
|
|
|
* - 0.30 - initial version
|
|
|
|
* - 0.31 - no changes
|
|
|
|
* - 0.32 - moved the parport functions inside this module
|
|
|
|
* - now using the information, the parport-driver provides
|
|
|
|
* - for selecting the port-mode this driver uses
|
|
|
|
* - 0.33 - added code to use faster portmodes
|
|
|
|
* - 0.34 - added sample code for changing from ECP to PS/2 bidi mode
|
2003-10-22 19:20:31 +00:00
|
|
|
* - 0.35 - added Kevins' changes (new function miscSetFastMode())
|
2003-09-24 14:08:01 +00:00
|
|
|
* - moved function initPageSettings() to module models.c
|
|
|
|
* - 0.36 - added random generator
|
|
|
|
* - added additional debug messages
|
|
|
|
* - changed prototype of MiscInitPorts()
|
|
|
|
* - added miscPreemptionCallback()
|
|
|
|
* - 0.37 - changed inb_p/outb_p to macro calls (kernel-mode)
|
|
|
|
* - added MiscGetModelName()
|
|
|
|
* - added miscShowPortModes()
|
|
|
|
* - 0.38 - fixed a small bug in MiscGetModelName()
|
|
|
|
* - 0.39 - added forceMode support
|
|
|
|
* - 0.40 - no changes
|
|
|
|
* - 0.41 - merged Kevins' patch to make EPP(ECP) work
|
|
|
|
* - 0.42 - changed get_fast_time to _GET_TIME
|
|
|
|
* - changed include names
|
2004-04-14 19:11:48 +00:00
|
|
|
* - 0.43 - added LINUX_26 stuff
|
2004-06-08 09:29:52 +00:00
|
|
|
* - minor fixes
|
2004-07-16 11:39:09 +00:00
|
|
|
* - removed floating point stuff
|
2013-02-13 13:29:52 +00:00
|
|
|
* - 0.44 - fix format string issues, as Long types default to int32_t
|
|
|
|
* now
|
2003-09-24 14:08:01 +00:00
|
|
|
* .
|
|
|
|
* <hr>
|
|
|
|
* This file is part of the SANE package.
|
2003-09-23 07:10:53 +00:00
|
|
|
*
|
2003-09-24 14:08:01 +00:00
|
|
|
* 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 of the
|
|
|
|
* License, or (at your option) any later version.
|
2003-09-23 07:10:53 +00:00
|
|
|
*
|
2003-09-24 14:08:01 +00:00
|
|
|
* 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.
|
2003-09-23 07:10:53 +00:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-02-12 08:41:38 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2003-09-24 14:08:01 +00:00
|
|
|
*
|
|
|
|
* As a special exception, the authors of SANE give permission for
|
|
|
|
* additional uses of the libraries contained in this release of SANE.
|
|
|
|
*
|
|
|
|
* The exception is that, if you link a SANE library with other files
|
|
|
|
* to produce an executable, this does not by itself cause the
|
|
|
|
* resulting executable to be covered by the GNU General Public
|
|
|
|
* License. Your use of that executable is in no way restricted on
|
|
|
|
* account of linking the SANE library code into it.
|
|
|
|
*
|
|
|
|
* This exception does not, however, invalidate any other reasons why
|
|
|
|
* the executable file might be covered by the GNU General Public
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* If you submit changes to SANE to the maintainers to be included in
|
|
|
|
* a subsequent release, you agree by submitting the changes that
|
|
|
|
* those changes may be distributed with this exception intact.
|
|
|
|
*
|
|
|
|
* If you write modifications of your own for SANE, it is your choice
|
|
|
|
* whether to permit this exception to apply to your modifications.
|
|
|
|
* If you do not wish that, delete this exception notice.
|
|
|
|
* <hr>
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
|
|
|
#include "plustek-pp_scan.h"
|
|
|
|
|
|
|
|
/*************************** some definitions ********************************/
|
|
|
|
|
2003-10-22 19:20:31 +00:00
|
|
|
# define PPA_PROBE_SPP 0x0001
|
|
|
|
# define PPA_PROBE_PS2 0x0002
|
|
|
|
# define PPA_PROBE_ECR 0x0010
|
|
|
|
# define PPA_PROBE_EPP17 0x0100
|
|
|
|
# define PPA_PROBE_EPP19 0x0200
|
2003-09-23 07:10:53 +00:00
|
|
|
|
2004-05-15 13:58:40 +00:00
|
|
|
#define _PP_A 16807 /**< multiplier */
|
|
|
|
#define _PP_M 2147483647L /**< 2**31 - 1 */
|
2003-09-23 07:10:53 +00:00
|
|
|
|
|
|
|
/*************************** some local vars *********************************/
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
static int port_feature = 0;
|
|
|
|
static long randomnum = 1;
|
2003-09-23 07:10:53 +00:00
|
|
|
|
2003-09-24 14:08:01 +00:00
|
|
|
static int portIsClaimed[_MAX_PTDEVS] = { 0, 0, 0, 0 };
|
2003-09-23 07:10:53 +00:00
|
|
|
|
|
|
|
/*************************** local functions *********************************/
|
|
|
|
|
|
|
|
/** miscNextLongRand() -- generate 2**31-2 random numbers
|
|
|
|
**
|
|
|
|
** public domain by Ray Gardner
|
|
|
|
**
|
|
|
|
** based on "Random Number Generators: Good Ones Are Hard to Find",
|
|
|
|
** S.K. Park and K.W. Miller, Communications of the ACM 31:10 (Oct 1988),
|
|
|
|
** and "Two Fast Implementations of the 'Minimal Standard' Random
|
|
|
|
** Number Generator", David G. Carta, Comm. ACM 33, 1 (Jan 1990), p. 87-88
|
|
|
|
**
|
|
|
|
** linear congruential generator f(z) = 16807 z mod (2 ** 31 - 1)
|
|
|
|
**
|
|
|
|
** uses L. Schrage's method to avoid overflow problems
|
|
|
|
*/
|
|
|
|
static Long miscNextLongRand( Long seed )
|
|
|
|
{
|
|
|
|
ULong lo, hi;
|
|
|
|
|
2004-05-15 13:58:40 +00:00
|
|
|
lo = _PP_A * (Long)(seed & 0xFFFF);
|
|
|
|
hi = _PP_A * (Long)((ULong)seed >> 16);
|
2003-09-23 07:10:53 +00:00
|
|
|
lo += (hi & 0x7FFF) << 16;
|
2004-05-15 13:58:40 +00:00
|
|
|
if (lo > _PP_M) {
|
2003-09-23 07:10:53 +00:00
|
|
|
|
2004-05-15 13:58:40 +00:00
|
|
|
lo &= _PP_M;
|
2003-09-23 07:10:53 +00:00
|
|
|
++lo;
|
|
|
|
}
|
|
|
|
lo += hi >> 15;
|
2004-05-15 13:58:40 +00:00
|
|
|
if (lo > _PP_M) {
|
|
|
|
lo &= _PP_M;
|
2003-09-23 07:10:53 +00:00
|
|
|
++lo;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (Long)lo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** initialize the random number generator
|
|
|
|
*/
|
2013-02-13 13:29:52 +00:00
|
|
|
static void miscSeedLongRand( long seed )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
2004-05-15 13:58:40 +00:00
|
|
|
randomnum = seed ? (seed & _PP_M) : 1; /* nonzero seed */
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************ exported functions *********************************/
|
|
|
|
|
|
|
|
/** allocate and initialize some memory for the scanner structure
|
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC pScanData MiscAllocAndInitStruct( void )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
pScanData ps;
|
|
|
|
|
|
|
|
ps = (pScanData)_KALLOC(sizeof(ScanData), GFP_KERNEL);
|
|
|
|
|
|
|
|
if( NULL != ps ) {
|
|
|
|
MiscReinitStruct( ps );
|
|
|
|
}
|
|
|
|
|
2013-02-13 13:29:52 +00:00
|
|
|
DBG( DBG_HIGH, "ScanData = 0x%08lx\n", (unsigned long)ps );
|
2017-05-27 05:27:22 +00:00
|
|
|
return ps;
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** re-initialize the memory for the scanner structure
|
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC int MiscReinitStruct( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
if( NULL == ps )
|
|
|
|
return _E_NULLPTR;
|
|
|
|
|
|
|
|
memset( ps, 0, sizeof(ScanData));
|
|
|
|
|
2004-07-16 11:39:09 +00:00
|
|
|
/* first init all constant stuff in ScanData
|
|
|
|
*/
|
2003-09-23 07:10:53 +00:00
|
|
|
ps->bCurrentSpeed = 1;
|
|
|
|
ps->pbMapRed = ps->a_bMapTable;
|
|
|
|
ps->pbMapGreen = &ps->a_bMapTable[256];
|
|
|
|
ps->pbMapBlue = &ps->a_bMapTable[512];
|
|
|
|
ps->sCaps.wIOBase = _NO_BASE;
|
|
|
|
|
|
|
|
/* use memory address to seed the generator */
|
2013-02-13 13:29:52 +00:00
|
|
|
miscSeedLongRand((long)ps);
|
2003-09-23 07:10:53 +00:00
|
|
|
|
|
|
|
DBG( DBG_HIGH, "Init settings done\n" );
|
|
|
|
return _OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** in USER-Mode: probe the specified port and try to get the port-mode
|
|
|
|
* in KERNEL-Mode: only use the modes, the driver returns
|
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC int MiscInitPorts( pScanData ps, int port )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
2003-11-04 16:12:12 +00:00
|
|
|
int mode, mts;
|
2003-10-30 15:54:07 +00:00
|
|
|
|
2003-10-22 19:20:31 +00:00
|
|
|
if( NULL == ps )
|
|
|
|
return _E_NULLPTR;
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
if( SANE_STATUS_GOOD != sanei_pp_getmodes( ps->pardev, &mode )) {
|
2003-11-04 16:12:12 +00:00
|
|
|
DBG( DBG_HIGH, "Cannot get port mode!\n" );
|
2003-10-23 15:13:04 +00:00
|
|
|
return _E_NO_PORT;
|
|
|
|
}
|
|
|
|
|
2003-11-04 16:12:12 +00:00
|
|
|
ps->IO.portMode = _PORT_NONE;
|
|
|
|
mts = -1;
|
2003-10-23 15:13:04 +00:00
|
|
|
if( mode & SANEI_PP_MODE_SPP ) {
|
2003-10-29 16:53:18 +00:00
|
|
|
DBG( DBG_LOW, "Setting SPP-mode\n" );
|
2003-10-23 15:13:04 +00:00
|
|
|
ps->IO.portMode = _PORT_SPP;
|
2003-11-04 16:12:12 +00:00
|
|
|
mts = SANEI_PP_MODE_SPP;
|
2003-10-23 15:13:04 +00:00
|
|
|
}
|
|
|
|
if( mode & SANEI_PP_MODE_BIDI ) {
|
2003-10-29 16:53:18 +00:00
|
|
|
DBG( DBG_LOW, "Setting PS/2-mode\n" );
|
2003-10-23 15:13:04 +00:00
|
|
|
ps->IO.portMode = _PORT_BIDI;
|
2003-11-04 16:12:12 +00:00
|
|
|
mts = SANEI_PP_MODE_BIDI;
|
2003-10-23 15:13:04 +00:00
|
|
|
}
|
|
|
|
if( mode & SANEI_PP_MODE_EPP ) {
|
2003-10-29 16:53:18 +00:00
|
|
|
DBG( DBG_LOW, "Setting EPP-mode\n" );
|
2003-10-23 15:13:04 +00:00
|
|
|
ps->IO.portMode = _PORT_EPP;
|
2003-11-04 16:12:12 +00:00
|
|
|
mts = SANEI_PP_MODE_EPP;
|
2003-10-23 15:13:04 +00:00
|
|
|
}
|
|
|
|
if( mode & SANEI_PP_MODE_ECP ) {
|
2003-10-29 16:53:18 +00:00
|
|
|
DBG( DBG_HIGH, "ECP detected --> not supported\n" );
|
2003-10-23 15:13:04 +00:00
|
|
|
}
|
2003-10-22 19:20:31 +00:00
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
if( sanei_pp_uses_directio()) {
|
|
|
|
DBG( DBG_LOW, "We're using direct I/O\n" );
|
|
|
|
} else {
|
|
|
|
DBG( DBG_LOW, "We're using libIEEE1284 I/O\n" );
|
|
|
|
}
|
2003-10-26 10:58:36 +00:00
|
|
|
|
2003-11-04 16:12:12 +00:00
|
|
|
if( ps->IO.portMode == _PORT_NONE ) {
|
|
|
|
DBG( DBG_HIGH, "None of the portmodes is supported.\n" );
|
|
|
|
return _E_NOSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
sanei_pp_setmode( ps->pardev, mts );
|
2003-10-22 19:20:31 +00:00
|
|
|
_VAR_NOT_USED( port );
|
2003-09-23 07:10:53 +00:00
|
|
|
return _OK;
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Function to restore the port
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC void MiscRestorePort( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
DBG(DBG_LOW,"MiscRestorePort()\n");
|
|
|
|
|
2003-10-05 16:00:30 +00:00
|
|
|
/* don't restore if not necessary */
|
2003-09-23 07:10:53 +00:00
|
|
|
if( 0xFFFF == ps->IO.lastPortMode ) {
|
|
|
|
DBG(DBG_LOW,"- no need to restore portmode !\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Restore Port-Mode*/
|
2003-10-29 16:53:18 +00:00
|
|
|
if( port_feature & PPA_PROBE_ECR ){
|
2003-10-22 19:20:31 +00:00
|
|
|
_OUTB_ECTL(ps,ps->IO.lastPortMode);
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Initializes a timer.
|
|
|
|
* @param timer - pointer to the timer to start
|
|
|
|
* @param us - timeout value in micro-seconds
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2005-05-11 14:46:12 +00:00
|
|
|
_LOC void MiscStartTimer( TimerDef *timer , unsigned long us)
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
struct timeval start_time;
|
|
|
|
|
2017-05-27 05:27:22 +00:00
|
|
|
gettimeofday(&start_time, NULL);
|
2003-09-23 07:10:53 +00:00
|
|
|
|
2005-05-11 14:46:12 +00:00
|
|
|
*timer = (TimerDef)start_time.tv_sec * 1000000 + (TimerDef)start_time.tv_usec + us;
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Checks if a timer has been expired or not. In Kernel-mode, the scheduler
|
|
|
|
* will also be triggered, if the timer has not been expired.
|
|
|
|
* @param timer - pointer to the timer to check
|
|
|
|
* @return Function returns _E_TIMEOUT when the timer has been expired,
|
|
|
|
* otherwise _OK;
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2005-05-11 14:46:12 +00:00
|
|
|
_LOC int MiscCheckTimer( TimerDef *timer )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
struct timeval current_time;
|
|
|
|
|
|
|
|
gettimeofday(¤t_time, NULL);
|
|
|
|
|
2005-05-11 14:46:12 +00:00
|
|
|
if ((TimerDef)current_time.tv_sec * 1000000 + (TimerDef)current_time.tv_usec > *timer) {
|
2003-09-23 07:10:53 +00:00
|
|
|
return _E_TIMEOUT;
|
|
|
|
} else {
|
2003-10-22 19:20:31 +00:00
|
|
|
/*#else
|
|
|
|
sched_yield();
|
|
|
|
*/
|
2003-09-23 07:10:53 +00:00
|
|
|
return _OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Checks the function pointers
|
|
|
|
* @param ps - pointer to the scanner data structure.
|
|
|
|
* @return Function returns _TRUE if everything is okay and _FALSE if a NULL
|
|
|
|
* ptr has been detected.
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
|
|
|
#ifdef DEBUG
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC Bool MiscAllPointersSet( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
2013-02-13 13:29:52 +00:00
|
|
|
int i;
|
|
|
|
unsigned long *ptr;
|
2003-09-23 07:10:53 +00:00
|
|
|
|
2013-02-13 13:29:52 +00:00
|
|
|
for( ptr = (unsigned long *)&ps->OpenScanPath, i = 1;
|
|
|
|
ptr <= (unsigned long *)&ps->ReadOneImageLine; ptr++, i++ ) {
|
2003-09-23 07:10:53 +00:00
|
|
|
|
|
|
|
if( NULL == (pVoid)*ptr ) {
|
2013-02-13 13:29:52 +00:00
|
|
|
DBG( DBG_HIGH, "Function pointer not set (pos = %d) !\n", i );
|
2003-09-23 07:10:53 +00:00
|
|
|
return _FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return _TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** registers this driver to use port "portAddr" (KERNEL-Mode only)
|
2003-10-29 16:53:18 +00:00
|
|
|
* @param ps - pointer to the scanner data structure.
|
|
|
|
* @param portAddr -
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC int MiscRegisterPort( pScanData ps, int portAddr )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
2003-10-22 19:20:31 +00:00
|
|
|
DBG( DBG_LOW, "Assigning port handle %i\n", portAddr );
|
|
|
|
ps->pardev = portAddr;
|
2003-09-23 07:10:53 +00:00
|
|
|
|
|
|
|
portIsClaimed[ps->devno] = 0;
|
|
|
|
return _OK;
|
|
|
|
}
|
|
|
|
|
2017-05-27 05:27:22 +00:00
|
|
|
/** unregisters the port from driver
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC void MiscUnregisterPort( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
2003-10-22 19:20:31 +00:00
|
|
|
sanei_pp_close( ps->pardev );
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Try to claim the port
|
|
|
|
* @param ps - pointer to the scanner data structure.
|
|
|
|
* @return Function returns _OK on success, otherwise _E_BUSY.
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC int MiscClaimPort( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
if( 0 == portIsClaimed[ps->devno] ) {
|
|
|
|
|
|
|
|
DBG( DBG_HIGH, "Try to claim the parport\n" );
|
2003-10-29 16:53:18 +00:00
|
|
|
if( SANE_STATUS_GOOD != sanei_pp_claim( ps->pardev )) {
|
|
|
|
return _E_BUSY;
|
|
|
|
}
|
|
|
|
}
|
2003-09-23 07:10:53 +00:00
|
|
|
portIsClaimed[ps->devno]++;
|
|
|
|
return _OK;
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Release previously claimed port
|
|
|
|
* @param ps - pointer to the scanner data structure
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC void MiscReleasePort( pScanData ps )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
if( portIsClaimed[ps->devno] > 0 ) {
|
|
|
|
portIsClaimed[ps->devno]--;
|
|
|
|
|
|
|
|
if( 0 == portIsClaimed[ps->devno] ) {
|
|
|
|
DBG( DBG_HIGH, "Releasing parport\n" );
|
2003-10-22 19:20:31 +00:00
|
|
|
sanei_pp_release( ps->pardev );
|
|
|
|
}
|
2003-09-23 07:10:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** Get random number
|
|
|
|
* @return a random number.
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC Long MiscLongRand( void )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
randomnum = miscNextLongRand( randomnum );
|
|
|
|
|
|
|
|
return randomnum;
|
|
|
|
}
|
|
|
|
|
2003-10-29 16:53:18 +00:00
|
|
|
/** According to the id, the function returns a pointer to the model name
|
|
|
|
* @param id - internal id of the various scanner models.
|
|
|
|
* @return a pointer to the model-string.
|
2003-09-23 07:10:53 +00:00
|
|
|
*/
|
2003-09-24 14:08:01 +00:00
|
|
|
_LOC const char *MiscGetModelName( UShort id )
|
2003-09-23 07:10:53 +00:00
|
|
|
{
|
|
|
|
DBG( DBG_HIGH, "MiscGetModelName - id = %i\n", id );
|
|
|
|
|
|
|
|
if( MODEL_OP_PT12 < id )
|
|
|
|
return ModelStr[0];
|
|
|
|
|
|
|
|
return ModelStr[id];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* END PLUSTEK-PP_MISC.C ....................................................*/
|