×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Zanjan
    Posts
    183

    problem with define MSdpAgentNotifier

    hi all
    this is our code but have this errors:
    error: illegal implicit conversion from 'TBTDevAddr *' to
    error: 'const TBTDevAddr &'


    class Cdfshservicediscoverer : public CBase,
    public MSdpAgentNotifier,
    public MSdpAttributeValueVisitor
    {
    private:
    void DiscoverServicesOnDeviceL(TBTDevAddr* aDevAddr);
    // data
    // service discovery agent
    CSdpAgent* iAgent;
    // service discovery search pattern
    CSdpSearchPattern* iSpat;
    // last discovered uuid in the service attributes
    TUUID iLastUUID;
    }

    void dfshservicediscoverer:iscoverServicesOnDeviceL(TBTDevAddr* aDevAddr)
    {
    iAgent = CSdpAgent::NewL(*this,aDevAddr);
    iSpat = CSdpSearchPattern::NewL();
    TUUID serviceUUID(KBT_serviceID);
    iSpat->AddL(serviceUUID);
    iAgent->SetRecordFilterL(*iSpat);
    iAgent->NextRecordRequestL();
    }

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: problem with define MSdpAgentNotifier

    Hi,
    Check the SDK documentation for
    CSdpAgent::newL()
    static CSdpAgent* NewL(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);
    and you are passing TBTDevAddr* there
    try
    iAgent = CSdpAgent::NewL(*this,*aDevAddr);
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Zanjan
    Posts
    183

    Re: problem with define MSdpAgentNotifier

    thanks yogpan
    this code runs but it has an error on red line .
    class Cdfshservicediscoverer : public CBase, public MSdpAgentNotifier,
    public MSdpAttributeValueVisitor
    {
    public:
    static Cdfshservicediscoverer* NewL(MSdpAgentNotifier& aNotifier);

    static Cdfshservicediscoverer* NewLC(MSdpAgentNotifier& aNotifier);

    ~Cdfshservicediscoverer();
    void DiscoverServicesOnDeviceL(TBTDevAddr aDevAddr);
    void FinishDiscovery();
    }

    private:
    Cdfshservicediscoverer* Cdfshservicediscoverer::NewL(MSdpAgentNotifier& aNotifier)
    {
    Cdfshservicediscoverer* self = Cdfshservicediscoverer::NewLC(aNotifier);
    CleanupStack::Pop(self);
    return self;
    }

    Cdfshservicediscoverer* Cdfshservicediscoverer::NewLC(MSdpAgentNotifier& aNotifier)
    {
    Cdfshservicediscoverer* self = new (ELeave) Cdfshservicediscoverer(aNotifier);
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

    void Cdfshservicediscoverer::ConstructL()
    {
    }

    Cdfshservicediscoverer::Cdfshservicediscoverer(MSdpAgentNotifier& aNotifier)
    {
    }

    Cdfshservicediscoverer::~Cdfshservicediscoverer()
    {
    FinishDiscovery();
    }
    void Cdfshservicediscoverer:iscoverServicesOnDeviceL(TBTDevAddr aDevAddr)
    {
    CSdpAgent* iAgent = CSdpAgent::NewLC(*this,aDevAddr);
    CSdpSearchPattern* iSpat = CSdpSearchPattern::NewL();
    TUUID serviceUUID(KBT_serviceID);
    iSpat->AddL(serviceUUID);
    iAgent->SetRecordFilterL(*iSpat);
    iAgent->NextRecordRequestL();
    }

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: problem with define MSdpAgentNotifier

    Whats the error, does it make tea instead of coffee?

  5. #5
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: problem with define MSdpAgentNotifier

    Quote Originally Posted by hotcheese View Post
    Whats the error, does it make tea instead of coffee?
    haha... good one hotcheese. Well friend you should mention clearly what is the type of error you are getting.Whether it is a compilation error or runtime error? What is the error saying?
    Otherwise it is impossible for others to find out what is going wrong in your code.
    Maximus
    S60 Developer
    Impossible is nothing

  6. #6
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Zanjan
    Posts
    183

    Re: problem with define MSdpAgentNotifier

    Hi
    We modified our codes & we could be correct pervios run time error
    Now we face of other problem with AttributeRequestL run time error
    void Cdfshservicediscoverer::NextRecordRequestComplete(TInt aError,TSdpServRecordHandle aHandle,TInt aTotalRecordsCount)
    {
    if ( aError==KErrNone && aTotalRecordsCount>0 )
    {
    iAgent->AttributeRequestL(aHandle,KSdpAttrIdProtocolDescriptorList);
    }
    }
    our codes can run to red line but when it is arrived to red line, it has stoped & program crashed.
    Last edited by masoud_bayat; 2008-10-26 at 07:36.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: problem with define MSdpAgentNotifier

    It is hard to believe that you have not seen this link so far: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  8. #8
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Zanjan
    Posts
    183

    Re: problem with define MSdpAgentNotifier

    Hi
    Finally, we could correct our codes & it runs,
    But exsit a problem.
    discover service of program can't run correctly.
    Cdfshservicediscoverer* iConserdisco;
    1-iConserdisco = Cdfshservicediscoverer::NewL(*this);
    2-iConserdisco->DiscoverServicesOnDeviceL(&devData);
    3-if (iConserdisco->HasServices()&& iConserdisco->iRunning)
    {
    4-iConnect= Cdfshconnector::NewL(); 5-iConnect->ConnectL(devData.iDeviceName1,devData.iDeviceAddr1,devData.iDeviceServicePort1);
    }
    void Cdfshservicediscoverer::DiscoverServicesOnDeviceL(TDeviceDatarik* aDev)
    {
    FinishDiscovery();
    iDevDataChanged=EFalse;
    iDev=aDev;
    iAgent = CSdpAgent::NewL(*this,iDev->iDeviceAddr1);
    iSpat = CSdpSearchPattern::NewL();
    TUUID serviceUUID(KBT_serviceID);

    iSpat->AddL(serviceUUID);
    iAgent->SetRecordFilterL(*iSpat);

    iAgent->NextRecordRequestL();
    iRunning = ETrue;
    }

    void Cdfshservicediscoverer::NextRecordRequestComplete(TInt aError,TSdpServRecordHandle aHandle,TInt aTotalRecordsCount)
    {
    iRunning = EFalse;
    if ( aError==KErrNone && aTotalRecordsCount>0 )
    {
    iAgent->AttributeRequestL(aHandle,KSdpAttrIdProtocolDescriptorList);
    }
    else
    {
    if ( iDevDataChanged )
    {
    iDev->iDeviceServicePort1=iPort;
    }
    else
    {
    FinishDiscovery();
    }
    }

    }
    problem:
    first,line 1 runs,then line 2 runs & line 2 call DiscoverServicesOnDeviceL function but this function dont call NextRecordRequestComplete
    then run line 3 , 4 , 5 and after it, NextRecordRequestComplete function is called.
    we want first finished lines 1,2 run then if expersion runs.
    Last edited by masoud_bayat; 2008-10-27 at 12:20.

  9. #9
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: problem with define MSdpAgentNotifier

    If NextRecordRequestComplete() is a callback and is supposed to get called as an asynchronous consequence of NextRecordRequest() then experiment with moving lines 3 4 and 5 elsewhere i.e. moving them to the end of NextRecordRequestComplete() if you want them to be executed after that has been called.

    If this starts to make things messy then you will probably need to switch over to a self scheduled active object, where the RunL() of your active object contains state logic and you move a state when NextRecordRequestComplete() gets called.


    If you don't understand any of this then you need to learn and understand the difference between sequential synchronous programming and real time asynchronous programming.

    Read about callbacks, active objectss, synchronous versus asynchronous.

Similar Threads

  1. I have a problem of CTelephony
    By blue119 in forum Symbian
    Replies: 3
    Last Post: 2007-09-27, 10:20
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  4. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×