comparison OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp @ 5853:4d932683049d get-scu tip

very first implementation of C-Get SCU
author Alain Mazy <am@orthanc.team>
date Tue, 29 Oct 2024 17:25:49 +0100
parents b1a18218860c
children
comparison
equal deleted inserted replaced
5839:7aef730c0859 5853:4d932683049d
524 throw OrthancException(ErrorCode_BadSequenceOfCalls, 524 throw OrthancException(ErrorCode_BadSequenceOfCalls,
525 "The connection is not open"); 525 "The connection is not open");
526 } 526 }
527 } 527 }
528 528
529 bool DicomAssociation::GetAssociationParameters(std::string& remoteAet,
530 std::string& remoteIp,
531 std::string& calledAet) const
532 {
533 T_ASC_Association& dcmtkAssoc = GetDcmtkAssociation();
534
535 DIC_AE remoteAet_C;
536 DIC_AE calledAet_C;
537 DIC_AE remoteIp_C;
538 DIC_AE calledIP_C;
539
540 if (
541 #if DCMTK_VERSION_NUMBER >= 364
542 ASC_getAPTitles(dcmtkAssoc.params, remoteAet_C, sizeof(remoteAet_C), calledAet_C, sizeof(calledAet_C), NULL, 0).good() &&
543 ASC_getPresentationAddresses(dcmtkAssoc.params, remoteIp_C, sizeof(remoteIp_C), calledIP_C, sizeof(calledIP_C)).good()
544 #else
545 ASC_getAPTitles(dcmtkAssoc.params, remoteAet_C, calledAet_C, NULL).good() &&
546 ASC_getPresentationAddresses(dcmtkAssoc.params, remoteIp_C, calledIP_C).good()
547 #endif
548 )
549 {
550 remoteIp = std::string(/*OFSTRING_GUARD*/(remoteIp_C));
551 remoteAet = std::string(/*OFSTRING_GUARD*/(remoteAet_C));
552 calledAet = (/*OFSTRING_GUARD*/(calledAet_C));
553 return true;
554 }
555
556 return false;
557 }
529 558
530 T_ASC_Network& DicomAssociation::GetDcmtkNetwork() const 559 T_ASC_Network& DicomAssociation::GetDcmtkNetwork() const
531 { 560 {
532 if (isOpen_) 561 if (isOpen_)
533 { 562 {