/** * 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_CommChannel.h" #include "BS_Socket.h" #include "BS_SocketUDP.h" #include "BS_Serial.h" #include "BS_Serial485.h" #include "BS_USB.h" #include "BS_Packet.h" #include "BS_Command.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" #ifdef __cplusplus extern "C" { #endif // // Initialize SDK // __declspec( dllexport ) BS_RET_CODE BS_InitSDK(); // // Initialize socket // __declspec( dllexport ) BS_RET_CODE BS_OpenSocket( const char* biostationAddr, int port, int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseSocket( int handle ); __declspec( dllexport ) BS_RET_CODE BS_OpenSocketUDP( const char* biostationAddr, int port, int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseSocketUDP( int handle ); // // Initialize Serial // __declspec( dllexport ) BS_RET_CODE BS_OpenSerial( const char* port, int baudrate, int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseSerial( int handle ); __declspec( dllexport ) BS_RET_CODE BS_OpenSerial485( const char* port, int baudrate, int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseSerial485( int handle ); // // Initialize USB // __declspec( dllexport ) BS_RET_CODE BS_OpenUSB( int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseUSB( int handle ); // // USB Memory stick // __declspec( dllexport ) BS_RET_CODE BS_OpenUSBMemory( const char* driveLetter, int* handle ); __declspec( dllexport ) BS_RET_CODE BS_CloseUSBMemory( int handle ); __declspec( dllexport ) BS_RET_CODE BS_DeleteVirtualTerminal( int handle, unsigned terminalID ); // // Basic packet interface // __declspec( dllexport ) BS_RET_CODE BS_SendSinglePacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, int timeout ); __declspec( dllexport ) BS_RET_CODE BS_SendBroadcastSinglePacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, int timeout ); __declspec( dllexport ) BS_RET_CODE BS_ReceiveSinglePacket( int handle, int timeout, unsigned short* returnCode, unsigned* param1, unsigned* param2 ); // maximum payload size is 512KB __declspec( dllexport ) BS_RET_CODE BS_SendPacket( int handle, unsigned short command, unsigned short flag, unsigned param1, unsigned param2, unsigned char* payload, int payloadSize ); __declspec( dllexport ) BS_RET_CODE 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 BS_GetBiostationID( int handle, unsigned* biostationID ); __declspec( dllexport ) BS_RET_CODE BS_SearchBiostation( int handle, unsigned* IDs, int* numOfBiostation ); __declspec( dllexport ) BS_RET_CODE BS_GetClientIPAddress( int handle, char* ipAddr, unsigned* id, int* port, int timeout ); __declspec( dllexport ) BS_RET_CODE BS_SetBiostationID( int handle, unsigned id ); __declspec( dllexport ) BS_RET_CODE BS_GetTime( int handle, time_t* timeVal ); __declspec( dllexport ) BS_RET_CODE BS_SetTime( int handle, time_t timeVal ); __declspec( dllexport ) BS_RET_CODE BS_CheckSystemStatus( int handle ); __declspec( dllexport ) BS_RET_CODE BS_Reset( int handle ); __declspec( dllexport ) BS_RET_CODE BS_UpgradeEx( int handle, const char* upgradeFile ); __declspec( dllexport ) BS_RET_CODE BS_Disable( int handle, int timeout ); // max timeout = 60 sec __declspec( dllexport ) BS_RET_CODE BS_Enable( int handle ); __declspec( dllexport ) BS_RET_CODE BS_DisableCommunication( int handle ); __declspec( dllexport ) BS_RET_CODE BS_EnableCommunication( int handle, const char* masterPassword ); // // Log management // __declspec( dllexport ) BS_RET_CODE BS_ClearLogCache( int handle ); __declspec( dllexport ) BS_RET_CODE BS_ReadLogCache( int handle, int* numOfLog, BSLogRecord* logRecord ); __declspec( dllexport ) BS_RET_CODE BS_ReadLog( int handle, time_t startTime, time_t endTime, int* numOfLog, BSLogRecord* logRecord ); // maximum numOfLog = 32768. __declspec( dllexport ) BS_RET_CODE BS_DeleteLog( int handle, int numOfLog, int* numOfDeletedLog ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAllLog( int handle, int* numOfDeletedLog ); __declspec( dllexport ) BS_RET_CODE BS_GetLogCount( int handle, int* numOfLog ); // // Display Setup // __declspec( dllexport ) BS_RET_CODE BS_SendNotice( int handle, const char* msg ); // max message len is 1024 bytes __declspec( dllexport ) BS_RET_CODE BS_SetBackground( int handle, int bgIndex, const char* pngFile ); __declspec( dllexport ) BS_RET_CODE BS_SetSlideShow( int handle, int numOfPicture, int imageIndex, const char* pngFile ); // Maximum Slide Show = 32 __declspec( dllexport ) BS_RET_CODE BS_DeleteSlideShow( int handle ); __declspec( dllexport ) BS_RET_CODE BS_SetSound( int handle, int soundIndex, const char* wavFile ); __declspec( dllexport ) BS_RET_CODE BS_SetLanguageFile( int handle, int languageIndex, const char* languageFile ); // // User management // __declspec( dllexport ) BS_RET_CODE BS_GetUserDBInfo( int handle, int* numOfUser, int* numOfTemplate ); __declspec( dllexport ) BS_RET_CODE BS_EnrollUser( int handle, BSUserHdr* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE BS_DeleteUser( int handle, unsigned userID ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAllUser( int handle ); __declspec( dllexport ) BS_RET_CODE BS_GetUser( int handle, unsigned userID, BSUserHdr* hdr, unsigned char* templateData ); __declspec( dllexport ) BS_RET_CODE BS_GetUserInfo( int handle, unsigned userID, BSUserHdr* hdr ); __declspec( dllexport ) BS_RET_CODE BS_GetAllUserInfo( int handle, BSUserHdr* hdr, int *numOfUser ); __declspec( dllexport ) BS_RET_CODE BS_ScanTemplate( int handle, unsigned char* templateData ); // // Configuration // __declspec( dllexport ) BS_RET_CODE BS_WriteDisplayConfig( int handle, BSDisplayConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadDisplayConfig( int handle, BSDisplayConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteOPModeConfig( int handle, BSOPModeConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadOPModeConfig( int handle, BSOPModeConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteTnaEventConfig( int handle, BSTnaEventConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadTnaEventConfig( int handle, BSTnaEventConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteIPConfig( int handle, BSIPConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadIPConfig( int handle, BSIPConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteWLANConfig( int handle, BSWLANConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadWLANConfig( int handle, BSWLANConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteFingerprintConfig( int handle, BSFingerprintConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadFingerprintConfig( int handle, BSFingerprintConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteIOConfig( int handle, BSIOConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadIOConfig( int handle, BSIOConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteRelayConfig( int handle, BSRelayConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadRelayConfig( int handle, BSRelayConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteSerialConfig( int handle, BSSerialConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadSerialConfig( int handle, BSSerialConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteUSBConfig( int handle, BSUSBConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadUSBConfig( int handle, BSUSBConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteEncryptionConfig( int handle, BSEncryptionConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadEncryptionConfig( int handle, BSEncryptionConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_WriteWiegandConfig( int handle, BSWiegandConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_ReadWiegandConfig( int handle, BSWiegandConfig* config ); __declspec( dllexport ) BS_RET_CODE BS_GetAvailableSpace( int handle, int* availableSpace, int* totalSpace ); __declspec( dllexport ) BS_RET_CODE BS_WriteConfig( int handle, int configType, int size, void* data ); __declspec( dllexport ) BS_RET_CODE BS_ReadConfig( int handle, int configType, int* size, void* data ); // // Access Control // __declspec( dllexport ) BS_RET_CODE BS_AddTimeSchedule( int handle, BSTimeSchedule* schedule ); __declspec( dllexport ) BS_RET_CODE BS_DeleteTimeSchedule( int handle, int scheduleID ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAllTimeSchedule( int handle ); __declspec( dllexport ) BS_RET_CODE BS_GetAllTimeSchedule( int handle, int* numOfSchedule, BSTimeSchedule* schedule ); __declspec( dllexport ) BS_RET_CODE BS_AddHoliday( int handle, BSHoliday* holiday ); __declspec( dllexport ) BS_RET_CODE BS_DeleteHoliday( int handle, int holidayID ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAllHoliday( int handle ); __declspec( dllexport ) BS_RET_CODE BS_GetAllHoliday( int handle, int* numOfHoliday, BSHoliday* holiday ); __declspec( dllexport ) BS_RET_CODE BS_AddAccessGroup( int handle, BSAccessGroup* group ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAccessGroup( int handle, int groupID ); __declspec( dllexport ) BS_RET_CODE BS_DeleteAllAccessGroup( int handle ); __declspec( dllexport ) BS_RET_CODE BS_GetAllAccessGroup( int handle, int* numOfGroup, BSAccessGroup* group ); // // Encryption // __declspec( dllexport ) void BS_SetKey( unsigned char *key ); __declspec( dllexport ) int BS_EncryptTemplate( unsigned char *input, unsigned char *output, int length ); __declspec( dllexport ) void BS_DecryptTemplate( unsigned char *input, unsigned char *output, int length ); // // Misc // __declspec( dllexport ) BS_RET_CODE BS_SetDefaultTimeout( int handle, int timeout ); __declspec( dllexport ) BS_RET_CODE BS_SetInputTimeout( int handle, int timeout ); __declspec( dllexport ) int BS_ConvertToUTF8( const char* msg, char* utf8Msg, int limitLen ); __declspec( dllexport ) time_t BS_ConvertToLocalTime( time_t utcTime ); #ifdef __cplusplus } #endif #endif