|
|
@ -193,15 +193,23 @@ IsoClientConnection_create(IsoConnectionParameters parameters, IsoIndicationCall
|
|
|
|
static bool
|
|
|
|
static bool
|
|
|
|
sendConnectionRequestMessage(IsoClientConnection self)
|
|
|
|
sendConnectionRequestMessage(IsoClientConnection self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
int socketExtensionBufferSize = CONFIG_MMS_MAXIMUM_PDU_SIZE + 1000;
|
|
|
|
|
|
|
|
uint8_t* socketExtensionBuffer = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (self->cotpConnection) {
|
|
|
|
if (self->cotpConnection) {
|
|
|
|
/* Destroy existing handle set when connection is reused */
|
|
|
|
/* Destroy existing handle set when connection is reused */
|
|
|
|
if (self->cotpConnection->handleSet)
|
|
|
|
if (self->cotpConnection->handleSet)
|
|
|
|
Handleset_destroy(self->cotpConnection->handleSet);
|
|
|
|
Handleset_destroy(self->cotpConnection->handleSet);
|
|
|
|
self->cotpConnection->handleSet = NULL;
|
|
|
|
self->cotpConnection->handleSet = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socketExtensionBuffer = self->cotpConnection->socketExtensionBuffer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int socketExtensionBufferSize = CONFIG_MMS_MAXIMUM_PDU_SIZE + 1000;
|
|
|
|
if (socketExtensionBuffer == NULL) {
|
|
|
|
uint8_t* socketExtensionBuffer = (uint8_t*)GLOBAL_MALLOC(socketExtensionBufferSize);
|
|
|
|
socketExtensionBuffer = (uint8_t*)GLOBAL_MALLOC(socketExtensionBufferSize);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (socketExtensionBuffer) {
|
|
|
|
|
|
|
|
|
|
|
|
/* COTP (ISO transport) handshake */
|
|
|
|
/* COTP (ISO transport) handshake */
|
|
|
|
CotpConnection_init(self->cotpConnection, self->socket, self->receiveBuffer, self->cotpReadBuffer, self->cotpWriteBuffer,
|
|
|
|
CotpConnection_init(self->cotpConnection, self->socket, self->receiveBuffer, self->cotpReadBuffer, self->cotpWriteBuffer,
|
|
|
@ -235,6 +243,13 @@ sendConnectionRequestMessage(IsoClientConnection self)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (DEBUG_ISO_CLIENT)
|
|
|
|
|
|
|
|
printf("ISO_CLIENT: Failed to allocate socket extension buffer\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
static void
|
|
|
@ -755,7 +770,6 @@ IsoClientConnection_close(IsoClientConnection self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
IsoClientConnection_destroy(IsoClientConnection self)
|
|
|
|
IsoClientConnection_destroy(IsoClientConnection self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|