Handle bigger modbus messages
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#define PROTOCOL_NAME "MODBUS_AP"
|
||||
#define PROTOCOL_INIT MODBUSInitProtocol
|
||||
#define ADUSIZE 17
|
||||
#define ADUSIZE 300
|
||||
|
||||
/*
|
||||
* MODBUS DataTypes
|
||||
@ -63,7 +63,7 @@ struct modbus_private_t {
|
||||
int aduLen;
|
||||
int RespLen;
|
||||
int DatLen;
|
||||
unsigned char ADU[ADUSIZE]; /* Allows upto 8 bytes if data */
|
||||
unsigned char ADU[ADUSIZE]; /* Allows up to 255 bytes of data */
|
||||
pDynString rdBuffer;
|
||||
};
|
||||
|
||||
@ -89,6 +89,10 @@ static ProtoPrivate *makeProtoPrivate()
|
||||
static ProtoPrivate *Proto_KillPrivate(ProtoPrivate *priv)
|
||||
{
|
||||
if (priv) {
|
||||
if (priv->wrBuffer) {
|
||||
DeleteDynString(priv->wrBuffer);
|
||||
priv->wrBuffer = NULL;
|
||||
}
|
||||
if (priv->rxBuffer) {
|
||||
DeleteDynString(priv->rxBuffer);
|
||||
priv->rxBuffer = NULL;
|
||||
@ -268,7 +272,7 @@ static int ModbusOutput(pPrivate myPriv, pDynString wrBuffer, pDynString send_bu
|
||||
int ADUlen, PDUlenPlusUID;
|
||||
unsigned int i, j;
|
||||
char *cmdLine;
|
||||
unsigned char ADU[32], ieee[4];
|
||||
unsigned char ADU[ADUSIZE], ieee[4];
|
||||
|
||||
cmdLine = GetCharArray(wrBuffer);
|
||||
for (i=0; i < 4; i++)
|
||||
|
Reference in New Issue
Block a user