📄 hsmsd_cli.h
字号:
/* * (c) Copyright 2008 Philipp Skadorov (philipp_s@users.sourceforge.net) * * This file is part of FREESECS. * * FREESECS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * FREESECS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with FREESECS, see COPYING. * If not, see <http://www.gnu.org/licenses/>. */#ifndef _HSMSD_CLI_H#define _HSMSD_CLI_Htypedef long int hsmsd_handle_t;/** * \brief HSMS cnx state define */typedef enum{ CNX_NOT_CONNECTED, CNX_NOT_SELECTED, CNX_SELECTED}hsmsd_cnx_state_t;/** * \brief HSMS message define * \param data the first element of HSMS text array. the message shoud be allocated with malloc(sizeof(hsms_msg_t)+hsms_text_len) */typedef struct{ unsigned short stream; unsigned short function; unsigned char wbit; unsigned int sysbytes; unsigned int data_len; unsigned char data[1];} hsmsd_msg_t;#ifdef __cplusplusextern "C" {#endif/** * \brief HSMS message callback handler typedef */typedef void (*hsmsd_msg_handler_t)(hsmsd_msg_t*);/** * \brief HSMS cnx state change callback handler typedef */typedef void (*hsmsd_cnx_state_handler_t)(hsmsd_cnx_state_t);/** * \brief HSMS cnx error callback handler typedef */typedef void (*hsmsd_cnx_error_handler_t)(int);/** * \brief Get a headle to HSMS cnx */int hsmsd_alloc_handle (hsmsd_handle_t *ph, const char *cnx_name);/** * \brief Free a headle to HSMS cnx */int hsmsd_free_handle (hsmsd_handle_t *ph);/** * \brief Subscribe for messages from HSMS cnx by it's handle */int hsmsd_subscribe_for_msgs (hsmsd_handle_t h, hsmsd_msg_handler_t mh);/** * \brief Unsubscribe for messages from HSMS cnx by it's handle */int hsmsd_unsubscribe_for_msgs (hsmsd_handle_t h);/** * \brief Subscribe for state change by HSMS cnx by it's handle */int hsmsd_subscribe_for_cnx_state (hsmsd_handle_t h, hsmsd_cnx_state_handler_t sh);/** * \brief Unsubscribe for state change by HSMS cnx by it's handle */int hsmsd_unsubscribe_for_cnx_state (hsmsd_handle_t h);/** * \brief Subscribe for HSMS cnx error events by it's handle */int hsmsd_subscribe_for_cnx_error (hsmsd_handle_t h, hsmsd_cnx_error_handler_t);/** * \brief Unsubscribe for HSMS cnx error events by it's handle */int hsmsd_unsubscribe_for_cnx_error (hsmsd_handle_t h);/** * \brief Start HSMS cnx */int hsmsd_cnx_start (hsmsd_handle_t h);/** * \brief Stop HSMS cnx */int hsmsd_cnx_stop (hsmsd_handle_t h);/** * \brief Get HSMS cnx state */int hsmsd_cnx_get_state (hsmsd_handle_t h, hsmsd_cnx_state_t *pstate);/** * \brief Send HSMS message over HSMS cnx */int hsmsd_cnx_send_msg (hsmsd_handle_t h, hsmsd_msg_t *pmsg);#ifdef __cplusplus}#endif#endif /*_HSMSD_CLI_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -