12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef __MODBUS_MASTER_H__
- #define __MODBUS_MASTER_H__
- #include "modbus_common.h"
- //默认周期命令池大小为20
- //可以在编译器predefine里面重定义大小
- #ifndef MODBUS_MASTER_PERIOD_POOL_SIZE
- #define MODBUS_MASTER_PERIOD_POOL_SIZE 20
- #endif
- //默认周期命令池大小为20
- //可以在编译器predefine里面重定义大小
- #ifndef MODBUS_MASTER_ONCE_POOL_SIZE
- #define MODBUS_MASTER_ONCE_POOL_SIZE 10
- #endif
- void modbus_master_init(void);
- int modbus_master_run(modbus_master_t * master, unsigned char * request,unsigned char * respone, int length);
- modbus_master_period_cmd_t * modbus_master_add_period_cmd(
- modbus_master_t * master,
- unsigned char id,
- unsigned char cmd,
- unsigned short address,
- unsigned short number,
- unsigned char * value,
- int respone_timeout,
- void (*on_respone)(modbus_master_cmd_t * , unsigned char * ,int),
- int period
- );
- modbus_master_once_cmd_t * modbus_master_add_once_cmd(
- modbus_master_t * master,
- unsigned char id,
- unsigned char cmd,
- unsigned short address,
- unsigned short number,
- unsigned char * value,
- int respone_timeout,
- void (*on_respone)(modbus_master_cmd_t * , unsigned char * ,int)
- );
- #endif
|