tests/tools/scu.cc
// Sends a C-GET Request on given presentation context
Sends a C-GET Request on given presentation context
Sends a C - GET Request on given presentation context
OFCondition DcmSCU::sendCGETRequest(const T_ASC_PresentationContextID presID,
                                    DcmDataset *dataset,
                                    OFList<RetrieveResponse*> *responses)
{
  if (!isConnected())
    return DIMSE_ILLEGALASSOCIATION;
  if (dataset == NULL)
    return DIMSE_NULLKEY;
  OFCondition cond;
  OFString tempStr;
  T_ASC_PresentationContextID pcid = presID;
  T_DIMSE_Message msg;
  T_DIMSE_C_GetRQ* req = &(msg.msg.CGetRQ);
  msg.CommandField = DIMSE_C_GET_RQ;
  req->MessageID = nextMessageID();
  req->DataSetType = DIMSE_DATASET_PRESENT;
  req->Priority = DIMSE_PRIORITY_LOW;
  OFString abstractSyntax, transferSyntax;
  findPresentationContext(pcid, abstractSyntax, transferSyntax);
  if (abstractSyntax.empty() || transferSyntax.empty())
    return DIMSE_NOVALIDPRESENTATIONCONTEXTID;
  OFStandard::strlcpy(req->AffectedSOPClassUID, abstractSyntax.c_str(), sizeof(req->AffectedSOPClassUID));
  DCMNET_INFO("Sending C-GET Request (MsgID " << req->MessageID << ")");
  cond = sendDIMSEMessage(pcid, &msg, dataset);
  if (cond.bad())
  {
    DCMNET_ERROR("Failed sending C-GET request: " << DimseCondition::dump(tempStr, cond));
    return cond;
  }
  cond = handleCGETSession(pcid, dataset, responses);
  return cond;
}
OFCondition DcmSCU :: sendCGETRequest ( const T_ASC_PresentationContextID presID , DcmDataset * dataset , OFList < RetrieveResponse * > * responses ) { if ( ! isConnected ( ) ) return DIMSE_ILLEGALASSOCIATION ; if ( dataset == NULL ) return DIMSE_NULLKEY ; OFCondition cond ; OFString tempStr ; T_ASC_PresentationContextID pcid = presID ; T_DIMSE_Message msg ; T_DIMSE_C_GetRQ * req = & ( msg . msg . CGetRQ ) ; msg . CommandField = DIMSE_C_GET_RQ ; req -> MessageID = nextMessageID ( ) ; req -> DataSetType = DIMSE_DATASET_PRESENT ; req -> Priority = DIMSE_PRIORITY_LOW ; OFString abstractSyntax , transferSyntax ; findPresentationContext ( pcid , abstractSyntax , transferSyntax ) ; if ( abstractSyntax . empty ( ) || transferSyntax . empty ( ) ) return DIMSE_NOVALIDPRESENTATIONCONTEXTID ; OFStandard :: strlcpy ( req -> AffectedSOPClassUID , abstractSyntax . c_str ( ) , sizeof ( req -> AffectedSOPClassUID ) ) ; DCMNET_INFO ( " " << req -> MessageID << " " ) ; cond = sendDIMSEMessage ( pcid , & msg , dataset ) ; if ( cond . bad ( ) ) { DCMNET_ERROR ( " " << DimseCondition :: dump ( tempStr , cond ) ) ; return cond ; } cond = handleCGETSession ( pcid , dataset , responses ) ; return cond ; }
Sends a C-GET Request on given presentation context
Sends a C - GET Request on given presentation context
// Do some basic validity checks /* Prepare DIMSE data structures for issuing request */ // Set type of message // Set message ID // Announce dataset // Specify priority // Determine SOP Class from presentation context /* Send request */