Table of Contents

Advertisement

Quick Links

SocketScan
SDK User's Guide
&
ScanAPI: Scanning Application Program Interface
Document # 6410-00147 K
April 8, 2010

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SocketScan SDK and is the answer not in the manual?

Questions and answers

Summary of Contents for Socket SocketScan SDK

  • Page 1 ™ SocketScan SDK User’s Guide & ScanAPI: Scanning Application Program Interface Document # 6410-00147 K April 8, 2010...
  • Page 2 Bluetooth word mark and logo are registered trademarks of the Bluetooth SIG, Inc., USA, and any use by Socket Mobile is under license. All other brand and product names are trademarks of their respective holders. Reproduction of the contents of this manual without the permission of Socket Mobile is expressly prohibited.
  • Page 3: Revision History

    Revision History Revision Date Author Comments 1.00 10/26/1999 G. Cuevas, L. Ott Genesis. Updated registry section; added correct doc number; cleaned up typos, 1.01 11/01/1999 G. Cuevas, J. Houston etc. 1.02 11/02/1999 G. Cuevas, L. Ott Additional corrections. 1.03 11/04/1999 G.
  • Page 4: Table Of Contents

    Table of Contents Introduction ............................. 7 SDK Quick Start Guide ......................8 Revision Notes..........................9 Windows CE..........................9 Windows Desktop/Notebook ....................9 Using ScanAPI..........................11 SDK Initialization/De-initialization ..................11 Device Control........................11 Scanner Data Access......................11 Miscellaneous Utility......................11 Cordless Scanner Specific Functions ..................12 RFID Specific Functions ......................
  • Page 5 ScanRequestDataEvents() ..................... 29 ScanTrigger() ......................... 31 ScanAbort()..........................33 8.10 ScanGetData() ........................34 8.11 ScanSetGoodReadSound() ....................36 8.12 ScanDeinit() ........................... 37 8.13 ScanErrToText() ........................38 8.14 ScanParamSend()........................39 8.15 ScanParamRequest() ......................41 8.16 ScanSendCommand() ......................42 8.17 ScanCommandFeature() ....................... 43 8.18 ScanParamSendEx()....................... 45 8.19 ScanParamRequestEx()......................
  • Page 6 CHS Commands ........................66 9.5.1 Set Security Mode ..................... 66 9.5.2 Set Friendly Name ..................... 66 9.5.3 Set PIN Code ......................66 CHS Control commands ......................67 9.6.1 Set Indicators ......................67 9.6.2 Battery Charge State Inquiry ..................67 9.6.3 Battery Charge State Response ................
  • Page 7: Introduction

    “scan” refers to a bar code scan, RFID read or magnetic stripe read, unless otherwise noted. The Socket ScanAPI is a set of Windows CE and Win32 Desktop DLLs that offer access to the complete line of data collection products from Socket: •...
  • Page 8: Sdk Quick Start Guide

    5) Read Chapter 4 and the Targeted Scanner Deployment document to understand DLL and registry requirements. You should now be ready to add support for any Socket data collection products to your Windows application. If needed, please refer to Section 12.2 for a sample of how install your application on the target device.
  • Page 9: Revision Notes

    WARNING: Do NOT attempt to change any communication protocol settings or scan any “Set All Defaults” programming bar code with any Socket data collection product unless instructed to do so by Socket Technical Support.
  • Page 10 • Cordless Hand Scanner (CHS) Series 7 • Cordless Ring Scanner (CRS) Series 9 Full hot-swapping support is present for Windows 7, Vista, and XP. Note: Use of a CompactFlash card in a Windows 7, Vista or XP based computer requires a CF-to-PC Card adapter, available separately at: http://ww1.socketmobile.com/products/handheld-computers/accessories-hc.aspx?cat=Plug-Ins Starting from Desktop Release v3.7, SocketScan application support for Win 95, 98, Me and NT...
  • Page 11: Using Scanapi

    3.0 U SING The ScanAPI SDK offers API calls that are grouped into the following categories: The ScanAPI.DLL file is written in C++. This file can only be used in development environments that can directly call Win32 DLLs and process Windows messages. At this time, there is no support for Java. SDK I NITIALIZATION INITIALIZATION...
  • Page 12: Cordless Scanner Specific Functions

    • IsScannerConnectedEx() checks whether a specified scanner is connected ORDLESS CANNER PECIFIC UNCTIONS • ScanEnableCHS() activates the Cordless Scanner (CS) and loads its driver • ScanDisableCHS() deactivates the Cordless Scanner and unloads its driver • ScanSendCmdtoCHS() sends the Cordless Scanner configuration commands RFID S PECIFIC UNCTIONS...
  • Page 13: Setting Up The Target Device

    CF Scan Card) on the target CE device. Also uninstall any legacy versions of the Socket Wand Scanner programs from the target device, if present. Installing SocketScan will install all the DLLs and set up the proper registry entries, but it should not be used for installing the final user’s application program, because it can confuse the user with...
  • Page 14: Writing Your Application

    5.0 W RITING PPLICATION Applications that use ScanAPI must include the ScanAPI.h file in their project, and must either link to the appropriate ScanAPI.lib file supplied with the SDK or manually load ScanAPI.dll and use GetProcAddress() to access the functions. ScanAPI.h is located in the “inc” directory of the installed SDK. ScanAPI.lib is provided for each supported processor and OS version in the “lib”...
  • Page 15: Preview Dll

    temporarily ignore all scanned data, if desired, by supplying NULL as the hWnd argument to ScanRequestDataEvents(). When your application closes down, it should call ScanDeinit(). This function will close all open scanning devices, making it unnecessary for you to call ScanCloseDevice() when you shut down. All ScanAPI function calls return SR_SUCCESS if the function succeeds.
  • Page 16 DWORD value that can be 0 to disable Permanent Pair or 1 to enable it. If a Socket Bluetooth barcode scanner connects to a host computer running ScanAPI that is configured with Permanent Pair enabled, the device will then be permanently paired to this host. Each time the device is powered on, it will try to reconnect to this host.
  • Page 17: Soft Triggering

    6.0 S RIGGERING Soft triggering differs from local and remote triggering options. It is a means to trigger a scan on a scanner through software; however, this feature is not applicable to all scanners. It is supported in the CFSC, SDSC, CHS, CRS and CF RFID Reader Card.
  • Page 18: Scanapi Type Reference

    The following excerpts are taken from ScanAPI.h. The brief explanations that follow the excerpts further document the purpose of the identifiers. Refer to the RFID SDK documentation for RFID-specific information. // Types of Socket Scanner products enum SCANNER_TYPE {SCANNER_NONE = 0,...
  • Page 19 // API return codes enum SCAN_RESULT {SR_SUCCESS = 0, SR_INVALID_WMINSERTION, SR_INVALID_WMREMOVAL, SR_PLUG_THREAD_FAILURE, SR_DEVICE_THREAD_FAILURE, SR_INVALID_SCANNER_HANDLE, SR_OPEN_FAILURE, SR_INVALID_WMSCANNERDATA, SR_NO_DATA, SR_BUFFER_TOO_SMALL, SR_SCANNER_NOT_OPEN, SR_INVALID_SOUND_TYPE, SR_WAVFILE_NOT_FOUND, SR_MEMORY_FAILURE, SR_INVALID_ERR, SR_TOO_MANY_USERS, SR_NOT_INITIALIZED, SR_DEVICE_FAILURE, SR_INTERNAL_FAILURE, SR_INVALID_STRUCTURE, SR_SCANNER_REMOVED, SR_UNSUPPORTED_FEATURE, SR_INVALID_WMCHSSTATUS, SR_NOT_CHS_DEVICE, SR_WAIT_TIMEOUT_ERROR, SR_SYMBOLOGY_NOT_SUPPORTED, SR_SCANNER_BUSY, SR_HOTSWAP_ERROR, (Windows XP ONLY) SR_SCANNER_REMOVED, SR_INVALID_WMCHSSTATUS, SR_NOT_CHS_DEVICE, SR_WAIT_TIMEOUT_ERROR,...
  • Page 20 Win32 Desktop platform. Please report to Socket Technical Support at http://support.socketmobile.com/ if you consistently receive one of these errors for no good reason – you may be trying to use the API in ways we did not envision when we created it.
  • Page 21: Scanapi Function Reference

    8.0 S API F UNCTION EFERENCE This section provides complete documentation of the functions present in the ScanAPI DLL. Refer to the RFID SDK documentation for information about the RFID-specific functions. HECK ERSION Prototype: SCAN_RESULT ScanCheckVersion(DWORD dwVersionAPP,DWORD* pdwVersionAPI,LPCTSTR lpszApplicationName); Purpose: Performs a version check between the actual version of ScanAPI installed on the host computer and the version of ScanAPI the application has been linked to.
  • Page 22: Scaninit()

    Socket data collection device is removed from the host device. Notes: Upon success, the ScanAPI DLL is initialized. If a Socket data collection device is present when this function is called, the client application will immediately receive the message specified by the wmInsertion argument.
  • Page 23 In this release of the SDK, only one client may use the ScanAPI DLL. Your application program will generally get this error if ScktScan.exe is running. You need to close the program before starting your application. SR_INVALID_WMINSERTION The specified wmInsertion message is not within the valid WM_USER range. SR_INVALID_WMREMOVAL The specified wmRemoval message is not within the valid WM_USER range.
  • Page 24: Scanopendevice()

    EVICE Prototype: SCAN_RESULT ScanOpenDevice(HANDLE hScanner); Purpose: Opens the scanner port and initializes the scanner for use. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called. If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner disabled).
  • Page 25: Scanclosedevice()

    LOSE EVICE Prototype: SCAN_RESULT ScanCloseDevice (HANDLE hScanner); Purpose: Closes the scanner port and releases resources. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_REMOVAL message specified when ScanInit() was called. If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner disabled) .
  • Page 26: Scangetdevinfo()

    Prototype: SCAN_RESULT ScanGetDevInfo(HANDLE hScanner, LPSCANDEVINFO lpScanDevInfo); Purpose: Get the general capabilities and identification of the requested device. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called. If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner disabled) .
  • Page 27 SR_INVALID_STRUCTURE The lpScanDevInfo argument was NULL or the StructSize field was not set with the sizeof(SCANDEVINFO) value when the function call was made. SR_DEVICE_FAILURE An internal error occurred communicating with the scanning device (perhaps the device was removed during the function call.) The client application will probably need to be re-started, and possibly the host CE device or Win32 Desktop system reset (after first removing the scanning device from the host.) April 8, 2010...
  • Page 28: Scangetstatus()

    The scanner is present but ScanOpenDevice() has not been called. SR_NO_DATA There is no data available from the scanning device. SR_SCANNER_REMOVED The scanner has been removed from the socket. A call to ScanCloseDevice() should be made. April 8, 2010 Page 28 Document#: 6410-00147 K...
  • Page 29: Scanrequestdataevents()

    EQUEST VENTS Prototype: SCAN_RESULT ScanRequestDataEvents(HANDLE hScanner, HWND hWnd, UINT wmScannerData); Purpose: Instruct ScanAPI to send a message to the client application when the user has scanned data. Arguments: [in] hScanner is the value received by the client application in the lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 30 Returns: SR_SUCCESS The operation completed successfully. SR_NOT_INITIALIZED A successful call to ScanInit() must be made first. SR_INVALID_SCANNER_HANDLE The hScanner argument is not a valid scanner handle. SR_INVALID_WMSCANNERDATA The wmScannerData argument is not within the valid WM_USER range. April 8, 2010 Page 30 Document#: 6410-00147 K Revision 2.28...
  • Page 31: Scantrigger()

    RIGGER Prototype: SCAN_RESULT ScanTrigger(HANDLE hScanner); Purpose: Trigger a scan on a scanning device. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called. If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner disabled) .
  • Page 32 SR_DEVICE_FAILURE An internal error occurred communicating with the scanning device (perhaps the device was removed during the function call.) The client application will probably need to be re-started, and possibly the host CE device reset or the Win32 Desktop system restarted (after first removing the scanning device from the host.) April 8, 2010 Page 32...
  • Page 33: Scanabort()

    BORT Prototype: SCAN_RESULT ScanAbort(HANDLE hScanner); Purpose: Terminate a scan-in-progress on a scanning device. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called. If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner disabled) .
  • Page 34: Scangetdata()

    8.10 S Prototype: SCAN_RESULT ScanGetData(HANDLE hScanner, TCHAR * lpBuff, LPINT BufSize); Purpose: Returns scanned data after a successful read operation on the scanner device. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 35 “01:E007000001476301” Note: This is a legacy function for compatibility with SocketScan and it’s recommended that the specific RFID functions be used instead of ScanTrigger() and ScanGetData(). Do not call this function when issuing any specific RFID function (i.e. ScanRFIDSelectTag(), ScanRFIDReadTag(), etc.). Returns: SR_SUCCESS The operation completed successfully.
  • Page 36: Scansetgoodreadsound()

    8.11 S OUND Prototype: SCAN_RESULT ScanSetGoodReadSound(HANDLE hScanner, GRS_TYPE Sound, LPCTSTR lpWavFile); Purpose: Tells the ScanAPI DLL to be silent, call MessageBeep(0), or play a .wav file when the user successfully scans data with the specified device. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 37: Scandeinit()

    Under Windows NT, all PC Card devices must be present at boot-time, and can never be safely removed without re-booting. The exception is if you have added third-party Card and Socket Services to your NT system. In this case, the scanning device must be present before the ScanInit() call, but can be safely removed AFTER ScanDeinit() is called.
  • Page 38: Scanerrtotext()

    8.13 S Prototype: SCAN_RESULT ScanErrToText(SCAN_RESULT Err, LPTSTR lpBuff, LPINT BufSize); Purpose: Converts error code to text. Arguments: [in] Err is the error generated by a ScanAPI function call that you wish to have translated to text. [out] lpBuff is a buffer allocated by the client program to receive the text. Note the result is returned in UNICODE on CE devices.
  • Page 39: Scanparamsend()

    8.14 S ARAM Prototype: SCANAPI_API SCAN_RESULT ScanParamSend(HANDLE hScanner, PBYTE paramIn, UINT paramInLen, PBYTE paramVal, UINT paramValLen); Purpose: Modifies one or more parameters of the scanner hardware for WinCE only. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 40 ERROR_NOT_SUPPORTED The scanner in use does not support the ScanParamSend function. ERROR_NOT_READY A problem occurred sending the command(s) to the scanner. ERROR_OUTOFMEMORY The function was not able to allocated memory needed to complete the request. April 8, 2010 Page 40 Document#: 6410-00147 K Revision 2.28...
  • Page 41: Scanparamrequest()

    8.15 S ARAM EQUEST Prototype: SCAN_RESULT ScanParamRequest(HANDLE hScanner, PBYTE paramIn, UINT paramInLen, PBYTE paramOut, PUINT paramOutLen); Purpose: Retrieves the current setting of one parameter of the scanner hardware for WinCE only Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 42: Scansendcommand()

    8.16 S OMMAND Prototype: SCANAPI_API SCAN_RESULT ScanSendCommand(HANDLE hScanner, IN OUT LPTSTR pCmd_CmdResponse, IN OUT int* piLength); Purpose: Sends a command to the CF Scan Card hardware and receives the CF Scan Card response for WinCE only. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 43: Scancommandfeature()

    This API enables a feature of ScanAPI or the scanner. It has been originally created to handle the RFID AFI feature. The RFID AFI feature is supported only for the tag ISO 15693 and with the Socket hardware that has a firmware version 3005 or higher. The AFI feature is composed by a set of three functions.
  • Page 44 the CMD_ID is not unknown, the dwRfidTagIdLength is bigger than MAX_TAG_ID_SIZE (10 bytes) SR_INVALID_STRUCTURE The operation could not be completed as the size of the CommandFeature_t structure doesn’t correspond to the size specified in the dwStructSize of the same structure. SR_UNSUPPORTED_FEATURE The scanner in use does not support the ScanCommandFeature function.
  • Page 45: Scanparamsendex()

    8.18 S ARAM Prototype: SCANAPI_API SCAN_RESULT ScanParamSendEx(HANDLE hScanner, PUINT16 paramIn, UINT paramInLen, PBYTE paramVal, UINT paramValLen); Purpose: Modifies one or more parameters of the scanner hardware. This API is slightly different from ScanParamSend() in that the ‘paramIn’ is now of type PUINT16. This is for opcodes that are of two byte lengths (i.e.
  • Page 46 SR_SUCCESS The operation completed successfully. SR_UNSUPPORTED_FEATURE The scanner in use does not support the ScanParamSendEx function. SR_DEVICE_FAILURE A problem occurred sending the command(s) to the scanner. April 8, 2010 Page 46 Document#: 6410-00147 K Revision 2.28...
  • Page 47: Scanparamrequestex()

    8.19 S ARAM EQUEST Prototype: SCANAPI_API SCAN_RESULT ScanParamRequestEx(HANDLE hScanner, PUINT16 paramIn, UINT paramInLen, PBYTE paramOut, PUINT paramOutLen); Purpose: Retrieves the current setting of one parameter of the scanner hardware. This API is slightly different from ScanParamRequest() in that the ‘paramIn’ is now of type PUINT16. This is for opcodes that are of two byte lengths (i.e.
  • Page 48: Isscannerconnected()

    8.20 I CANNER ONNECTED Prototype: SCANAPI_API BOOL IsScannerConnected (void) Purpose: Checks if the scanner is connected and is open for communication. Arguments: No arguments Returns: TRUE The scanner is connected and is open for communications FALSE If scanner has an invalid handle or is not OPEN. 8.21 I CANNER ONNECTED...
  • Page 49: Scanenabledisablesymbology()

    SCANAPI_API SCAN_RESULT ScanEnableDisableSymbology (HANDLE hScanner, INT nSymID, BOOL flag); Purpose: Enables or Disables symbologies for all types of Socket bar code scanner devices. Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 50: Scanreadsymbologyconfig()

    SCANAPI_API SCAN_RESULT ScanReadSymbologyConfig (HANDLE hScanner, int cfgType, int nSymbol, PVOID pvSym); Purpose: Reads symbology configuration for all types of Socket bar code scanner devices Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 51: Scanwritesymbologyconfig()

    SCANAPI_API SCAN_RESULT ScanWriteSymbologyConfig (HANDLE hScanner, int nSymbol, PVOID pvSym); Purpose: Writes symbology configuration for all types of Socket bar code scanner devices Arguments: [in] hScanner is the value received by the client application in lParam of the WM_INSERTION message specified when ScanInit() was called.
  • Page 52: Scangetscannerregkey ()

    Returns: SR_SUCCESS The operation completed successfully SR_INVALID_ERR The scanner was already initialized SR_NOT_INITIALIZED The Scanning library is not initialized SR_INVALID_SCANNER_HANDLE Scanner handle is not valid SR_SCANNER_NOT_OPEN Scanner is not open 8.26 S CANNER Prototype: SCANAPI_API SCAN_RESULT ScanGetScannerRegKey(HANDLE hScanner, BOOL activeKey, LPTSTR lpBuff, LPINT BufSize);...
  • Page 53: Scanopenscannerproperty

    8.27 S CANNER ROPERTY Prototype: SCANAPI_API SCAN_RESULT ScanOpenScannerProperty(SCANNER_TYPE ScannerType,HANDLE* phProperty); Purpose: This API opens access to the properties of a scanner. Most of the time the properties of a scanner is stored in the registry. This API is the preferred way to access to the properties of a scanner instead of accessing directly the registry.
  • Page 54: Scansetscannerproperty

    Purpose: This API can be used to retrieve a value of a property identified by its property identifier. The value type retrieved depends on the property. Arguments: [in]hProperty is the handle to access to the properties [in]dwPropertyID is the property identifier the value needs to be retrieved. [out]lpValue is a valid pointer to the property value to retrieve.
  • Page 55 SCAN_PROP_ID_RING_UNIT_BUILD_ID Purpose: Contains the ring unit build version. Value type: DWORD. Operation available: Read Only. SCAN_PROP_ID_PERMANENT_PAIR Purpose: Flag to activate the permanent pair. Value type: DWORD. Operation available: Read Write and Updateable. SCAN_PROP_ID_BATTERY_LEVEL Purpose: Contains the battery level. Value type: DWORD. Operation available: Read Only.
  • Page 56 SCAN_PROP_ID_TRIGGER_BUTTON Purpose: contains which scanner buttons triggers the scan. Value type: DWORD. Operation available: Read Write and Updateable. SCAN_PROP_ID_PRODUCT_TYPE Purpose: contains the product type. Value type: DWORD. Operation available: Read Only. SCAN_PROP_ID_WRIST_UNIT_BUILD_ID Purpose: contains the wrist unit build version. Value type: DWORD. Operation available: Read Only.
  • Page 57 SCAN_PROP_ID_BEEP_ENABLE Purpose: Flag to activate or desactivate the good read beep. Value type: DWORD. Operation available: Read Write and Updateable. SCAN_PROP_ID_SUPPORTED_CONFIG Purpose: Bits field indicating what advanced features the scanner supports. Value type: DWORD. Operation available: Read Only. April 8, 2010 Page 57 Document#: 6410-00147 K Revision 2.28...
  • Page 58: Sample Symbology Config Code

    8.32 S AMPLE SYMBOLOGY CONFIG CODE 8.32.1 Sample Code to Enable or Disable CODE39 symbology: result = ScanEnableDisableSymbology (hScanner, SYMB_CODE39, TRUE); // Enable result = ScanEnableDisableSymbology (hScanner, SYMB_CODE39, FALSE); // Disable if (result != SR_SUCCESS) return FALSE; return TRUE 8.32.2 Sample code for Read configuration: if (SYMBOL_RANGE_FLAG[SYMB_CODE39]) flagsRange.dwStructSize = sizeof( ScannerSymFlagsRange_t );...
  • Page 59: 8.32.3 Sample Code To Enable Or Disable Code39 Symbology

    TRUE, // Code 128 TRUE, // Code 39 TRUE, // Code 49 TRUE, // CODE 93 FALSE, // Code 39 FULL ASCII FALSE, // Tropotic Code39 FALSE, // UPC - A FALSE, // UPC - E FALSE, // UPC - E0 FALSE, // UPC - E1 FALSE, // EAN - 8 FALSE, // EAN - 13...
  • Page 60: Cordless Scanner (Cs) Specifics

    CANNER PECIFICS The Cordless Scanners integrate Socket barcode scanning capabilities into a cordless solution. The user can now program the same functionality provided in our SDK through a Bluetooth connection. Along with these changes new APIs are required to configure and manage the Bluetooth connection as well as the scanner.
  • Page 61: Scanenablechs()

    CHS() NABLE Prototype: SCANAPI_API SCAN_RESULT ScanEnableCHS(HWND hWnd, UINT wmCHSStatus); Purpose: This function activates the Cordless Scanner and loads its driver. Arguments: [in] hWnd is the handle of the CS status window – receives CS notification messages [in] wmCHSStatus is the user status of the CS –...
  • Page 62: Scandisablechs()

    CHS() ISABLE Prototype: Windows CE: SCANAPI_API SCAN_RESULT ScanDisableCHS(HANDLE hScanner); Windows XP: SCANAPI_API SCAN_RESULT ScanDisableCHS(HWND hWnd, HANDLE hScanner); Purpose: This function will disable CHS and unload the CHS driver Arguments: [in] hScanner is the scanner id used to disable the CHS Notes: This function is only relevant to the CHS.
  • Page 63: Scansendcmdtochs()

    CHS() MDTO Prototype: SCANAPI_API SCAN_RESULT ScanSendCmdtoCHS(HANDLE hScanner, PBYTE paramIn, UINT paramInLen, DWORD Timeout) Purpose: Send Configuration commands to CHS – Battery status inquiry, Self test inquiry (CHS version information), Friendly Name inquiry, Set Friendly Name, Set Security (PIN, Authentication), Delete Pairing &...
  • Page 64 SR_NOT_INITIALIZED Library is not initialized SR_INVALID_SCANNER_HANDLE Invalid Scanner handle SR_DEVICE_FAILURE IO Control call FAILS SR_WAIT_TIMEOUT_ERROR CHS configuration response timeout has occurred April 8, 2010 Page 64 Document#: 6410-00147 K Revision 2.28...
  • Page 65: Bluetooth Connection Status

    LUETOOTH ONNECTION TATUS When the CHS is configured, the Bluetooth stack needs to be enabled. Along with the appropriate registry settings – refer to the section on registry configuration, the wParam and lParam values are used to communicate the state of the stack. To enable the CHS the “ScanEnableCHS(HWND hWnd, UINT wmCHSStatus)”...
  • Page 66: Chs Commands

    CHS C OMMANDS These tables show the various codes that can be sent to configure the CHS via the SendCmdToCHS() API. 9.5.1 Set Security Mode Set Security Mode Field Name Format Size Description Opcode 0x00 1 Byte Set Security mode Payload 1 Byte Bluetooth security mode...
  • Page 67: Chs Control Commands

    CHS C ONTROL COMMANDS 9.6.1 Set Indicators Set Indicators Field Name Format Size Description Opcode 0x06 1 Byte Light LED and or Beep Payload 1 Byte indicator to activate: 0x00 = Select None 0x01 = Beep 0x02 = Flash Green LED 0x03 = Beep and Flash Green 9.6.2 Battery Charge State Inquiry...
  • Page 68: Friendly Name Response

    9.6.5 Friendly Name Response Friendly Name Response Field Name Format Size Description Response Variable 1 to 248 character string is updated in registry entry “FriendlyName” April 8, 2010 Page 68 Document#: 6410-00147 K Revision 2.28...
  • Page 69 HKLM,"Software\Socket Communications\CHS\1.0", " FriendlyName ", 0x00000000, CHS Scanner This key defines the friendly name of the CHS HKLM,"Software\Socket Communications\CHS\1.0", " PinCode ", 0x00000000, 31 32 33 34 This key defines the Pin code to be set in the CHS HKLM,"Software\Socket Communications\CHS\1.0",” PowerSave ", 0x00010001, 0x00...
  • Page 70 This key defines the Auto-power off feature in the CHS HKLM,"Software\Socket Communications\CHS\1.0", "TriggerMode",0x00010001, 0x00 This key sets the trigger mode. Local scanning is for short distances to the PDA; whereas, remote scanning when the PDA connection is further or more unreliable.
  • Page 71: Rfid Reader

    10.0 RFID R EADER The Socket CF RFID Reader Card allows the reading and writing of numerous HF RFID tags. The SDK gives the programmer full control over the RFID Reader and tag functions. The CF RFID Reader Card can also respond to standard ScanAPI functions for triggering and retrieving scanned data.
  • Page 72 11.0 M (WIN CE ONLY) ULTI CANNER UPPORT The following describes the changes to SocketScan to handle the CF RFID Reader-Scan Card. The CF RFID Reader-Scan Card is really two scanners in one: RFID + CFSC. This version treats the CF RFID Reader-Scan Card as two individual scanning devices and therefore extends beyond just the CF RFID Reader-Scan Card to allow other scanners to coexist.
  • Page 73 Set to 1 to disable the insertion sound. If the entry is missing or set to 0, SocketScan will beep when an insertion message is received for this device. (Used to keep SocketScan from beeping twice when the RFID-Scan card is inserted). [HKEY_LOCAL_MACHINE\Drivers\PCMCIA\<YOUR PNP ID>\Scanner 2] "DisablePlugSnd"=dword:00000001 DesiredHandle To implement the handle numbers, just add the "DesiredHandle"...
  • Page 74 12.0 U SING OCKET EYBOARD EDGE If your scanning application is very simple, or your development language is not able to call a DLL, you may find that using the SocketScan keyboard wedge software (ScktScan.exe) will fill your needs. SocketScan simply runs in the background monitoring scanning devices and, when data is scanned, it is sent to the application that currently has the keyboard focus.
  • Page 75 13.0 S (WINCE ONLY) OCKET RIGGER PPLICATIONS SocketScan now supports multiple scanners as well as a number of scan trigger options. This is a short description of those scan trigger options. The following programs can be used to trigger a scanning device: SocketScan Trigger Select Trigger Scan...
  • Page 76 (using SDK) * Note: Socket does not recommend using SocketScan or Trigger RFID to do a tag read while using RFID Demo. The data may not appear as expected due to the different options that can be enabled in the Scanner Settings control panel applet.
  • Page 77 13.2 C HANGING THE CTIVE CANNER Support for a windows message that changes the active scanner (WM_SELECT_SCANNER) has been implemented. This message allows the caller to set the active SocketScan scanner in one of three ways. The format is: Select the next scanner (wraps around after the last scanner). This only selects scanners with software-only triggers: SendMessage(socketScanWnd, WM_SELECT_SCANNER, 0, 0);...
  • Page 78 RIVER AN DLL DriverMan is a Windows CE device driver created by Socket to provide services and functionality for managing one or more drivers associated with an expansion card. DriverMan exists as a dynamically loaded library (DLL) named DriverMan.dll. DriverMan expands upon and improves the device driver model provided by the Windows CE OS.
  • Page 79 • You must add a registry entry to tell SocketScan that this DLL exists. Under the registry key HKEY_LOCAL_MACHINE\Software\Socket Communications\ScktScan\1.0, create a string value called PreviewDll, and set its value to the path and filename of the DLL you’ve created.
  • Page 80 • Route a copy of the scanned data to the serial port of the host device or to some other auxiliary data collection receiver, if desired. • You may want certain barcodes to spawn some other process on the host computer, or play a .WAV file, .AVI or .MPG file, etc.
  • Page 81 PPLICATION IN The ScanAPI .Net Compact Framework and .Net Framework Class libraries provides a simple to use interface to Socket data collection products for applications written in .Net compliant languages such as Visual Basic.Net or C#.Net. Refer to the ScanAPI .Net User’s Guide in the docs directory section of this SDK for further detail...
  • Page 82 16.0 S YMBOLOGY UPPORT BY CANNER The following table itemizes the symbologies and the bar code scanners that support them. Bar code symbology support is implemented in the scanner engine firmware. A new firmware version may revise the list of supported symbologies. This list will be revised if the engine firmware is updated on the scanner device.

Table of Contents