79
TigerJet Network Tiger560 Hardware SDK API Programming Guide TigerJet Network Inc. Phone: 408-437-7727 50 Airport Parkway Fax: 408-437-4961 San Jose, CA95110© 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.com USA Page 1 of 79 6/16/2022

tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

  • Upload
    domien

  • View
    230

  • Download
    2

Embed Size (px)

Citation preview

Page 1: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

TigerJet Network Tiger560 Hardware SDK API

Programming Guide

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 1 of 64 5/8/2023

Page 2: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

Contents1 Introduction..................................................................................................4

1.1 Basic SDK software structure.......................................................................................................................41.2 The interface between TjIpSys.DLL and applications...............................................................................51.3 The source code of TjDevDemo.EXE...........................................................................................................51.4 Requirement of using Tiger560 SDK............................................................................................................6

2 Tiger560 APIs..............................................................................................72.1 TJIPSYSCALL...............................................................................................................................................72.2 USER_TO_TJIPSYS_MSG message IDs.....................................................................................................8

2.2.1 OpenTjIpDevice function.....................................................................................................................102.2.2 TjIpProductID enum.............................................................................................................................112.2.3 CloseTjIpDevice function.....................................................................................................................132.2.4 SendTjIpVendorCommand function.....................................................................................................142.2.5 VENDOR_CMD structure....................................................................................................................152.2.6 ReadProSlicDirectReg function............................................................................................................162.2.7 WriteProSlicDirectReg function...........................................................................................................172.2.8 ReadProSlicIndirectReg function.........................................................................................................182.2.9 WriteProSlicIndirectReg function........................................................................................................192.2.10 IsTjIpDevicePlugged function..............................................................................................................202.2.11 SendVirtualKey function......................................................................................................................212.2.12 StartTjIPDevDetection function...........................................................................................................222.2.13 StopTjIPDevDetection function............................................................................................................242.2.14 HandleUsbDeviceChange function.......................................................................................................252.2.15 GetSerialNumber function....................................................................................................................262.2.16 InitDTMFTones function......................................................................................................................272.2.17 SendDTMFToneToPPG function.........................................................................................................282.2.18 SetCustomDTMFTone function...........................................................................................................292.2.19 SetCallBack function............................................................................................................................302.2.20 PTJIPSYS_CALLBACK typedef.........................................................................................................322.2.21 TJIpSysCommand enum.......................................................................................................................33

2.3 Echo cancellation (ECC) routines...............................................................................................................352.3.1 ECC_Init function.................................................................................................................................362.3.2 ECC_Close function.............................................................................................................................372.3.3 ECC_SetOption function......................................................................................................................382.3.4 ECC_ProcessSpeakerAudio function...................................................................................................392.3.5 ECC_ProcessMicrophoneAudio function.............................................................................................40

2.4 Mixer/volume control routines....................................................................................................................412.4.1 OpenTjMixer function..........................................................................................................................422.4.2 TJ_MIXER_OPEN struct.....................................................................................................................432.4.3 CloseTjMixer function..........................................................................................................................442.4.4 GetTjMixerWaveInVol function..........................................................................................................452.4.5 SetTjMixerWaveInVol function...........................................................................................................462.4.6 GetTjMixerWaveOutVol function........................................................................................................472.4.7 SetTjMixerWaveOutVol function........................................................................................................482.4.8 GetTjMixerMasterWaveOutVol function.............................................................................................492.4.9 SetTjMixerMasterWaveOutVol function.............................................................................................502.4.10 GetMicrophoneMute function..............................................................................................................512.4.11 SetMicrophoneMute function...............................................................................................................522.4.12 GetSpeakerMute function.....................................................................................................................53

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 2 of 64 5/8/2023

Page 3: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.13 SetSpeakerMute function......................................................................................................................542.4.14 GetMasterSpeakerMute function..........................................................................................................552.4.15 SetMasterSpeakerMute function...........................................................................................................562.4.16 OnMixerCtrlChange function...............................................................................................................57

2.5 USB PPG routines........................................................................................................................................582.5.1 SetUsbPPGOnHook function................................................................................................................582.5.2 SetUsbPPGOffHook function...............................................................................................................592.5.3 SetUsbPPGProslicClock function.........................................................................................................602.5.4 SetUsbPPGProslicSwitch function......................................................................................................61

3 Release note..............................................................................................623.1 Release note version 8.51.............................................................................................................................62

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 3 of 64 5/8/2023

Page 4: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

1 IntroductionTo enable the rapid development of third party VoIP applications that interface to Tiger560 based products, TigerJet Network has been putting its efforts in developing Tiger560 SDK (Software Development Kit) to support its customers. The purpose of Tiger560 SDK is to simplify the software design while providing customers with full control of Tiger560 hardware capabilities which includes register read/write, keypad scanning, phone ringing, on/off hook detection as well as DTMF tone generation.This document describes the basic software structure and APIs of Tiger560 SDK for programmers who are interested in using Tiger560 SDK to develop their own applications for Tiger560 based products.

1.1 Basic SDK software structureThe SDK software structure is divided into TjIpSys.DLL and TjDevDemo.EXE. TjIpSys.DLL is the main core of the SDK which hides all the low level complexities between USB, HID drivers and Tiger560 hardware. It provides applications (such as TjDevDemo.exe) a set of high level APIs (defined by TjIpSys.h) to program Tiger560 as shown in Figure 1.1.

The TjDevDemo.EXE is a sample application released with source code written in C++ which has various C++ classes for different Tiger560 based products. Usually customers only have to modify the code of the specific C++ class for their product if they have different keypad or extra

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 4 of 64 5/8/2023

Page 5: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

hardware. TjDevDemo.EXE has a simple GUI for user to see the product type, product ID, key input, and hook status (USB phone only), and to change/mute the speaker and microphone volume as shown in Figure 1.2.

With the source code, customers can modify TjDevDemo.EXE to whatever they like or integrate it into their existing VoIP applications.

1.2 The interface between TjIpSys.DLL and applicationsThe interface between TjIpSys.DLL and applications is defined by TjIpSys.h. However, there’s only one unique function, TjIpSysCall(int id, int param, void * ex), exported from TjIpSys.DLL, which applications can call to. With different message IDs (the 1st parameter of the function, defined by enum USER_TO_TJIPSYS_MSG in TjIpSys.h), user can consider that TjIpSys.DLL provides a set of APIs to program Tiger560.

1.3 The source code of TjDevDemo.EXEThe source code of TjDevDemo is listed as below:TjIpSys.h: This module defines the interfaces and messages between TjIpSys.dll and IP Phone Center application.TjIpApi.h: This module provides higher level functions to read/write TigerJet registers and send various generic vendor commands.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 5 of 64 5/8/2023

Page 6: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

