Docstoc

KX-TDA USB Driver

Document Sample
KX-TDA USB Driver Powered By Docstoc
					KX-TDA USB Driver Version 2.0 Interface Specification

Revision : 2.001 Date : 1 Sept. 2004

ATTENTION - This document is copyrighted by Panasonic Communications Co., Ltd. (“PCC”), and is protected by the copyright laws and international treaty provisions, and all other applicable laws. - All contents of this document are subject to change without notice. - THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT ANY WARRANTY. PCC AND ITS AFFILIATE COMPANIES (“PANASONIC”) DOES NOT MAKE OR PASS ON TO YOU OR OTHER THIRD PARTY, ANY WARRANTY OR REPRESENTATION INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, PANASONIC DOES NOT WARRANT THAT THIS DOCUMENT WILL BE ERROR-FREE OR THAT IT WILL MEET YOUR REQUIREMENTS. PANASONIC SHALL NOT BE LIABLE FOR ANY DAMAGE SUFFERED BY YOU OR OTHER THIRD PARTY INCLUDING, BUT NOT LIMITED TO, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR PUNITIVE DAMAGES, EVEN IF PANASONIC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

Revision No. 2.001

Page

Comments of revision The first edition

Checked by

Prepared by K.Yamaguchi 2004.09.01

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

Table of Contents
1. KX-TDA USB Topology ........................................................................................................................................................................................5 2. KX-TDA USB Driver Architecture.........................................................................................................................................................................6 3. KXTDAUSB_EnumPBX .......................................................................................................................................................................................7 4. KXTDAUSB_Open ................................................................................................................................................................................................8 5. KXTDAUSB_Close ...............................................................................................................................................................................................8 6. KXTDAUSB_SendData .........................................................................................................................................................................................9 7. callback...................................................................................................................................................................................................................9 8. Error code .............................................................................................................................................................................................................10 9. Header file ............................................................................................................................................................................................................ 11 10. Restrictions .........................................................................................................................................................................................................14

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

1. KX-TDA USB Topology
KX-TDA USB driver is a USB device driver for Microsoft Windows operating system. This figure shows topology of USB connection. This connection can be used for TDA Maintenance Console and CT Link (CTI application). It is not possible to use both applications simultaneously to the same PBX. One PC can connect maximum 8 KX-TDA PBXs.

KX-TDA series PBX

USB 1.1

CTI Server Telephone lines

: :
Telephone lines

Maximum 8

: USB 1.1

KX-TDA series PBX

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

2. KX-TDA USB Driver Architecture
An application which uses USB port of TDA main unit needs to load KXTDAUSB.DLL as the interface. Following figure shows architecture of KX-TDA USB Driver (especially role of KXTDAUSB.DLL). Provided interface functions for USB communication to KX-TDA PBX are described in following section.

Application using USB KXTDAUSB.DLL Function call Function call with CSTA message

Callback function callback
Open USB Close USB Send message

Retrieving USB device information

Opening function KXTDAUSB_Open

Closing function KXTDAUSB_Close

Data sending function KXTDAUSB_SendData

Device retrieving function KXTDAUSB_EnumPBX

Invoke receive thread

Stop receive thread

Receive Thread KXTDAUSB_RcvData

Driver Layer

USB Device

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

3. KXTDAUSB_EnumPBX
Retrieve list of USB devices(PBX) information. int APIENTRY KXTDAUSB_EnumPBX (BYTE *name, DWORD *pbxentries, LPBYTE *factory, LPBYTE *product) Parameters IN OUT OUT OUT Return Value See error code. Description This function returns pointers to list of available USB devices(PBX) information. USB user needs to call this function first to know what devices are available, and manage returned information to distinguish each device. Memory which allocated for arrays will be freed by KXTDAUSB.DLL automatically when it is detached. Description of Parameters Description Number of devices. Manufacturer name Format : "Product Name" + "_" + "Serial Number" Product Name ... PBX model name TDA100 : "KX-TDA100/200" TDA200 : "KX-TDA100/200" TDA15 : "KX-TDA30" TDA30 : "KX-TDA30" TDA50 : "KX-TDA50" Serial Number ... USBID (Can be changed by TDA Maintenance Console) 1 Byte char from "1" to "8"

BYTE* DWORD* LPBYTE* LPBYTE*

name. pbxentries factory product

This value should be "USB¥¥VID_04DA&PID_1680" to connect to TDA PBX. Number of USB devices(PBX). Array of pointers which points factory name. This is null-terminated string. Array of pointers which points product name(+USBID). This is null-terminated string.

Parameters pbxentries factory product

Value "Panasonic" (Fixed) Example : "KX-TDA100/200_1"

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

