www.pudn.com > lightlamp.rar > ZBDLLApi.h


/* 
** ============================================================================ 
** 
** FILE 
**  ZBDLLApi.cpp 
** 
** DESCRIPTION 
**  The Functions that are exported in the ZigBee Dynamic Link Library 
** 
** CREATED 
**  I.A.Marsden Integration UK Ltd 
** 
** COPYRIGHT 
**  Copyright 2005 Integration Associates Inc.  All rights reserved. 
**  
** LIMITED USE LICENSE.   
**  By using this software, the user agrees to the terms of the following license.   
**  If the user does not agree to these terms, then this software should be  
**  returned within 30 days and a full refund of the purchase price or license fee  
**  will provided.  Integration Associates hereby grants a license to the user on  
**  the following terms and conditions:  The user may use, copy, modify, revise,  
**  translate, abridge, condense, expand, collect, compile, link, recast, distribute,  
**  transform or adapt this software solely in connection with the development of  
**  products incorporating integrated circuits sold by Integration Associates.   
**  Any other use for any other purpose is expressly prohibited with the prior  
**  written consent of Integration Associates. 
** 
**  Any copy or modification made must satisfy the following conditions: 
**  
**  1. Both the copyright notice and this permission notice appear in all   
**  copies of the software, derivative works or modified versions, and any   
**  portions thereof, and that both notices appear in supporting documentation. 
** 
**  2. All copies of the software shall contain the following acknowledgement:  
**  “Portions of this software are used under license from Integration 
**  Associates Inc. and are copyrighted.” 
** 
**  3. Neither the name of Integration Associates Inc. nor any of its  
**  subsidiaries may be used to endorse or promote products derived from this  
**  software without specific prior written permission. 
**   
**  THIS SOFTWARE IS PROVIDED BY “AS IS” AND ALL WARRANTIES OF ANY KIND,  
**  INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR USE,  
**  ARE EXPRESSLY DISCLAIMED.  THE DEVELOPER SHALL NOT BE LIABLE FOR ANY  
**  DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.   
**  THIS SOFTWARE MAY NOT BE USED IN PRODUCTS INTENDED FOR USE IN  
**  IMPLANTATION OR OTHER DIRECT LIFE SUPPORT APPLICATIONS WHERE MALFUNCTION  
**  MAY RESULT IN THE DIRECT PHYSICAL HARM OR INJURY TO PERSONS.   
**  ALL SUCH USE IS EXPRESSLY PROHIBITED. 
** 
** ============================================================================ 
*/ 
#ifdef __cplusplus 
extern "C" { 
#endif  /* __cplusplus */ 
 
/* 
** ============================================================================ 
** USB Config String Format Example 
** "00:0d:eb:00:00:00:00:01\0" IEEEAddr 0x000deb0000000001 
** ============================================================================ 
** COM Config String Format Example 
** "10:115200\0" Com port 10 baud rate 115200 
** ============================================================================ 
** Ethernet Config String Format Example 
** "192.168.189.001:1212\0" Target is 192.168.189.001 Port 1212 
** ============================================================================ 
*/   
 
/* 
** ============================================================================ 
** Device Type Codes 
** ============================================================================ 
*/ 
#define CONNECT_ERROR       0 
#define CONNECT_USB         1 
#define CONNECT_IP          2 
#define CONNECT_COM         3 
#define CONNECT_DIRECT      4 
 
/* 
** ============================================================================ 
** Status Codes Returned 
** ============================================================================ 
*/ 
#define STK_SUCCESS           0 
#define STK_STATUS_BASE       1000 
#define STK_DEVICE_REMOVED    1005 
#define STK_DEVICE_INSERTED   1006 
#define STK_NO_DEVICE         1010 
#define STK_PORT_INVALID      1011 
#define STK_BAUD_INVALID      1012 
#define STK_DEVICE_CONNECTED  1013 
 
/* 
** ============================================================================ 
** Version Codes Returned 
** ============================================================================ 
*/ 
#define DEVICE_VER1           1 
#define DEVICE_VER2           2 
 
/* 
** ============================================================================ 
** WINDOWS MESSAGE Defines used to receive data 
** ============================================================================ 
*/ 
// The receive data windows message called if a NULL callback is provided during connect 
#define WM_STK_RECEIVE        WM_USER+1  
#define WM_ZB_RECEIVE         WM_USER+2 
#define WM_ZB_DEBUG           WM_USER+3 
 
/* 
** ============================================================================ 
** Callback Type Definitions 
** ============================================================================ 
*/ 
typedef void (__stdcall *ZBCallbackFn)( unsigned char msglength, unsigned char* msg ); 
 
/* 
** ============================================================================ 
** Type definitions for the functions 
** ============================================================================ 
*/ 
typedef int (WINAPI *ZBPnpEvent_t)( WPARAM wParam, LPARAM lParam );  
typedef int (WINAPI *ZBConnect_t)( LPARAM hWnd, ZBCallbackFn rfn, int DevType, PCHAR DevAddr, ZBCallbackFn dfn );  
typedef int (WINAPI *ZBDisconnect_t)( void );  
typedef int (WINAPI *ZBSend_t)( unsigned char msglength, unsigned char* msg );  
typedef int (WINAPI *ZBTick32Hz_t)( void );  
 
/* 
** ============================================================================ 
** API Function Prototypes 
** ============================================================================ 
*/ 
int WINAPI ZBPnpEvent(WPARAM wParam,LPARAM lParam); 
int WINAPI ZBConnect(LPARAM hWnd, ZBCallbackFn rfn, int DevType, PCHAR DevAddr, ZBCallbackFn dfn); 
int WINAPI ZBDisconnect(); 
int WINAPI ZBSend(UCHAR msglength, UCHAR* msg); 
int WINAPI ZBTick32Hz( void ); 
 
#ifdef __cplusplus 
} 
#endif