TjIpApi.cpp: This module implements higher level functions to read/write TigerJet registers and send various generic vendor commands.Tj320Phone.h: This module defines functions for handling TigerJet 320 PCI Proslic board.Tj320Phone.cpp: This module implements functions defined in Tj320Phone.h.Tj560Phone.h: This module defines functions for handling TigerJet 560 USB Proslic board.Tj560Phone.cpp: This module implements functions defined in Tj560Phone.h.Tj560Handset.h: This module defines functions for handling TigerJet 560 USB handset board with switch control.Tj560Handset.cpp: This module implements functions defined in Tj560Handset.h.Tj560BPhone.h: This module defines functions for handling TigerJet 560B USB Proslic board.Tj560BPhone.cpp: This module implements functions defined in Tj560BPhone.h.Tj560BHandset.h: This module defines functions for handling TigerJet 560B USB handset board with switch control.Tj560BHandset.cpp: This module implements functions defined in Tj560BHandset.h.Tj560BPpg.h: This module defines functions for handling TigerJet 560B USB PPG board.Tj560BPpg.cpp: This module implements functions defined in Tj560BPpg.h.TjIpDemoDlg.h: MFC-based main dialog function definition.TjIpDemoDlg.cpp: MFC-based main dialog function implementation.TjIpDemo.h: MFC-based main application function definition.TjIpDemo.cpp: MFC-based main application function implementation.

1.4 Requirement of using Tiger560 SDKTo compile and run TjDevDemo.EXE, it requires Windows 98 (or above) with Microsoft Visual C++ 6.0 compiler installed.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 6 of 64 5/8/2023

Page 7: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2 Tiger560 APIsThe only unique function exported from TjIpSys.DLL is TjIpSysCall. With different message IDs (the 1st parameter of the function, defined by enum USER_TO_TJIPSYS_MSG in TjIpSys.h), user can ask DLL to perform various tasks. To simplify the calls to TjIpSys.DLL using the exported function TjIpSysCall with various message IDs, a set of higher level and more user-friendly APIs is implemented in the sample code TjIpApi.h and TjIpApi.cpp. This set of APIs is also what we call as Tiger560 APIs which is the main interface between applications and TjIpSys.DLL.

2.1 TJIPSYSCALLAfter loading TjIpSys.DLL, application can retrieve the address of the exported function TjIpSysCall from TjIpSys dynamic-link library (DLL). TJIPSYSCALL is defined as a type of functional pointer for function TjIpSysCall.

Syntaxtypedef BOOL (*TJIPSYSCALL)(int id, int param, void * ex)

Parametersid

[in] Messages IDs defined by USER_TO_TJIPSYS_MSG enum. Each message ID represents a specific request to DLL.

param [in] This parameter is an integer. The real meaning of it depends on the id (message ID).

ex[in/out] This parameter can be used as a 32-bit variable or a pointer to a structure. The real meaning of it depends on the id (message ID).

Return ValueThe function returns TRUE if it is successful and returns FALSE when it failed.

Example// Load TjIpSys.DLL and get the proc address of TjIpSysCallHINSTANCE hTjIpSysDll; TJIPSYSCALL pfnTjIpSysCall = NULL;

hTjIpSysDll = LoadLibrary("TjIpSys.dll"); // Load DLL

if (hTjIpSysDll) // Get proc address of TjIpSysCall pfnTjIpSysCall = (TJIPSYSCALL)GetProcAddress(hTjIpSysDll, "TjIpSysCall");

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 7 of 64 5/8/2023

Page 8: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2 USER_TO_TJIPSYS_MSG message IDsThere are various messages can be sent to TjIpSys.DLL via the exported function TjIpSysCall. Each message is defined in USER_TO_TJIPSYS_MSG enum and can be used to request DLL to perform a specific task such as TigerJet device driver open/close, TigerJet registers read/write and so on.

