×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    error while sending silent sms

    Hi to all!

    I want to send a silent sms, so i try the wiki example, but the application crashes in this line:

    iSocket.Ioctl(KIoctlSendSmsMessage,iStatus,&sendBuffer,KSolSmsProv);

    this is my code, what i´m doing bad? I´m working with a nokia n70

    Code:
    void Csilentsms::SMSSendL()
         {
         RFs iFileSession;
     	 RSocketServ iSocketServer;
     	 RSocket iSocket;
         //iFileServer is RFs object
         iFileSession.Connect(); 
         //iSockerServer is RSocketServ object
         iSocketServer.Connect();
         //iSocket is RSocket Object
         TInt err1 = iSocket.Open(iSocketServer,KSMSAddrFamily,
                   KSockDatagram, KSMSDatagramProtocol);
         
        
    
         if(!err1)
         { 
          //SMS address for a socket. 
         TSmsAddr smsaddr;
         //Only for sending, no reception.
         
         smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
         smsaddr.SetPort(5000);
    
         TInt BindErr1= iSocket.Bind(smsaddr);
         
         if(BindErr1 == KErrNone)
         {  				
         CSmsBuffer *buffer = CSmsBuffer::NewL();
         CleanupStack::PushL(buffer);
         //Inserting msg. to be sent to a buffer
         buffer->InsertL(0, _L("my message"));
         
         //Stream that writes a CSmsMessage object across a socket
         RSmsSocketWriteStream writestream(iSocket);
         //ESmsSubmit-SMS-SUBMIT, sent from Mobile Station to Service Center
         CSmsMessage* iSmsMessage;
         iSmsMessage = CSmsMessage::NewL(iFileSession,CSmsPDU::ESmsSubmit,
               buffer);
         //Sets the message Service Center Address via which msg. 
         //will be sent to receipent
        //iSmsMessage->SmsPDU().SetServiceCenterAddressL(_L("+01234567890"));
         //Sets destination number
         iSmsMessage->SmsPDU().SetToFromAddressL(_L("+123456789"));
    
         //Externalises message to a stream which is used for 
         //writing data into the socket
         iSmsMessage->ExternalizeL(writestream);
         //Ensures that any buffered data is written to the stream.
         writestream.CommitL();        
         TPckgBuf<TInt> sendBuffer;
         sendBuffer=KSockSelectWrite;
         //Applies an asynchronous I/O control operation on a socket.
         TRequestStatus iStatus = KRequestPending;
         
         iSocket.Ioctl(KIoctlSendSmsMessage,iStatus,&sendBuffer,KSolSmsProv);
       
    
         CleanupStack::PopAndDestroy(buffer);
         }
         }
         }
    Thanks in advance

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: error while sending silent sms


  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    Re: error while sending silent sms

    Quote Originally Posted by wizard_hu_ View Post
    it says:

    E32USER-Cbase 46

    Thanks!

  4. #4
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: error while sending silent sms

    in sdk, This panic is raised by an active scheduler, a CActiveScheduler. It is caused by a stray signal.

    you have a async request, but you not use an ActiveObject, not add in CActiveSchedule, not SetActive, so when the work finish, the event will not match the ao, it cause the panic.

    so you 'd better learn symain active object, it is symbian freamework base elements.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

Similar Threads

  1. Specifying port number while sending SMS?
    By sunil_bhambani123 in forum Mobile Java Networking & Messaging & Security
    Replies: 18
    Last Post: 2009-03-24, 06:09
  2. Problem in sending SMS using VB
    By sylvia in forum General Messaging
    Replies: 0
    Last Post: 2006-09-27, 07:38
  3. Problem in sending SMS
    By sylvia in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2006-09-27, 07:06
  4. HELP! problem w/ sending and reading sms..
    By mauve928 in forum General Messaging
    Replies: 0
    Last Post: 2003-12-14, 19:10
  5. nokia 30: no response on sending SMS
    By itsmeamar in forum Nokia M2M
    Replies: 2
    Last Post: 2003-05-26, 10:20

Posting Permissions

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