|
|
|
@ -77,6 +77,7 @@ struct sIsoClientConnection
|
|
|
|
|
volatile int state;
|
|
|
|
|
Semaphore stateMutex;
|
|
|
|
|
|
|
|
|
|
uint32_t readTimeoutInMs; /* read timeout in ms */
|
|
|
|
|
uint64_t nextReadTimeout; /* timeout value for read and connect */
|
|
|
|
|
|
|
|
|
|
Socket socket;
|
|
|
|
@ -322,7 +323,7 @@ IsoClientConnection_handleConnection(IsoClientConnection self)
|
|
|
|
|
|
|
|
|
|
if (socketState == SOCKET_STATE_CONNECTED) {
|
|
|
|
|
if (sendConnectionRequestMessage(self)) {
|
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + CONFIG_TCP_READ_TIMEOUT_MS;
|
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + self->readTimeoutInMs;
|
|
|
|
|
nextState = INT_STATE_WAIT_FOR_COTP_CONNECT_RESP;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -392,7 +393,7 @@ IsoClientConnection_handleConnection(IsoClientConnection self)
|
|
|
|
|
else {
|
|
|
|
|
sendAcseInitiateRequest(self);
|
|
|
|
|
|
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + CONFIG_TCP_READ_TIMEOUT_MS;
|
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + self->readTimeoutInMs;
|
|
|
|
|
|
|
|
|
|
nextState = INT_STATE_WAIT_FOR_ACSE_RESP;
|
|
|
|
|
}
|
|
|
|
@ -426,7 +427,7 @@ IsoClientConnection_handleConnection(IsoClientConnection self)
|
|
|
|
|
|
|
|
|
|
self->callback(ISO_IND_ASSOCIATION_FAILED, self->callbackParameter, NULL);
|
|
|
|
|
|
|
|
|
|
nextState = INT_STATE_ERROR;
|
|
|
|
|
nextState = INT_STATE_CLOSE_ON_ERROR;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
@ -634,7 +635,7 @@ IsoClientConnection_handleConnection(IsoClientConnection self)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTimeoutInMs)
|
|
|
|
|
IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTimeoutInMs, uint32_t readTimeoutInMs)
|
|
|
|
|
{
|
|
|
|
|
Semaphore_wait(self->tickMutex);
|
|
|
|
|
|
|
|
|
@ -659,6 +660,9 @@ IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTim
|
|
|
|
|
CONFIG_TCP_KEEPALIVE_CNT);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* set read timeout */
|
|
|
|
|
self->readTimeoutInMs = readTimeoutInMs;
|
|
|
|
|
|
|
|
|
|
/* set timeout for connect */
|
|
|
|
|
self->nextReadTimeout = Hal_getTimeInMs() + connectTimeoutInMs;
|
|
|
|
|
|
|
|
|
|