Syntaxenum USER_TO_TJIPSYS_MSG {TJIP_SYS_OPEN, // Open TigerJet device driverTJIP_SYS_CLOSE, // Close TigerJet device driverTJIP_TJ560VENDOR_COMMAND, // Send TigerJet 560 vendor commandTJIP_READ_TJ560PROSLIC_DIRECT_REG, // Read Proslic direct reg from Tj560 TJIP_WRITE_TJ560PROSLIC_DIRECT_REG, // Write Proslic direct reg from Tj560TJIP_READ_TJ560PROSLIC_INDIRECT_REG, // Read Proslic indirect reg from Tj560TJIP_WRITE_TJ560PROSLIC_INDIRECT_REG, // Write Proslic indirect reg from Tj560TJIP_SCAN_TJ320PROSLIC_KEY, // Scan the TigerJet 320 PCI Proslic key inputTJIP_CHECK_IS_TJ560DEVICE_PLUGGED, // Check if TigerJet560 device is plugged inTJIP_PC2PC, // Launch PC2PC internet callTJIP_PC2PHONE, // Launch PC2PHONE internet call TJIP_LAUNCH_EXPLORER, // Launch internet explorerTJIP_CHECK_IS_NM301_INSTALLED, // Check if Netmeeting is installedTJIP_INSTALL_NM301, // Install Netmeeting from program groupTJIP_SEND_VIRTUAL_KEY, // Send virtual key to focused desktop appTJIP_CLOSE_PC2PC, // Close PC2PC internet callTJIP_START_TJIP_DEV_DETECT, // Start auto-detection of TjIP devicesTJIP_STOP_TJIP_DEV_DETECT, // Stop auto-detection of TjIP devicesTJIP_HANDLE_DEVICE_CHANGE, // Handle USB device changesTJIP_GET_SERIAL_NUMBER, // Get serial number of the deviceTJIP_INIT_DTMF_TO_PPG, // Initialize DTMF tones used by USB PPGTJIP_SEND_DTMF_TO_PPG, // Send DTMF tone to USB PPGTJIP_SET_USB_PPG_ON_HOOK, // Set USB PPG on hookTJIP_SET_USB_PPG_OFF_HOOK, // Set USB PPG off hookTJIP_SET_USB_PPG_PROSLIC_CLOCK, // Set USB PPG + Proslic clockTJIP_SET_USB_PPG_PROSLIC_SWITCH, // Set USB PPG + Proslic switchTJIP_ECC_INIT, // Initialize ECC in either microphone or speaker

// pathTJIP_ECC_CLOSE, // Close ECCTJIP_ECC_SET_OPTION, // Set ECC optionsTJIP_ECC_PROCESS_SPEAKER_AUDIO, // Send speaker audio (source of echo) to ECCTJIP_ECC_PROCESS_MICROPHONE_AUDIO, // Send Microphone audio to ECC, then

// return the echo cancelled audio back from ECC

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 8 of 64 5/8/2023

Page 9: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

TJIP_OPEN_MIXER, // Open mixer for Tj560 USB audio for volume // control

TJIP_CLOSE_MIXER, // Close mixer for Tj560 USB audio for volume //control

TJIP_GET_WAVEIN_VOL, // Get wavein volumeTJIP_SET_WAVEIN_VOL, // Set wavein volumeTJIP_GET_WAVEOUT_VOL, // Get waveout volumeTJIP_SET_WAVEOUT_VOL, // Set waveout volumeTJIP_GET_MASTER_WAVEOUT_VOL, // Get master waveout volumeTJIP_SET_MASTER_WAVEOUT_VOL, // Set master waveout volumeTJIP_GET_MICROPHONE_MUTE, // Get microphone mute stateTJIP_SET_MICROPHONE_MUTE, // Set microphone mute on/offTJIP_GET_SPEAKER_MUTE, // Get speaker mute stateTJIP_SET_SPEAKER_MUTE, // Set speaker mute on/offTJIP_GET_MASTER_SPEAKER_MUTE, // Get master speaker mute stateTJIP_SET_MASTER_SPEAKER_MUTE, // Set master speaker mute on/offTJIP_ON_MIXER_CTRL_CHANGE, // Function to handle mixer controlTJIP_SET_CALLBACK, // Function to register a callback to receive HID

// keys from TjIpSys.dll in case that window // messaging is not available

TJIP_SET_DTMF_TO_PPG, // Set custom DTMF tone via external wave fileTJIP_SET_TJ320_ECHO_CANCELLER, // Turn on/off echo canceller (For Tj320 PCI device

//only)TJIP_RESET_TJ320_ECHO_CANCELLER,// Reset echo canceller (For Tj320 PCI device only)TJIP_SET_TJ320_GC, // Turn on/off Gain Control (For Tj320 PCI device

// only)TJIP_GET_TJ320_DEV_ID, // Get Tj320 PCI device ID};

RemarksMessages including TJIP_PC2PC, TJIP_PC2PHONE, TJIP_LAUNCH_EXPLORER, TJIP_CHECK_IS_NM301_INSTALLED, TJIP_INSTALL_NM301, and TJIP_CLOSE_PC2PC are no longer used by Tiger560 hardware SDK. The reason to keep them in the message ID list is for backward compatible.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 9 of 64 5/8/2023

Page 10: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.1 OpenTjIpDevice functionThis function opens device drivers for TigerJet device. TigerJet device must be opened successfully before any other APIs can be called to access to its hardware.

SyntaxBOOL OpenTjIpDevice(HINSTANCE hInstance, TjIpProductID *puProductID);

ParametershInstance

[in] Handle to the application instance. puProductID

[in/out] Pointer to the product ID. It will be returned with the product ID which is being opened successfully. When it failed, the product ID will be returned with TJIP_NONE.

Return ValueThe function returns TRUE if device open is successful, otherwise, it returns FALSE.

Example// Open Tiger deviceTjIpProductIDm_uProductID;HINSTANCE m_hInstance;m_uProductID = TJIP_NONE; // Default to no devicem_hInstance = AfxGetApp()->m_hInstance; // Get application instanceOpenTjIpDevice(m_hInstance, &m_uProductID); // Open TigerJet560 device

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 10 of 64 5/8/2023

Page 11: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.2 TjIpProductID enumThere are various types of TigerJet VoIP products supported by Tiger560 SDK. Each product could have different pieces of hardware to perform different functionalities. For example, USB phone has Proslic chip which can be connected to a phone for on/off hook detection, ringing, and tone generation. USB handset has a keypad with customized buttons defined by each individual customer. This enum defines product IDs for all types of TigerJet VoIP products such that it can be used to identify different hardware and to decide what type of functions should be performed by the software.

Syntaxtypedef enum _TjIpProductID{TJIP_NONE, // None

//// Tj320 PCI devices//TJIP_TJ320PHONE, // TigerJet 320 PCI Phone

//// Tj560 USB devices //TJIP_TJ560PHONE = 0x831C, // TigerJet 560 USB PhoneTJIP_TJ560PHONE_CUSTOM = 0x831E, // TigerJet 560 USB Phone customTJIP_TJ560PHONE_SWITCH = 0x831D, // TigerJet 560 USB Phone/SwitchTJIP_TJ560PHONE_ECHO = 0x825C,// TigerJet 560 USB Phone with Echo CancellerTJIP_TJ560HANDSET = 0x7210, // TigerJet 560 USB HandsetTJIP_TJ560HANDSET_COMP = 0x8250, // TigerJet 560 USB Handset/compTJIP_TJ560HANDSET_KEYPAD = 0xB210, // TigerJet 560 USB Handset/KeypadTJIP_TJ560HANDSET_SWITCH = 0xB211, // TigerJet 560 USB Handset/SwitchTJIP_TJ560HANDSET_ID = 0xB212, // TigerJet 560 USB Handset/ID

//// Tj560B USB devices//TJIP_TJ560BPHONE_HID = 0xC31C, // TigerJet 560B USB Phone/HIDTJIP_TJ560BPHONE_SWITCH_HID = 0xC31D, // TigerJet 560B USB Phone/Switch

// using HIDTJIP_TJ560BPHONE_CUSTOM_HID = 0xC31E, // TigerJet 560B USB Phone custom

// using HIDTJIP_TJ560BPHONE_ECHO_HID = 0xC25C, // TigerJet 560B USB Phone with

// external hardware Echo Canceller

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 11 of 64 5/8/2023

Page 12: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

TJIP_TJ560BHANDSET_HID = 0xF310, // TigerJet 560B USB Handset using HIDTJIP_TJ560BHANDSET_KEYPAD_HID = 0xF210, // TigerJet 560B USB

// Handset/Keypad using HIDTJIP_TJ560BHANDSET_HID_OKI = 0xF350, // TigerJet 560B USB

//Handset(Oki codec) using HIDTJIP_TJ560BHANDSET_KEYPAD_HID_OKI = 0xF250, // TigerJet 560B USB

//Handset/Keypad(Oki codec) using HID

TJIP_TJ560BPPG = 0xC290, // TigerJet 560B USB PPGTJIP_TJ560BPPG_NO_EC = 0xC291, // TigerJet 560B USB PPG without Echo

// CancellerTJIP_TJ560BPPGPROSLIC = 0xC39C, // TigerJet 560B USB PPG + Proslic}TjIpProductID;

RemarksFor backward compatability, Tiger560 hardware SDK also supports Tiger320 PCI products.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 12 of 64 5/8/2023

Page 13: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.3 CloseTjIpDevice functionThis function closes all the device drivers opened by OpenTjIpDevice and frees all the allocated memory used in DLL. Application must call this function before it is closed.

SyntaxBOOL CloseTjIpDevice()

Return ValueThe function returns TRUE if device close is successful, otherwise, it returns FALSE.

Example// Close Tiger deviceCloseTjIpDevice();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 13 of 64 5/8/2023

Page 14: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.4 SendTjIpVendorCommand functionThis function sends USB vendor command to Tiger560 device. USB vendor command is the basic mechanism used to read/write Tiger560 registers.

SyntaxBOOL SendTjIpVendorCommand(PVENDOR_CMD pRequest, DWORD dwDataSize,

PVOID pDataBuf)

ParameterspRequest

[in] Pointer to the USB vendor command sending to Tiger560 device. dwDataSize

[in] Size of USB vendor command.pDataBuf

[in/out] Pointer to data buffer used with USB vendor command.

Return ValueThe function returns TRUE if vendor command is executed successfully, otherwise, it returns FALSE.

Example// Read Tiger560 register 0x12BYTE uData;BYTE uLen;VENDOR_CMD Request;

uLen = 1; // 1 byte to readRequest.direction = 1; // 1: read, 0: write// default to 320ns command pulse with auto incremented addressRequest.bRequest = TJ_COMMAND_PULSE_320NS; Request.wValue = 0;Request.wIndex = 0x12; // Tiger560 register 0x12Request.wLength = uLen; // # of bytes to readSendTjIpVendorCommand(&Request, uLen, &uData);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 14 of 64 5/8/2023

Page 15: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.5 VENDOR_CMD structureThis structure is used to send USB vendor command.

Syntaxtypedef struct _VENDOR_CMD{ BYTE bRequest; // Vendor request WORD wValue; // Not used WORD wIndex; // Reg index WORD wLength; // Data length BYTE direction; // 0: write, 1: read BYTE bData; // Not used} VENDOR_CMD, *PVENDOR_CMD;

RemarksbRequest is used to set command pulse and address auto-increment. Command pulse is defined by TJ_COMMAND_PULSE as below:enum TJ_COMMAND_PULSE {

TJ_COMMAND_PULSE_80NS = 0x00, // 80ns command pulseTJ_COMMAND_PULSE_120NS = 0x02, // 120ns command pulseTJ_COMMAND_PULSE_320NS = 0x04, // 320ns command pulseTJ_COMMAND_PULSE_640NS = 0x06 // 640ns command pulse

};To disable address auto-increment, OR 0x01 to the command pulse.

Example// Write 4 byte of data to Tiger560 starting from register 0x20 BYTE uRegIndex = 0x20; // Starting addressBYTE uData[4] = {0x11, 0x18, 0xff, 0x7f}; // Data to be written to Tiger560BYTE uLen = sizeof(uData); // Data lengthTJ_COMMAND_PULSE CommandPulse = TJ_COMMAND_PULSE_320NS;BOOL bAutoIncrement = TRUE; // Enable address auto-incrementVENDOR_CMD Request;Request.direction = 0; // writeRequest.bRequest = CommandPulse | (bAutoIncrement ? 0x00 : 0x01); Request.wValue = 0; // Not usedRequest.wIndex = uRegIndex;Request.wLength = uLen;Request.bData = 0x55; // Not used

// Send command to write 4 bytes to Tiger560 starting from register 0x20SendTjIpVendorCommand(&Request, uLen, uData);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 15 of 64 5/8/2023

Page 16: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 16 of 64 5/8/2023

Page 17: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.6 ReadProSlicDirectReg functionThis function reads the Proslic direct register value.

SyntaxBYTE ReadProSlicDirectReg (BYTE uRegIndex)

ParametersuRegIndex

[in] Proslic direct register address.

Return ValueThe function returns the 8-bit Proslic direct register value.

Example// Read the value of Proslic direct register 68BYTE RetVal;RetVal = ReadProSlicDirectReg(68);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 17 of 64 5/8/2023

Page 18: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.7 WriteProSlicDirectReg functionThis function writes an 8-bit value to the Proslic direct register.

SyntaxBOOL WriteProSlicDirectReg(BYTE uRegIndex, BYTE uRegData);

ParametersuRegIndex

[in] Proslic direct register address. uRegData

[in] 8-bit data to be written to Proslic direct register.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Write an 8-bit value to Proslic direct register 68BYTE Value = 0x35;BOOL RetVal;RetVal = WriteProSlicDirectReg (68, Value);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 18 of 64 5/8/2023

Page 19: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.8 ReadProSlicIndirectReg functionThis function reads the Proslic indirect register value.

SyntaxWORD ReadProSlicIndirectReg (BYTE uRegIndex)

ParametersuRegIndex

[in] Proslic indirect register address.

Return ValueThe function returns the 16-bit Proslic indirect register value.

Example// Read the value of Proslic indirect register 88WORD RetVal; // The return value of Proslic indirect register 88RetVal = ReadProSlicIndirectReg(88);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 19 of 64 5/8/2023

Page 20: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.9 WriteProSlicIndirectReg functionThis function writes a 16-bit value to the Proslic indirect register.

SyntaxBOOL WriteProSlicIndirectReg(BYTE uRegIndex, WORD wRegData)

ParametersuRegIndex

[in] Proslic indirect register address. uRegData

[in] 16-bit data to be written to Proslic indirect register.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Write a 16-bit value to Proslic indirect register 88WORD Value = 0x1235;BOOL RetVal;RetVal = WriteProSlicIndirectReg (88, Value);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 20 of 64 5/8/2023

Page 21: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.10 IsTjIpDevicePlugged functionThis function checks whether Tiger560 USB device is plugged in.

SyntaxBOOL IsTjIpDevicePlugged()

Return ValueThe function returns TRUE if Tiger560 device is plugged in, otherwise, it returns FALSE.

ExampleBOOL bPlugged = IsTjIpDevicePlugged(); // Return TRUE if device is plugged

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 21 of 64 5/8/2023

Page 22: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.11 SendVirtualKey functionThis function sends a virtual key to system so any application with the input focus can receive this key as if it is entered from keyboard.

SyntaxBOOL SendVirtualKey(char cKey, BOOL bUp)

ParameterscKey

[in] Virtual key to send. bUp

[in] Key up/down status. TRUE: key is up, FALSE: key is down.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Send virtual key ‘1’ to systemSendVirtualKeyDownUp(‘1’, FALSE); // Key ‘1’ is downSendVirtualKeyDownUp(‘1’, TRUE); // Key ‘1’ is up

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 22 of 64 5/8/2023

Page 23: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.12 StartTjIPDevDetection functionThis function enables TjIpSys.DLL to start detecting if there’s any new Tiger560 device is plugged in or if there’s any existing Tiger560 device is being unplugged. If a new Tiger560 device is found, application window will receive WM_TJIP_DEV_ADDED message from TjIpSys.DLL with lParam set to the product ID of the newly found TigerJet560 device. If a Tiger560 device is unplugged, TjIpSys.DLL will detect this event and send WM_TJIP_DEV_REMOVED message to application window to notify that a TigerJet560 device is just unplugged.

SyntaxBOOL StartTjIPDevDetection(HWND hWnd, HINSTANCE hInstance)

ParametershWnd

[in] Handle to the application window which is going to receive messages (WM_TJIP_DEV_ADDED and WM_TJIP_DEV_REMOVED) from TjIpSys.DLL about the arrival of a new Tiger560 device or the removal of a Tiger560 device.

hInstance [in] Handle to the application instance.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

RemarksIn order to make device detection work, HandleUsbDeviceChange() must be called whenever a system message WM_DEVICECHANGE is received. For more details about WM_DEVICECHANGE, please refer to Windows SDK.

Example// 1. Call StartTjIPDevDetection in you applicationStartTjIPDevDetection(m_hWnd, m_hInstance);

// 2. Then your window will receive notification messages from DLLLRESULT MyWindowProc(UINT message, WPARAM wParam, LPARAM lParam) {

switch( message) {

case WM_DEVICECHANGE: // Device has changedHandleUsbDeviceChange(wParam, lParam); break;

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 23 of 64 5/8/2023

Page 24: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

case WM_TJIP_DEV_ADDED: // A new Tiger560 is added++m_TotalTjIpDevices;if (m_uProductID == TJIP_NONE){

m_uProductID = (TjIpProductID)lParam;// Implement your code here for devive arrival…

}break;

case WM_TJIP_DEV_REMOVED: // An existing Tiger560 is removed--m_TotalTjIpDevices;

if (m_uProductID == lParam){

// Implement your code here for device removal…m_uProductID = TJIP_NONE;

}break;

default:break;

}…}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 24 of 64 5/8/2023

Page 25: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.13 StopTjIPDevDetection functionThis function stops the device detection in TjIpSys.DLL.

SyntaxBOOL StopTjIPDevDetection()

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Call it before you exit from your applicationStopTjIPDevDetection();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 25 of 64 5/8/2023

Page 26: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.14 HandleUsbDeviceChange functionThis function processes device change message (WM_DEVICECHANGE) sent from Windows system. To implement auto device detection for device arrival/removal, this function must be called in the application’s window procedure whenever a system message WM_DEVICECHANGE is received. For more details about WM_DEVICECHANGE, please refer to Windows SDK. Syntax

BOOL HandleUsbDeviceChange(WPARAM wParam, LPARAM lParam)

ParameterswParam

[in] wParam sent from system with WM_DEVICECHANGE message. lParam

[in] lParam sent from system with WM_DEVICECHANGE message.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

ExampleLRESULT MyWindowProc(UINT message, WPARAM wParam, LPARAM lParam) {

switch( message) {

case WM_DEVICECHANGE: // Device has been changedHandleUsbDeviceChange(wParam, lParam); break;

default:break;

}…}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 26 of 64 5/8/2023

Page 27: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.15 GetSerialNumber functionThis function retrieves the serial number from EEPROM.

SyntaxBOOL GetSerialNumber(char *buf, int len)

Parametersbuf

[in/out] Pointer to a buffer to retrieve the serial number from EEPROM. len

[in] Maximum buffer size.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

RemarksThis function is only supported by Tj560 device with EEPROM.

Example// Retrieves the serial number from EEPROM char szSerialNumber[32] = {0};GetSerialNumber(szSerialNumber, sizeof (szSerialNumber));

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 27 of 64 5/8/2023

Page 28: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.16 InitDTMFTones functionThis function initializes wave data of DTMF tones and opens the audio playback device. It must be called before any DTMF tone playback.

SyntaxBOOL InitDTMFTones(char *szUsbAudioName)

ParametersszUsbAudioName

[in] Audio device name used to playback the DTMF tones. This is the name of audio device shown under Sound, video and game controllers in Device Manager. Note that the audio device name can be a partial name. For example, if you use “USB” as the audio device name, then the first audio playback device name starting with “USB” will be chosen to playback the DTMF tones.

Return ValueThe function returns TRUE if the DTMF tone initialization is successful, otherwise, it returns FALSE.

ExampleBOOL rt;// Initialize wave data of DTMF tones and open audio playback device// which name starts with “USB Internet Phone By”rt = InitDTMFTones("USB Internet Phone By");

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 28 of 64 5/8/2023

Page 29: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.17 SendDTMFToneToPPG functionThis function sends DTMF tone to the audio playback device opened by InitDTMFTones().

SyntaxBOOL SendDTMFToneToPPG(int nTone)

ParametersnTone

[in] 0 - 9 for tone '0' to '9'10 for '*' tone11 for '#' tone101 for ringback tone102 for busy tone103 for ringing tone201 - 216 for custom tones-1 for stopping current playback

Return ValueThe function returns TRUE if DTMF playback is successful, otherwise, it returns FALSE.

RemarksOriginally this function supported only TigerJet’s USB PPG (Personal Phone Gateway) devices. Later on it was modified to support USB phones and handsets as well. However, for backward compatability, the name of this function is still kept the same. So don’t be confused by the name, it works for USB phones and handsets.

ExampleSendDTMFToneToPPG(1); // playback the ‘1’ toneSendDTMFToneToPPG(10); // playback the ‘*’ toneSendDTMFToneToPPG(102); // playback the busy toneSendDTMFToneToPPG(-1); // stop tone playback

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 29 of 64 5/8/2023

Page 30: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.18 SetCustomDTMFTone functionThis function sets a wave file as a custom tone with an associated tone ID. Once the custom tone is set, the wave data of custom tone is loaded from wave file into memory and it is ready to play by calling SendDTMFToneToPPG() with the tone ID passed to this function. The tone ID must be ranging from 201 to 216 for maximum of 16 custom tones.

SyntaxBOOL SetCustomDTMFTone(LPCTSTR szWaveFile, int nToneID)

ParametersszWaveFile

[in] Filename of the 16-bit PCM, 8KHz, and mono wave file. nToneID

[in] Tone ID which must be between 201 and 216 for up to 16 custom tones.

Return ValueThe function returns TRUE if the custom tone setup is successful, otherwise, it returns FALSE.

RemarksTo playback a custom tone, you must call this function with a wave file (16-bit PCM, 8KHz, mono) of your custom tone before calling SendDTMFToneToPPG() for playback. In order to minimize the CPU processing time, this function should be called only once for each custom tone and the wave data is stored in memory until the application is closed.

Example// Set Ringback.wav as custom tone 201if (SetCustomDTMFTone("Ringback.wav", 201)){

// Load external wave file successfulSendDTMFToneToPPG(201); // play the ringback tone

}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 30 of 64 5/8/2023

