|
|
|
@ -281,7 +281,7 @@ removeFromOutstandingCalls(MmsConnection self, uint32_t invokeId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ByteBuffer*
|
|
|
|
|
sendRequestAndWaitForResponse(MmsConnection self, uint32_t invokeId, ByteBuffer* message)
|
|
|
|
|
sendRequestAndWaitForResponse(MmsConnection self, uint32_t invokeId, ByteBuffer* message, MmsError* mmsError)
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* receivedMessage = NULL;
|
|
|
|
|
|
|
|
|
@ -291,7 +291,12 @@ sendRequestAndWaitForResponse(MmsConnection self, uint32_t invokeId, ByteBuffer*
|
|
|
|
|
|
|
|
|
|
bool success = false;
|
|
|
|
|
|
|
|
|
|
addToOutstandingCalls(self, invokeId);
|
|
|
|
|
if (addToOutstandingCalls(self, invokeId) == false) {
|
|
|
|
|
*mmsError = MMS_ERROR_OUTSTANDING_CALL_LIMIT;
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_RAW_MESSAGE_LOGGING == 1)
|
|
|
|
|
if (self->rawMmsMessageHandler != NULL) {
|
|
|
|
@ -305,8 +310,10 @@ sendRequestAndWaitForResponse(MmsConnection self, uint32_t invokeId, ByteBuffer*
|
|
|
|
|
while (currentTime < waitUntilTime) {
|
|
|
|
|
uint32_t receivedInvokeId;
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED) {
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
goto connection_lost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Semaphore_wait(self->lastResponseLock);
|
|
|
|
|
|
|
|
|
@ -331,7 +338,14 @@ sendRequestAndWaitForResponse(MmsConnection self, uint32_t invokeId, ByteBuffer*
|
|
|
|
|
if (!success) {
|
|
|
|
|
if (DEBUG_MMS_CLIENT)
|
|
|
|
|
printf("MMS_CLIENT: TIMEOUT for request %u: \n", invokeId);
|
|
|
|
|
self->lastResponseError = MMS_ERROR_SERVICE_TIMEOUT;
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_SERVICE_TIMEOUT;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
|
|
|
|
|
if (*mmsError != MMS_ERROR_NONE)
|
|
|
|
|
receivedMessage = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connection_lost:
|
|
|
|
@ -1248,8 +1262,6 @@ mmsClient_getNameListSingleRequest(
|
|
|
|
|
goto exit_function;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
@ -1267,19 +1279,13 @@ mmsClient_getNameListSingleRequest(
|
|
|
|
|
payload, objectClass, continueAfter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
moreFollows = mmsClient_parseGetNameListResponse(nameList, self->lastResponse, NULL);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return moreFollows;
|
|
|
|
|
}
|
|
|
|
@ -1361,24 +1367,17 @@ MmsConnection_readVariable(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createReadRequest(invokeId, domainId, itemId, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
value = mmsClient_parseReadResponse(self->lastResponse, NULL, false);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
@ -1397,25 +1396,18 @@ MmsConnection_readArrayElements(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createReadRequestAlternateAccessIndex(invokeId, domainId, itemId, startIndex,
|
|
|
|
|
numberOfElements, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
value = mmsClient_parseReadResponse(self->lastResponse, NULL, false);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
@ -1433,24 +1425,17 @@ MmsConnection_readMultipleVariables(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createReadRequestMultipleValues(invokeId, domainId, items, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
value = mmsClient_parseReadResponse(self->lastResponse, NULL, true);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
@ -1469,27 +1454,18 @@ MmsConnection_readNamedVariableListValues(MmsConnection self, MmsError* mmsError
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createReadNamedVariableListRequest(invokeId, domainId, listName,
|
|
|
|
|
payload, specWithResult);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE) {
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
}
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
value = mmsClient_parseReadResponse(self->lastResponse, NULL, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
@ -1509,25 +1485,18 @@ MmsConnection_readNamedVariableListValuesAssociationSpecific(
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createReadAssociationSpecificNamedVariableListRequest(invokeId, listName,
|
|
|
|
|
payload, specWithResult);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
value = mmsClient_parseReadResponse(self->lastResponse, NULL, true);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
@ -1545,26 +1514,19 @@ MmsConnection_readNamedVariableListDirectory(MmsConnection self, MmsError* mmsEr
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createGetNamedVariableListAttributesRequest(invokeId, payload, domainId,
|
|
|
|
|
listName);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
attributes = mmsClient_parseGetNamedVariableListAttributesResponse(self->lastResponse, NULL,
|
|
|
|
|
deletable);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return attributes;
|
|
|
|
|
}
|
|
|
|
@ -1582,26 +1544,19 @@ MmsConnection_readNamedVariableListDirectoryAssociationSpecific(MmsConnection se
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createGetNamedVariableListAttributesRequestAssociationSpecific(invokeId, payload,
|
|
|
|
|
listName);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
attributes = mmsClient_parseGetNamedVariableListAttributesResponse(self->lastResponse, NULL,
|
|
|
|
|
deletable);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return attributes;
|
|
|
|
|
}
|
|
|
|
@ -1617,26 +1572,19 @@ MmsConnection_defineNamedVariableList(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createDefineNamedVariableListRequest(invokeId, payload, domainId,
|
|
|
|
|
listName, variableSpecs, false);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
if (!mmsClient_parseDefineNamedVariableResponse(self->lastResponse, NULL))
|
|
|
|
|
*mmsError = MMS_ERROR_DEFINITION_OTHER;
|
|
|
|
|
*mmsError = MMS_ERROR_PARSING_RESPONSE;
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1652,25 +1600,19 @@ MmsConnection_defineNamedVariableListAssociationSpecific(MmsConnection self,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createDefineNamedVariableListRequest(invokeId, payload, NULL,
|
|
|
|
|
listName, variableSpecs, true);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
if (!mmsClient_parseDefineNamedVariableResponse(self->lastResponse, NULL))
|
|
|
|
|
*mmsError = MMS_ERROR_DEFINITION_OTHER;
|
|
|
|
|
*mmsError = MMS_ERROR_PARSING_RESPONSE;
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return;
|
|
|
|
@ -1689,25 +1631,18 @@ MmsConnection_deleteNamedVariableList(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createDeleteNamedVariableListRequest(invokeId, payload, domainId, listName);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
if (mmsClient_parseDeleteNamedVariableListResponse(self->lastResponse, NULL))
|
|
|
|
|
isDeleted = true;
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return isDeleted;
|
|
|
|
|
}
|
|
|
|
@ -1725,26 +1660,19 @@ MmsConnection_deleteAssociationSpecificNamedVariableList(MmsConnection self,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createDeleteAssociationSpecificNamedVariableListRequest(
|
|
|
|
|
invokeId, payload, listName);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
if (mmsClient_parseDeleteNamedVariableListResponse(self->lastResponse, NULL))
|
|
|
|
|
isDeleted = true;
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return isDeleted;
|
|
|
|
|
}
|
|
|
|
@ -1762,24 +1690,17 @@ MmsConnection_getVariableAccessAttributes(MmsConnection self, MmsError* mmsError
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createGetVariableAccessAttributesRequest(invokeId, domainId, itemId, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
typeSpec = mmsClient_parseGetVariableAccessAttributesResponse(self->lastResponse, NULL);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return typeSpec;
|
|
|
|
|
}
|
|
|
|
@ -1796,24 +1717,17 @@ MmsConnection_identify(MmsConnection self, MmsError* mmsError)
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createIdentifyRequest(invokeId, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
identity = mmsClient_parseIdentifyResponse(self);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
|
return identity;
|
|
|
|
|
}
|
|
|
|
@ -1824,41 +1738,28 @@ MmsConnection_getServerStatus(MmsConnection self, MmsError* mmsError, int* vmdLo
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createStatusRequest(invokeId, payload, extendedDerivation);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
if (mmsClient_parseStatusResponse(self, vmdLogicalStatus, vmdPhysicalStatus) == false)
|
|
|
|
|
*mmsError = MMS_ERROR_PARSING_RESPONSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static LinkedList
|
|
|
|
|
readJournal(MmsConnection self, MmsError* mmsError, uint32_t invokeId, ByteBuffer* payload, bool* moreFollows)
|
|
|
|
|
{
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
LinkedList response = NULL;
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
|
|
|
|
|
if (mmsClient_parseReadJournalResponse(self, moreFollows, &response) == false)
|
|
|
|
|
*mmsError = MMS_ERROR_PARSING_RESPONSE;
|
|
|
|
@ -1866,9 +1767,6 @@ readJournal(MmsConnection self, MmsError* mmsError, uint32_t invokeId, ByteBuff
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1972,19 +1870,15 @@ MmsConnection_fileOpen(MmsConnection self, MmsError* mmsError, const char* filen
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
int32_t frsmId = -1;
|
|
|
|
|
|
|
|
|
|
mmsClient_createFileOpenRequest(invokeId, payload, filename, initialPosition);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
|
|
|
|
|
uint8_t* buffer = self->lastResponse->buffer;
|
|
|
|
|
int maxBufPos = self->lastResponse->size;
|
|
|
|
@ -1996,9 +1890,6 @@ MmsConnection_fileOpen(MmsConnection self, MmsError* mmsError, const char* filen
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return frsmId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2007,23 +1898,15 @@ MmsConnection_fileClose(MmsConnection self, MmsError* mmsError, int32_t frsmId)
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createFileCloseRequest(invokeId, payload, frsmId);
|
|
|
|
|
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
mmsClient_createFileCloseRequest(invokeId, payload, frsmId);
|
|
|
|
|
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -2031,24 +1914,15 @@ MmsConnection_fileDelete(MmsConnection self, MmsError* mmsError, const char* fil
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createFileDeleteRequest(invokeId, payload, fileName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
mmsClient_createFileDeleteRequest(invokeId, payload, fileName);
|
|
|
|
|
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
@ -2057,18 +1931,14 @@ MmsConnection_fileRead(MmsConnection self, MmsError* mmsError, int32_t frsmId, M
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
bool moreFollows = false;
|
|
|
|
|
mmsClient_createFileReadRequest(invokeId, payload, frsmId);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
uint8_t* buffer = self->lastResponse->buffer;
|
|
|
|
|
int maxBufPos = self->lastResponse->size;
|
|
|
|
|
int bufPos = self->lastResponseBufPos;
|
|
|
|
@ -2079,9 +1949,6 @@ MmsConnection_fileRead(MmsConnection self, MmsError* mmsError, int32_t frsmId, M
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return moreFollows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2092,28 +1959,21 @@ MmsConnection_getFileDirectory(MmsConnection self, MmsError* mmsError, const cha
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createFileDirectoryRequest(invokeId, payload, fileSpecification, continueAfter);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
bool moreFollows = false;
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
if (mmsClient_parseFileDirectoryResponse(self, handler, handlerParameter, &moreFollows) == false)
|
|
|
|
|
*mmsError = MMS_ERROR_PARSING_RESPONSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return moreFollows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2122,23 +1982,15 @@ MmsConnection_fileRename(MmsConnection self, MmsError* mmsError, const char* cur
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createFileRenameRequest(invokeId, payload, currentFileName, newFileName);
|
|
|
|
|
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2147,23 +1999,15 @@ MmsConnection_obtainFile(MmsConnection self, MmsError* mmsError, const char* sou
|
|
|
|
|
{
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createObtainFileRequest(invokeId, payload, sourceFile, destinationFile);
|
|
|
|
|
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
/* nothing to do - response contains no data to evaluate */
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MmsDataAccessError
|
|
|
|
@ -2175,24 +2019,17 @@ MmsConnection_writeVariable(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
mmsClient_createWriteRequest(invokeId, domainId, itemId, value, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
retVal = mmsClient_parseWriteResponse(self->lastResponse, self->lastResponseBufPos, mmsError);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2202,19 +2039,15 @@ MmsConnection_writeMultipleVariables(MmsConnection self, MmsError* mmsError, con
|
|
|
|
|
LinkedList /* <MmsValue*> */values,
|
|
|
|
|
/* OUTPUT */LinkedList* /* <MmsValue*> */accessResults)
|
|
|
|
|
{
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
mmsClient_createWriteMultipleItemsRequest(invokeId, domainId, items, values, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
|
|
|
|
|
int numberOfItems = LinkedList_size(items);
|
|
|
|
|
|
|
|
|
@ -2223,9 +2056,6 @@ MmsConnection_writeMultipleVariables(MmsConnection self, MmsError* mmsError, con
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MmsDataAccessError
|
|
|
|
@ -2235,26 +2065,19 @@ MmsConnection_writeArrayElements(MmsConnection self, MmsError* mmsError,
|
|
|
|
|
{
|
|
|
|
|
MmsDataAccessError retVal = DATA_ACCESS_ERROR_UNKNOWN;
|
|
|
|
|
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
mmsClient_createWriteRequestArray(invokeId, domainId, itemId, index, numberOfElements, value, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL)
|
|
|
|
|
if (responseMessage != NULL)
|
|
|
|
|
retVal = mmsClient_parseWriteResponse(self->lastResponse, self->lastResponseBufPos, mmsError);
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2263,19 +2086,15 @@ MmsConnection_writeNamedVariableList(MmsConnection self, MmsError* mmsError, boo
|
|
|
|
|
const char* domainId, const char* itemId, LinkedList /* <MmsValue*> */values,
|
|
|
|
|
/* OUTPUT */LinkedList* /* <MmsValue*> */accessResults)
|
|
|
|
|
{
|
|
|
|
|
*mmsError = MMS_ERROR_NONE;
|
|
|
|
|
|
|
|
|
|
uint32_t invokeId = getNextInvokeId(self);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
|
|
|
|
|
|
|
|
|
|
mmsClient_createWriteRequestNamedVariableList(invokeId, isAssociationSpecific, domainId, itemId, values, payload);
|
|
|
|
|
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload);
|
|
|
|
|
ByteBuffer* responseMessage = sendRequestAndWaitForResponse(self, invokeId, payload, mmsError);
|
|
|
|
|
|
|
|
|
|
if (self->lastResponseError != MMS_ERROR_NONE)
|
|
|
|
|
*mmsError = self->lastResponseError;
|
|
|
|
|
else if (responseMessage != NULL) {
|
|
|
|
|
if (responseMessage != NULL) {
|
|
|
|
|
|
|
|
|
|
int numberOfItems = LinkedList_size(values);
|
|
|
|
|
|
|
|
|
@ -2284,9 +2103,6 @@ MmsConnection_writeNamedVariableList(MmsConnection self, MmsError* mmsError, boo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
releaseResponse(self);
|
|
|
|
|
|
|
|
|
|
if (self->associationState == MMS_STATE_CLOSED)
|
|
|
|
|
*mmsError = MMS_ERROR_CONNECTION_LOST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|