MR_Reply *_ExSendMRRequest(Eip_Session *session,MR_Request *request,int size,int *replysize) { Eip_Item adressitem; Eip_Item dataitem; Encap_Header *reply=NULL; MR_Reply *mrrep=NULL; // adressitem adressitem.Type_Id=ItemId_Null; adressitem.Length=0; // dataitem dataitem.Type_Id=ItemId_UCM; dataitem.Length=size; reply=_SendRRData(session,&adressitem,NULL,&dataitem,request); if (reply==NULL) return(NULL); // no response mrrep=_GetMRReply(reply); if (mrrep!=NULL) { int size=_GetMRReplySize(reply); MR_Reply *result=malloc(size); if (result==NULL) { CIPERROR(Sys_Error,errno,0); free(reply); return(NULL); } memcpy(result,mrrep,size); free(reply); CIPERROR(MR_Error,result->General_Status,_GetMRExtendedStatus(result)); if (replysize!=NULL) *replysize=size; return(result); } else { CIPERROR(EIP_Error,reply->Status,0); free(reply); return(NULL); } }
int _GetMRDataSize(Encap_Header *header) { int size=_GetMRReplySize(header); MR_Reply *reply=_GetMRReply(header); if (reply!=NULL) return(size-sizeof(MR_Reply)-2*(reply->Add_Status_Size)); else return(Error); }
void *_GetCMReply(Encap_Header *reply) { return(_GetMRReply(reply));//_GetMRData }