Page 31: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.19 SetCallBack functionThis function sets a callback function for TjIpSys.DLL to call when an HID key is sent from Tiger560 devices.

SyntaxBOOL SetCallBack(PTJIPSYS_CALLBACK fpCallback, void* context)

ParametersfpCallback

[in] Callback function. context

[in] Callback context.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

RemarksThere are two ways to receive HID keys from DLL. One is to use a window to receive WM_TJIP_HID_NEW_KEY message from DLL. The other is to use a callback function because some applications (such as NT service) don’t have window to receive the message.

Example// Set MyCallback as callback functionSetCallBack(MyCallback, (void*)this);

// Usually the callback function is used only when application (such as NT service)// doesn't have a main window to handle HID messages from TjIpSys.dll.// Set this callback to TjIpSys.dll so it will get called when an HID key is pressed.void MyCallback(void* context, UINT message, WPARAM wParam, LPARAM lParam){ switch( message) {

// When message is WM_TJIP_HID_NEW_KEY, // wParam is the hardware key valuecase WM_TJIP_HID_NEW_KEY: // A new HID key is sent{ CTjIpDemoDlg *pMain = (CTjIpDemoDlg*)context; char cNewKey; // HID key in ASCII format if (pMain && pMain->m_pTjDev) { cNewKey = pMain->m_pTjDev->MapHardwareKeyToUserKey(wParam); // To do:

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 31 of 64 5/8/2023