4. KXTDAUSB_Open
Open and enable USB device. int APIENTRY KXTDAUSB_Open (BYTE *name, void callback(DWORD, BYTE *, DWORD, DWORD, DWORD), DWORD *id, BYTE *factory, BYTE *product) Parameters IN IN OUT OUT IN/OUT

BYTE* void() DWORD* BYTE* BYTE*

name callback id factory product

Device Name Pointer that points callback function Device ID Not used Product Name (includes USBID) KXTDAUSB_EnumPBX function.

which

is

returned

by

Return Value See error code. Description - "name" shall be following value. Main unit USB port "USB¥¥VID_04DA&PID_1680" - "product" parameter is used to distinguish PBX when two or more PBXs are connected through USB.

5. KXTDAUSB_Close
Close and release USB device. int APIENTRY KXTDAUSB_Close (DWORD id) Parameters IN Return Value See error code.

DWORD

id

Device ID

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

6. KXTDAUSB_SendData
Send data (user message). int APIENTRY KXTDAUSB_SendData (DWORD id, BYTE *buf, DWORD size) Parameters IN IN IN Return Value See error code.

DWORD BYTE* DWORD

id buf size

Device ID Send buffer for a data Data size to send

7. callback
Callback function. This is called when a data is received. void callback (DWORD id, BYTE *buf, DWORD size, DWORD err_code, DWORD reserve) Parameters IN IN IN IN IN

DWORD BYTE* DWORD DWORD DWORD

id buf size err_code reserve

Device ID Receive buffer for a data Received data size Error code Reserved

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

8. Error code
Code
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 101 102 111 112 120 123 130 133

Defined name
KXTDAUSB_NOERROR KXTDAUSB_NODEVICE KXTDAUSB_NOOPEN KXTDAUSB_OPENALLREADY KXTDAUSB_INIT_ERROR KXTDAUSB_IOCTL_ERROR KXTDAUSB_DEVICE_REMOVE KXTDAUSB_READ_ERROR KXTDAUSB_WRITE_ERROR KXTDAUSB_READSIZE_ERROR KXTDAUSB_WRITESIZE_ERROR KXTDAUSB_SEQUENCE_ERROR KXTDAUSB_RCV_THREAD_BEGIN_ERROR KXTDAUSB_CLOSE_WAITFOR_ERROR KXTDAUSB_ERROR_NOT_READY KXTDAUSB_ERROR_ACCESS_DENIED KXTDAUSB_SEQ_01_ERROR KXTDAUSB_SEQ_02_ERROR KXTDAUSB_SEQ_11_ERROR KXTDAUSB_SEQ_12_ERROR KXTDAUSB_SEQ_20_ERROR KXTDAUSB_SEQ_23_ERROR KXTDAUSB_SEQ_30_ERROR KXTDAUSB_SEQ_33_ERROR

Description
No error. Device name or product name does not exist. Or combination of both names is wrong. Not opened. Already opened. Initialize error. Not used USB cable is unplugged or the PC goes into sleep mode. Read error. Write error. Invalid read size. Invalid write size. Not used Internal thread creation error. An error happen in close function. Not used Not used USB packet assemble error. USB packet assemble error. USB packet assemble error. USB packet assemble error. USB packet assemble error. USB packet assemble error. USB packet assemble error. USB packet assemble error.

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

9. Header file
KXTDAUSB.h /******************************************************************** * @(#) KXTDAUSB.h * Exported function and parameter definitions. * * Copyright (c) Panasonic Communication Corp. All rights reserved. * *********************************************************************/ #ifndef __KXTDAUSB_H__ #define __KXTDAUSB_H__ #ifdef __cplusplus extern "C" { #endif #include <windows.h> #include "KXTDAUSB_error.h" /******************************************************************** * Function: KXTDAUSB_EnumPBX() * Enumerates a list of PBX devices that are being connected to PC. * * Parameters: * BYTE* name i CONNECT_xxUNIT defined in "KXTDAUSB.h" * LPDWORD lppbxentries o pointer to number of pbxs currently connected to the PC * LPBYTE** lpfactory o pointer to factory name list (char * array) * LPBYTE** lpproduct o pointer to product name list (char * array) * * Returns: * KXTDAUSB_NOERROR normal * KXTDAUSB_NODEVICE parameter errors * KXTDAUSB_INIT_ERROR internal errors *********************************************************************/ int APIENTRY KXTDAUSB_EnumPBX(BYTE *name, LPDWORD lppbxentries, LPBYTE **lpfactory, LPBYTE **lpproduct); /******************************************************************** * Function: KXTDAUSB_Open() * Opens a device entry. Launchs the Receive Thread. * * Parameters: * BYTE* name i CONNECT_xxUNIT defined in "KXTDAUSB.h" * void callback i callback function that will be called by Receive Thread. * DWORD* id o device id * BYTE* factory factory name, not used. * BYTE* product i/o a string of the form of "product_serialno" * * Returns: * KXTDAUSB_NOERROR normal * KXTDAUSB_NODEVICE parameter errors * KXTDAUSB_OPENALLREADY parameter errors * others internal errors *********************************************************************/ int APIENTRY KXTDAUSB_Open(BYTE *name, void callback(DWORD id, BYTE *buf, DWORD size, DWORD err_code, DWORD reserve), DWORD *id, BYTE *factory, BYTE *product); /******************************************************************** * Function: KXTDAUSB_Close() * Terminates Receive Thread and closes the device entry. * All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

