/** * BioStation SDK Main API * * @author sjlee@suprema.co.kr * @see */ /* * Copyright (c) 2006 Suprema Co., Ltd. All Rights Reserved. * * This software is the confidential and proprietary information of * Suprema Co., Ltd. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Suprema. */ #ifndef __BS_API_H__ #define __BS_API_H__ #include #include #include "BS_Error.h" #include "BS_Log.h" #include "BS_Display.h" #include "BS_User.h" #include "BS_Config.h" #include "BS_AccessControl.h" #include "BS_Wiegand.h" #include "BS_Server.h" #include "BS_ServerApp.h" #ifdef __cplusplus extern "C" { #endif // // Initialize SDK // __declspec( dllexport ) BS_RET_CODE __stdcall BS_InitSDK(); // // Initialize socket // __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenSocket( const char* biostationAddr, int port, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseSocket( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenSocketUDP( const char* biostationAddr, int port, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseSocketUDP( int handle ); // // Initialize Serial // __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenSerial( const char* port, int baudrate, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseSerial( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenSerial485( const char* port, int baudrate, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseSerial485( int handle ); // // Initialize USB // __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenUSB( int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseUSB( int handle ); // // USB Memory stick // __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenUSBMemory( const char* driveLetter, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseUSBMemory( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteVirtualTerminal( int handle, unsigned terminalID ); // // Basic packet interface // __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendSinglePacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, int timeout ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendBroadcastSinglePacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, int timeout ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReceiveSinglePacket( int handle, int timeout, unsigned short* returnCode, unsigned* param1, unsigned* param2 ); // maximum payload size is 512KB __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendPacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, unsigned char* payload, int payloadSize ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReceivePacket( int handle, int timeout, unsigned char* payload, unsigned* payloadSize, unsigned short* returnCode, unsigned* param1, unsigned* param2 ); // // Terminal information // __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetBiostationID( int handle, unsigned* biostationID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SearchBiostation( int handle, unsigned* IDs, int* numOfBiostation ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetClientIPAddress( int handle, char* ipAddr, unsigned* id, int* port, int timeout ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetBiostationID( int handle, unsigned id ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetTime( int handle, time_t* timeVal ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetTime( int handle, time_t timeVal ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CheckSystemStatus( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_Reset( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_UpgradeEx( int handle, const char* upgradeFile ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_Disable( int handle, int timeout ); // max timeout = 60 sec __declspec( dllexport ) BS_RET_CODE __stdcall BS_Enable( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DisableCommunication( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_EnableCommunication( int handle, const char* masterPassword ); // // Log management // __declspec( dllexport ) BS_RET_CODE __stdcall BS_ClearLogCache( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadLogCache( int handle, int* numOfLog, BSLogRecord* logRecord ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadLog( int handle, time_t startTime, time_t endTime, int* numOfLog, BSLogRecord* logRecord ); // maximum numOfLog = 32768. __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteLog( int handle, int numOfLog, int* numOfDeletedLog ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAllLog( int handle, int numOfLog, int* numOfDeletedLog ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetLogCount( int handle, int* numOfLog ); // // Display Setup // __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendNotice( int handle, const char* msg ); // max message len is 1024 bytes __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetBackground( int handle, int bgIndex, const char* pngFile ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetSlideShow( int handle, int numOfPicture, int imageIndex, const char* pngFile ); // Maximum Slide Show = 32 __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteSlideShow( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetSound( int handle, int soundIndex, const char* wavFile ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteSound( int handle, int soundIndex ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetLanguageFile( int handle, int languageIndex, const char* languageFile ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendNoticeUTF8( int handle, const char* msg ); // max message len is 1024 bytes // // User management // __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetUserDBInfo( int handle, int* numOfUser, int* numOfTemplate ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_EnrollUser( int handle, BSUserHdr* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteUser( int handle, unsigned userID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAllUser( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetUser( int handle, unsigned userID, BSUserHdr* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetUserInfo( int handle, unsigned userID, BSUserHdr* hdr ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllUserInfo( int handle, BSUserHdr* hdr, int *numOfUser ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ScanTemplate( int handle, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadImage( int handle, int imageType, unsigned char* bitmapImage, int* imageLen ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_EnrollUserEx( int handle, BSUserHdrEx* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetUserEx( int handle, unsigned userID, BSUserHdrEx* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetUserInfoEx( int handle, unsigned userID, BSUserHdrEx* hdr ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllUserInfoEx( int handle, BSUserHdrEx* hdr, int *numOfUser ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadCardID( int handle, unsigned int* cardID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadCardIDEx( int handle, unsigned int* cardID, int* customID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetPrivateInfo(int handle, int type, const BSPrivateInfo* privateInfo, const char* imagePath ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetPrivateInfo( int handle, unsigned userID, BSPrivateInfo* privateinfo ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllPrivateInfo( int handle, BSPrivateInfo* privateinfo, int *numOfUser ); // // Configuration // __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteDisplayConfig( int handle, BSDisplayConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadDisplayConfig( int handle, BSDisplayConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteOPModeConfig( int handle, BSOPModeConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadOPModeConfig( int handle, BSOPModeConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteTnaEventConfig( int handle, BSTnaEventConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadTnaEventConfig( int handle, BSTnaEventConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteIPConfig( int handle, BSIPConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadIPConfig( int handle, BSIPConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteWLANConfig( int handle, BSWLANConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadWLANConfig( int handle, BSWLANConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteFingerprintConfig( int handle, BSFingerprintConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadFingerprintConfig( int handle, BSFingerprintConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteIOConfig( int handle, BSIOConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadIOConfig( int handle, BSIOConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteRelayConfig( int handle, BSRelayConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadRelayConfig( int handle, BSRelayConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteSerialConfig( int handle, BSSerialConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadSerialConfig( int handle, BSSerialConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteUSBConfig( int handle, BSUSBConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadUSBConfig( int handle, BSUSBConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteEncryptionConfig( int handle, BSEncryptionConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadEncryptionConfig( int handle, BSEncryptionConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_WriteWiegandConfig( int handle, BSWiegandConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadWiegandConfig( int handle, BSWiegandConfig* config ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAvailableSpace( int handle, int* availableSpace, int* totalSpace ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ReadSysInfoConfig( int handle, BSSysInfoConfig* config ); // // Access Control // __declspec( dllexport ) BS_RET_CODE __stdcall BS_AddTimeSchedule( int handle, BSTimeSchedule* schedule ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteTimeSchedule( int handle, int scheduleID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAllTimeSchedule( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllTimeSchedule( int handle, int* numOfSchedule, BSTimeSchedule* schedule ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_AddHoliday( int handle, BSHoliday* holiday ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteHoliday( int handle, int holidayID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAllHoliday( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllHoliday( int handle, int* numOfHoliday, BSHoliday* holiday ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_AddAccessGroup( int handle, BSAccessGroup* group ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAccessGroup( int handle, int groupID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteAllAccessGroup( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetAllAccessGroup( int handle, int* numOfGroup, BSAccessGroup* group ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_RelayControl( int handle, bool onoff ); // // Encryption // __declspec( dllexport ) void __stdcall BS_SetKey( unsigned char *key ); __declspec( dllexport ) int __stdcall BS_EncryptTemplate( unsigned char *input, unsigned char *output, int length ); __declspec( dllexport ) void __stdcall BS_DecryptTemplate( unsigned char *input, unsigned char *output, int length ); // // Misc // __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetDefaultTimeout( int handle, int timeout ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetInputTimeout( int handle, int timeout ); __declspec( dllexport ) int __stdcall BS_ConvertToUTF8( const char* msg, char* utf8Msg, int limitLen ); __declspec( dllexport ) time_t __stdcall BS_ConvertToLocalTime( time_t utcTime ); // //Server Application __declspec( dllexport ) BS_RET_CODE __stdcall BS_StartServerApp( int port, int maxConnection, char* sslPath, char* sslPassword, int connCheckDuration = KEEP_ALIVE_INTERVAL ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_StopServerApp(); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetCallback( int funtionID, BS_CallbackProc proc ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_IssueCertificate( int handle, unsigned biostationID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_StartLogMonitoring( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetConnectedList( unsigned* biostationList, int* count ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseConnection( unsigned biostationID ); // // Client to Server // __declspec( dllexport ) BS_RET_CODE __stdcall BS_OpenServer( const char* serverAddr, int port, int* handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_CloseServer( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetBiostationList( int handle, int* numOfTerminal, BSTerminal* terminalInfo ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_EnableTerminal( int handle, unsigned biostatioID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DisableTerminal( int handle, unsigned biostatioID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetServerInformation( int handle, BAServerInfo* serverInfo ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetLogMonitorMode( int handle, bool enabled ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_AddRecord( int handle, BS_DB_TYPE dbType, unsigned char* query, int queryLen ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteRecord( int handle, BS_DB_TYPE dbType, unsigned char* query, int queryLen ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_UpdateRecord( int handle, BS_DB_TYPE dbType, unsigned char* query, int queryLen ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SelectRecord( int handle, BS_DB_TYPE dbType, unsigned char* query, int queryLen, unsigned char** recordSet, int* numOfRecord, int* recordSize ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SelectLargeRecord( int handle, BS_DB_TYPE dbType, unsigned char* query, int queryLen, unsigned char** recordSet, int* numOfRecord, int* recordSize, int timeout ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_DeleteMultipleRecord( int handle, int dbType, unsigned char* query, int queryLen, int* indexArray, int numofIndex ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_AddMultipleLogRecord( int handle, int dbType, void* pRecord, int numofRecord, unsigned terminalID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ServerEnrollUser( int handle, unsigned biostationID, UINT32* userID, int numOfUser, UINT32* errorID ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_GetPrivateImage( int handle, unsigned userID, unsigned char* imageBuf, unsigned *imageLen, unsigned nBuffSize ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SetPrivateImage( int handle, unsigned userID, const char* pngFile ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_BackupMDB( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_ExitServer( int handle ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_SendServerCommand( int handle, BA_SERVER_COMMAND command ); __declspec( dllexport ) BS_RET_CODE __stdcall BS_RemoveTerminalFromServer( int handle, unsigned biostationID ); #ifdef __cplusplus } #endif #endif