Page 32: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

// Implement you keypad handling here } break;}

default:break;

}}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 32 of 64 5/8/2023

Page 33: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.20 PTJIPSYS_CALLBACK typedefThis typedef defines the callback function which can be called by TjIpSys.DLL.

Syntaxtypedef void (*PTJIPSYS_CALLBACK)(void* context, UINT message, WPARAM wParam, LPARAM lParam);

Parameterscontext

[in] Pointer to callback context. message

[in] Callback message. wParam

[in] Callback WORD parameter. lParam

[in] Callback LONG parameter.

ExamplePTJIPSYS_CALLBACK fpCallback; // Callback function

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 33 of 64 5/8/2023

Page 34: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.2.21 TJIpSysCommand enumThis enum defines messages which are sent between TjIpSys.DLL and applications.

1) WM_TJIP_DEV_ADDED is sent from DLL to the application whenever a new Tiger560 device is plugged in. The lParam parameter is the product ID of the new device.

2) WM_TJIP_DEV_REMOVED is sent from DLL to the application whenever an existing Tiger560 device is unplugged. The lParam parameter is the product ID of the unplugged device.

3) WM_TJIP_HID_NEW_KEY is sent from DLL to the application whenever an HID key is pressed. Note that this message can be sent to application’s window or callback function (if callback has been set). The wParam parameter is the HID hardware key being pressed. The value of HID hardware key is the raw value defined in HID key table.