* Parameters: * DWORD id i device id returned from KXTDAUSB_Open() * * Returns: * KXTDAUSB_NOERROR normal * KXTDAUSB_NODEVICE parameter errors * KXTDAUSB_CLOSE_WAITFOR_ERROR internal errors *********************************************************************/ int APIENTRY KXTDAUSB_Close(DWORD id); /******************************************************************** * Function: KXTDAUSB_SendData() * Sends APP data to USB device. Do packet disassembling if necessary. * * Parameters: * DWORD id i device id returned from KXTDAUSB_Open() * BYTE* buf i data buffer to send * DWORD size i data size to send * * Returns: * KXTDAUSB_NOERROR normal * KXTDAUSB_NOOPEN parameter errors * KXTDAUSB_WRITESIZE_ERROR parameter errors * KXTDAUSB_WRITE_ERROR internal errors *********************************************************************/ int APIENTRY KXTDAUSB_SendData(DWORD id,BYTE *buf,DWORD size); // Hardware ID #define CONNECT_MUUNIT #ifdef __cplusplus } #endif //***************************************************************************** #endif // __KXTDAUSB_H__

"USB¥¥VID_04DA&PID_1680"

// TDA main unit USB port

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

KXTDAUSB_ERROR.h /******************************************************************** * @(#) KXTDAUSB_ERROR.h * Error codes of exported functions. * * Copyright (c) Panasonic Communication Corp. All rights reserved. * *********************************************************************/ #ifndef __KXTDAUSB_ERROR_H__ #define __KXTDAUSB_ERROR_H__ //***************************************************************************** // Error code definition //***************************************************************************** enum { KXTDAUSB_NOERROR = 0 , // No error. KXTDAUSB_NODEVICE = 1 , // Incorrect device name or product name. KXTDAUSB_NOOPEN = 2 , // Not opened. KXTDAUSB_OPENALLREADY = 3 , // Already opened. KXTDAUSB_INIT_ERROR = 4 , // Initialize error. KXTDAUSB_IOCTL_ERROR = 5 , // Not used. KXTDAUSB_DEVICE_REMOVE = 6 , // USB cable is unplugged or the PC goes into sleep mode. KXTDAUSB_READ_ERROR = 7 , // Read error. KXTDAUSB_WRITE_ERROR = 8 , // Write error. KXTDAUSB_READSIZE_ERROR = 9 , // Invalid read size. KXTDAUSB_WRITESIZE_ERROR = 10 , // Invalid write size. KXTDAUSB_SEQUENCE_ERROR = 11 , // Not used KXTDAUSB_RCV_THREAD_BEGIN_ERROR = 12 , // Internal thread creation error. KXTDAUSB_CLOSE_WAITFOR_ERROR = 13 , // An error happen in close function. KXTDAUSB_ERROR_NOT_READY = 14, // Not used KXTDAUSB_ERROR_ACCESS_DENIED = 15, // Not used KXTDAUSB_SEQ_01_ERROR KXTDAUSB_SEQ_02_ERROR KXTDAUSB_SEQ_11_ERROR KXTDAUSB_SEQ_12_ERROR KXTDAUSB_SEQ_20_ERROR KXTDAUSB_SEQ_23_ERROR KXTDAUSB_SEQ_30_ERROR KXTDAUSB_SEQ_33_ERROR }; = 101 = 102 = 111 = 112 = 120 = 123 = 130 = 133 , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error. , // USB packet assemble error.

#endif // __KXTDAUSB_ERROR_H__

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd

10. Restrictions
There are two types of KX-TDA USB driver. One is USB driver for main unit, the other is USB driver for PT (Proprietary Telephone). Each USB driver has several versions. Restriction USB users need to use the same version of USB driver between USB driver for main unit and USB driver for PT, otherwise older version of USB driver does not work. Special caution is needed when a USB user upgrades one type of USB driver.

KX-TDA series PBX PC

USB 1.1
USB Driver for Main Unit

Telephone line USB Driver for PT

USB 1.1
Extension with USB option

All Rights Reserved 2003,2004 Panasonic Communications Co.,Ltd


				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:9766
posted:1/19/2010
language:English
pages:14