4) WM_TJIP_SHOW is send from application to its main window to show or hide its GUI. When the wParam parameter is TRUE, it shows its GUI. When the wParam parameter is FALSE, it hides its GUI.

Syntax#define WM_TJIPSYS_BASE (WM_USER+400)enum TJIpSysCommand{

WM_TJIP_DEV_ADDED = WM_TJIPSYS_BASE,WM_TJIP_DEV_REMOVED,WM_TJIP_HID_NEW_KEY,WM_TJIP_SHOW,

};

ExampleLRESULT MyWindowProc(UINT message, WPARAM wParam, LPARAM lParam) {

switch( message) {

case WM_TJIP_DEV_ADDED: // A new Tiger560 is added// lParam is the product ID of the new device++m_TotalTjIpDevices;if (m_uProductID == TJIP_NONE){

m_uProductID = (TjIpProductID)lParam;// Implement your code here for devive arrival…

}break;

case WM_TJIP_DEV_REMOVED: // An existing Tiger560 is removed// lParam parameter is the product ID of the unplugged device

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 34 of 64 5/8/2023

Page 35: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

--m_TotalTjIpDevices;

if (m_uProductID == lParam){

// Implement your code here for device removal…m_uProductID = TJIP_NONE;

}break;

case WM_TJIP_HID_NEW_KEY:// wParam is the HID hardware keyif (m_pTjDev)ProcessNewKey(m_pTjDev->

MapHardwareKeyToUserKey(wParam));break;

}

case WM_TJIP_SHOW:// wParam: TRUE to show GUI; FALSE to hide GUIShowWindow(wParam ? SW_SHOWNORMAL : SW_HIDE);break;

default:break;

}…}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 35 of 64 5/8/2023

Page 36: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3 Echo cancellation (ECC) routinesTigerJet software ECC provides a set of routines to cancel the acoustic echo between the loud speaker and microphone. It is designed for 8KHz ,16 bit PCM, and mono audio stream. Below is the basic diagram of ECC:

Two inputs, the speaker and microphone audio streams, are going into ECC, and the output is the echo-cancelled microphone audio. To use TigerJet ECC routines for echo cancellation, please follow the steps below:

1) Call ECC_Init(0) and ECC_Init(1) to initialize ECC for microphone and speaker paths2) Call ECC_SetOption() to configure the ECC to fit into your hardware.3) Whenever your device receives audio stream to speaker, copy the stream to a buffer then

call ECC_ProcessSpeakerAudio().4) Whenever your device captures audio stream from microphone, copy the stream to a

buffer then call ECC_ProcessMicrophoneAudio() to cancel echo in the captured stream. After ECC_ProcessMicrophoneAudio() returns, the same buffer passed to ECC_ProcessMicrophoneAudio() contains the echo-cancelled microphone audio.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 36 of 64 5/8/2023

Page 37: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3.1 ECC_Init functionThis function initializes one of the two ECC paths for microphone or speaker. It must be called before other ECC routines.

SyntaxBOOL ECC_Init(int path)

Parameterspath

[in] ECC path (0: microphone path, 1: speaker path).

Return ValueThe function returns TRUE if ECC path initialization is successful, otherwise, it returns FALSE.

Example// Initialize ECCif (!ECC_Init(0)) // Init microphone path

goto ERR_StartEcc;

if (!ECC_Init(1)) // Init speaker pathgoto ERR_StartEcc;

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 37 of 64 5/8/2023

Page 38: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3.2 ECC_Close functionThis function frees all the memory allocated by ECC_Init() and closes ECC.

SyntaxBOOL ECC_Close()

Return ValueThe function returns TRUE if ECC close is successful, otherwise, it returns FALSE.

Example// Close ECC before application exitsECC_Close();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 38 of 64 5/8/2023

Page 39: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3.3 ECC_SetOption functionThis function sets options for ECC. ECC options including buffer size, reference index, and reference offset are the three parameters used to fine tune the performance of echo canceller due to the different acoustic echo latency occurring in various types of Tiger560 devices. Internally ECC allocates a source buffer which contains 16 small buffers. The size of each small buffer (80 ~ 240 bytes) is referred as the buffer size. The reference index is the index to the small buffer in the source buffer and the reference offset is the offset of the starting byte inside the small buffer. The adjustment of these three parameters is used to match the acoustic echo latency in order to cancel the echo in the captured audio stream. Syntax

BOOL ECC_SetOption(BOOL bEnableEEC, int BufSize, int RefIndex, int RefOffset)

ParametersbEnableEEC

[in] TRUE to enable EEC, FALSE to disable it. BufSize

[in] Size of small buffer. RefIndex

[in] Index to the small buffer in the source buffer (0 to 15). RefOffset

[in] Offset of the starting byte inside the small buffer (0 to BufSize).

Return ValueThe function returns TRUE if options are setup successful, otherwise, it returns FALSE.

Example// Enable ECC and set the buffer size and offset for ECCif (!ECC_SetOption(

TRUE, // TRUE to enable EEC160, // Size of small buffer 12, // Index to the small buffer in the source buffer (0 to 15)40)) // Offset of the starting byte inside the small buffer (0 to BufSize)

{ERR_StartEcc:

TjSip_StopECC();return FALSE;

}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 39 of 64 5/8/2023

Page 40: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3.4 ECC_ProcessSpeakerAudio functionThis function processes speaker audio stream stored in the buffer.

SyntaxBOOL ECC_ProcessSpeakerAudio(BYTE *buf, int nLength)

Parametersbuf

[in] Buffer which stores speaker audio stream.nLength

[in] Audio stream length (in 16-bit PCM samples)

Return ValueThe function returns TRUE if speaker audio stream process is successful, otherwise, it returns FALSE.

Example// Process speaker audioECC_ProcessSpeakerAudio((BYTE*)buf, 160);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 40 of 64 5/8/2023

Page 41: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.3.5 ECC_ProcessMicrophoneAudio functionThis function processes microphone audio stream stored in the input buffer. If the function returns successfully, the buffer will contain the echo-cancelled microphone audio stream.

SyntaxBOOL ECC_ProcessMicrophoneAudio (BYTE *buf, int nLength)

Parametersbuf

[in/out] Buffer which stores microphone audio stream. If the function returns successfully, the buffer will contain the echo-cancelled microphone audio stream.

nLength [in] Audio stream length (in 16-bit PCM samples)

Return ValueThe function returns TRUE if microphone audio stream process is successful, otherwise, it returns FALSE.

Example// Process microphone audioECC_ProcessMicrophoneAudio((BYTE*)buf, 160);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 41 of 64 5/8/2023

Page 42: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4 Mixer/volume control routinesIn order to get, set and mute volume for Tiger560 audio devices, Tj560 SDK has provided a set of utility routines for volume control via Windows audio mixer. For more details about Windows audio mixer, please refer to Windows SDK.

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 42 of 64 5/8/2023

Page 43: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.1 OpenTjMixer functionThis function opens Windows audio mixer for Tj560 USB audio for volume control.

SyntaxBOOL OpenTjMixer(TJ_MIXER_OPEN *ptjMixerOpen)

ParametersptjMixerOpen

[in] Pointer to TJ_MIXER_OPEN structure which specifies the mixer name and window handle to receive mixer MM_MIXM_CONTROL_CHANGE message. (For more details about MM_MIXM_CONTROL_CHANGE, please refer to Windows SDK.)

Return ValueThe function returns TRUE if mixer open is successful, otherwise, it returns FALSE.

RemarksThe mixer name specified by szMixerName in TJ_MIXER_OPEN structure can be a partial name (don’t need to be a full name) such as "USB Internet Phone" or "USB". The first audio mixer in the system matches the partial name (or full name) will be opened.

Example// Open the audio mixer which name starts with “USB”TJ_MIXER_OPEN tjMixerOpen;strcpy(tjMixerOpen.szMixerName, "USB");tjMixerOpen.hCallbackWnd = m_hWnd; // Window handle to receive mixer notificationBOOL m_bTjMixerOpened = OpenTjMixer(&tjMixerOpen);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 43 of 64 5/8/2023

Page 44: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.2 TJ_MIXER_OPEN structThis structure is used with OpenTjMixer() to specify the mixer name and window handle to receive mixer MM_MIXM_CONTROL_CHANGE message.

Syntaxtypedef struct _TJ_MIXER_OPEN{

char szMixerName[256]; // Mixer name to open (could be a partial name)HWND hCallbackWnd; // A callback window to receive the

// MM_MIXM_CONTROL_CHANGE message}TJ_MIXER_OPEN;

Example// Open the audio mixer which name starts with “USB Internet Phone”TJ_MIXER_OPEN tjMixerOpen;strcpy(tjMixerOpen.szMixerName, "USB Internet Phone ");tjMixerOpen.hCallbackWnd = m_hWnd; // Window handle to receive mixer notificationBOOL m_bTjMixerOpened = OpenTjMixer(&tjMixerOpen);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 44 of 64 5/8/2023

Page 45: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.3 CloseTjMixer functionThis function closes the mixer opened by OpenTjMixer().

Syntaxvoid CloseTjMixer()

Example// Close mixer before application exitsCloseTjMixer();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 45 of 64 5/8/2023

Page 46: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.4 GetTjMixerWaveInVol functionThis function retrieves the volume of microphone (wave-in capture) device.

SyntaxBOOL GetTjMixerWaveInVol(DWORD *pVol)

ParameterspVol

[out] Pointer to the volume variable to retrieve the microphone volume.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve microphone volume DWORD dwVolume;GetTjMixerWaveInVol(&dwVolume);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 46 of 64 5/8/2023

Page 47: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.5 SetTjMixerWaveInVol functionThis function sets the volume of the microphone (wave-in capture) device.

SyntaxBOOL SetTjMixerWaveInVol(DWORD Vol)

ParametersVol

[in] Volume to be set to the microphone device. The volume range is between 0 and 0x7fff.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Set the microphone volume to 0x3fffSetTjMixerWaveInVol((DWORD)0x3fff);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 47 of 64 5/8/2023

Page 48: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.6 GetTjMixerWaveOutVol functionThis function retrieves the volume of wave-out device.

SyntaxBOOL GetTjMixerWaveOutVol(DWORD *pVol)

ParameterspVol

[out] Pointer to the volume variable to retrieve the wave-out volume.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve wave-out volume DWORD dwVolume;GetTjMixerWaveOutVol(&dwVolume);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 48 of 64 5/8/2023

Page 49: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.7 SetTjMixerWaveOutVol functionThis function sets the volume of the wave-out device.

SyntaxBOOL SetTjMixerWaveOutVol(DWORD Vol)

ParametersVol

[in] Volume to be set to the wave-out device. The volume range is between 0 and 0x7fff.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Set the wave-out volume to 0x3fffSetTjMixerWaveOutVol((DWORD)0x3fff);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 49 of 64 5/8/2023

Page 50: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.8 GetTjMixerMasterWaveOutVol functionThis function retrieves the volume of speaker (master wave-out) device.

SyntaxBOOL GetTjMixerMasterWaveOutVol(DWORD *pVol)

ParameterspVol

[out] Pointer to the volume variable to retrieve the speaker volume.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve speaker master volume DWORD dwMasterVolume;GetTjMixerMasterWaveOutVol(&dwMasterVolume);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 50 of 64 5/8/2023

Page 51: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.9 SetTjMixerMasterWaveOutVol functionThis function sets the volume of the speaker (master wave-out) device.

SyntaxBOOL SetTjMixerMasterWaveOutVol(DWORD Vol)

ParametersVol

[in] Volume to be set to the speaker device. The volume range is between 0 and 0x7fff.

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Set the speaker master volume to 0x7fffSetTjMixerMasterWaveOutVol((DWORD)0x7fff);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 51 of 64 5/8/2023

Page 52: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.10 GetMicrophoneMute functionThis function retrieves the mute state of the microphone device.

SyntaxBOOL GetMicrophoneMute(BOOL *pbMute)

ParameterspbMute

[out] Pointer to mute state (TRUE: mute is on, FALSE: mute is off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve the mute state of the microphone device BOOL m_bMicrophoneMute;GetMicrophoneMute(&m_bMicrophoneMute);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 52 of 64 5/8/2023

Page 53: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.11 SetMicrophoneMute functionThis function sets the microphone device mute on/off.

SyntaxBOOL SetMicrophoneMute(BOOL bMute)

ParametersbMute

[in] Mute state (TRUE: mute on, FALSE: mute off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Mute the microphone device SetMicrophoneMute(TRUE);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 53 of 64 5/8/2023

Page 54: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.12 GetSpeakerMute functionThis function retrieves the mute state of the speaker device.

SyntaxBOOL GetSpeakerMute(BOOL *pbMute)

ParameterspbMute

[out] Pointer to mute state (TRUE: mute is on, FALSE: mute is off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve the mute state of the speaker device BOOL m_bSpeakerMute;GetSpeakerMute(&m_bSpeakerMute);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 54 of 64 5/8/2023

Page 55: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.13 SetSpeakerMute functionThis function sets the speaker device mute on/off.

SyntaxBOOL SetSpeakerMute(BOOL bMute)

ParametersbMute

[in] Mute state (TRUE: mute on, FALSE: mute off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Mute the speaker device SetSpeakerMute(TRUE);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 55 of 64 5/8/2023

Page 56: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.14 GetMasterSpeakerMute functionThis function retrieves the mute state of the master speaker device.

SyntaxBOOL GetMasterSpeakerMute(BOOL *pbMute)

ParameterspbMute

[out] Pointer to mute state (TRUE: mute is on, FALSE: mute is off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Retrieve the mute state of the master speaker device BOOL m_bMasterSpeakerMute;GetMasterSpeakerMute(&m_bMasterSpeakerMute);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 56 of 64 5/8/2023

Page 57: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.15 SetMasterSpeakerMute functionThis function sets the master speaker device mute on/off.

SyntaxBOOL SetMasterSpeakerMute(BOOL bMute)

ParametersbMute

[in] Mute state (TRUE: mute on, FALSE: mute off).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Mute the master speaker device SetMasterSpeakerMute(TRUE);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 57 of 64 5/8/2023

Page 58: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.4.16 OnMixerCtrlChange functionThis function is used to bypass MM_MIXM_CONTROL_CHANGE message to TjIpSys.DLL when mixer control has changed. For more detailed information about MM_MIXM_CONTROL_CHANGE message, please refer to Windows SDK.

SyntaxBOOL OnMixerCtrlChange(UINT wParam, LONG lParam);

ParameterswParam

[in] wParam passed from application’s main winProc. lParam

[in] lParam passed from application’s main winProc

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

ExampleLRESULT MyWindowProc(UINT message, WPARAM wParam, LPARAM lParam) {

switch( message) {

case MM_MIXM_CONTROL_CHANGE:// Windows sends this message to us when volume has been changed// by other applications. We need to call the function here to update our // internal volume control in tjipsys.dll.// If this function is not called, the mixer we open still keeps the old // volume settings. OnMixerCtrlChange(wParam, lParam);return TRUE;

default:break;

}…}

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 58 of 64 5/8/2023

Page 59: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.5 USB PPG routinesTiger560 SDK also provides a set of APIs to program USB PPG (Personal Phone Gateway).

2.5.1 SetUsbPPGOnHook functionThis function sets USB PPG to on-hook state.

SyntaxBOOL SetUsbPPGOnHook()

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Set PPG to on-hookSetUsbPPGOnHook();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 59 of 64 5/8/2023

Page 60: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.5.2 SetUsbPPGOffHook functionThis function sets USB PPG to off-hook state.

SyntaxBOOL SetUsbPPGOffHook()

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Set PPG to off-hookSetUsbPPGOffHook();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 60 of 64 5/8/2023

Page 61: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.5.3 SetUsbPPGProslicClock functionThis function enables the clock (FSC and DCLK) of USB PPG with Proslic.

SyntaxBOOL SetUsbPPGProslicClock()

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Enable the clock (FSC and DCLK) of USB PPG with ProslicSetUsbPPGProslicClock();

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 61 of 64 5/8/2023

Page 62: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

2.5.4 SetUsbPPGProslicSwitch functionThis function sets the switch to phone or PPG(DAA).

SyntaxBOOL SetUsbPPGProslicSwitch(BOOL bSwitchToPhone)

ParametersbSwitchToPhone

[in] TRUE: switch to Phone, FALSE: switch to PPG (DAA).

Return ValueThe function returns TRUE if it is successful, otherwise, it returns FALSE.

Example// Switch to phoneSetUsbPPGProslicSwitch(TRUE);

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 62 of 64 5/8/2023

Page 63: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

3 Release noteTiger560 Hardware SDK has been released to OEM customers for years. This document is mainly made based on SDK 8.51. For SDK release notes before version 8.51, please refer to readme.txt in Tiger560 Hardware SDK.

3.1 Release note version 8.511) Add SetThreadPriority( m_hScanKeypadThread,

THREAD_PRIORITY_TIME_CRITICAL) to boost up the priority of keypad scanning thread.

2) In 8.4x SDK, instead of using a timer, we add a separate thread to scan keys. This can improve program efficiency, however, improper registers read/write could cause run race condition while key scanning thread is also trying to read/write registers. To solve this issue, a critical section (m_CritSec defined in class CTjIpDev in TjIpApi.h) is being used in the SDK to synchronize all register r/w. For example, if you want to read GIO6 to detect the ring, you should add a new virtual function in TjIpApi.cpp & h as below:BOOL CTjIpDev::DetectRing(){ EnterCriticalSection(&m_CritSec);  // Implement your code in between Enter and LeaveCriticalSection() BYTE data = 0; BOOL bRing;  // Add you code to check ring condition

 tjinp(0x0f, &data);....... 

 LeaveCriticalSection(&m_CritSec); return bRing; }

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 63 of 64 5/8/2023

Page 64: tigerjet Network Tiger560 Hardware Sdk Api Programmingread.pudn.com/downloads152/sourcecode/comm/usb/66…  · Web viewTigerJet Network Tiger560 Hardware SDK API. ... This function

Tiger560 Hardware SDK API Programming Guide Version 8.51

Legal WordsTigerJet reserves the rights to make changes without further notice to any products herein. TigerJet makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does TigerJet assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may be provided in TigerJet data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals” must be validated for each customer application by customer’s technical experts. TigerJet does not convey any license under its patent rights nor the rights of others. TigerJet products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or any other application intended to support or sustain life, or for any other application in which the failure of the TigerJet product could create a situation where personal injury or death may occur. Should Buyer purchase or use TigerJet products for any such unintended or unauthorized application, Buyer shall indemnify and hold TigerJet and its officers, employees, subsidiaries, affiliates and distributors harmless against all claims, costs, damages and expenses and reasonable attorney fees arising out of, directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that TigerJet was negligent regarding the design and manufacture of the part.

TigerJet and TJNET are registered trademarks of TigerJet Network Inc.

How to reach TigerJetTigerJet Network Inc.50 Airport ParkwaySan JoseCA 95110USA

E-mail: [email protected]

TigerJet Network Inc. Phone: 408-437-772750 Airport Parkway Fax: 408-437-4961San Jose, CA95110 © 2005 TigerJet Network Inc. All rights reserved Web: www.tjnet.comUSA Page 64 of 64 5/8/2023