Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 324815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:09:32+00:00 2026-05-12T09:09:32+00:00

I wonder if anyone has managed to create a working code for sending out

  • 0

I wonder if anyone has managed to create a working code for sending out binary messages (to configure Symbian phones) and have also some binary data sample.
So far all the samples I have found fail to leave the Outbox or never return.

// Current entry is the Draft folder.
    iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
    // Create a new SMS message entry as a child of the current context.
    iSmsMtm->CreateMessageL( KUidMsgTypeSMS.iUid );
    CMsvEntry& serverEntry = iSmsMtm->Entry();
    TMsvEntry entry( serverEntry.Entry() );

    /* Send Binary SMS */
    CSmsHeader &hdr = iSmsMtm->SmsHeader(); 
    CSmsMessage &msg = hdr.Message(); 
    CSmsPDU &pdu = msg.SmsPDU(); 
    CSmsUserData &userdata = pdu.UserData(); 

    // Set the DCS byte
    pdu.SetBits7To4(TSmsDataCodingScheme::ESmsDCSTextUncompressedWithNoClassInfo);
    pdu.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
    pdu.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass2);

    char buf[]= {...}; //my binary data, 247 bytes long

    // Construct a dummy message
    HBufC8 * iMessage = HBufC8::NewL(300);

    TPtr8 TempUDHBufDesc((TUint8*)buf,247,247);
    iMessage->Des().Copy(TempUDHBufDesc);
    _LOGFENTRY1(_L("mess length %d"),iMessage->Des().Length());
    userdata.SetBodyL(*iMessage); 
    delete iMessage; 

    // Message will be sent immediately.
    entry.SetSendingState( KMsvSendStateWaiting );

    entry.iDate.UniversalTime(); // insert current time //Solution for HomeTime()
    // Set the SMS message settings for the message.
    CSmsHeader& header = iSmsMtm->SmsHeader();
    CSmsSettings* settings = CSmsSettings::NewL();
    CleanupStack::PushL( settings );

    settings->CopyL( iSmsMtm->ServiceSettings() ); // restore settings
    settings->SetDelivery( ESmsDeliveryImmediately ); // to be delivered immediately
    settings->SetDeliveryReport(EFalse);
    settings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit); // IMPORTANT! For sending binary SMS
    header.SetSmsSettingsL( *settings ); // new settings

    // Let's check if there is a service center address.
    if ( header.Message().ServiceCenterAddress().Length() == 0 )
    {
        // No, there isn't. We assume there is at least one service center
        // number set and use the default service center number.
        CSmsSettings* serviceSettings = &( iSmsMtm->ServiceSettings() );
        // Check if number of service center addresses in the list is null.
        if ( !serviceSettings->ServiceCenterCount() )
        {        _LOGENTRY("No SC");
            return ; // quit creating the message
        }
        else
        {
            CSmsNumber* smsCenter= CSmsNumber::NewL();
            CleanupStack::PushL(smsCenter);
            smsCenter->SetAddressL((serviceSettings->GetServiceCenter( serviceSettings->DefaultServiceCenter())).Address());
            header.Message().SetServiceCenterAddressL( smsCenter->Address() );
            CleanupStack::PopAndDestroy(smsCenter);
        }
    }

    CleanupStack::PopAndDestroy( settings );

    // Recipient number is displayed also as the recipient alias.
    entry.iDetails.Set( _L("+3725038xxx") );
    iSmsMtm->AddAddresseeL( _L("+3725038xxx") , entry.iDetails );

    // Validate message.
    if ( !ValidateL() )
    {    _LOGENTRY("Not valid");
        return ;
    }

    entry.SetVisible( ETrue ); // set message as visible
    entry.SetInPreparation( EFalse ); // set together with the visibility flag
    serverEntry.ChangeL( entry ); // commit changes 
    iSmsMtm->SaveMessageL(); // save message

    TMsvSelectionOrdering selection;
    CMsvEntry* parentEntry = CMsvEntry::NewL( iSmsMtm->Session(), KMsvDraftEntryId, selection );
    CleanupStack::PushL( parentEntry );

    // Move message to Outbox.
    iOperation =parentEntry->MoveL( entry.Id(), KMsvGlobalOutBoxIndexEntryId, iStatus );

    CleanupStack::PopAndDestroy( parentEntry );

    iState = EWaitingForMoving;
    SetActive();

Mostly I’m not sure about the correct values for port and class . Also some correct binary string would be nice to have for testing. Now I’m not sure if thecode is bad or the data.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:09:32+00:00Added an answer on May 12, 2026 at 9:09 am

    The solution that worked is to use RComm and “DATAPORT::1” to send out the binary SMS using AT commands (like using a modem).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if anyone here has any experience with mercurial running on Ubuntu? I've
Has anyone used TUDBC ? This looks interesting, but I wonder how valuable it
I wonder if anyone uses commercial/free java obfuscators on his own commercial product. I
I wonder if anyone could suggest the best way of looping through all the
I wonder if anyone can provide me with the regular expressions needed to parse
I just wonder if anyone knows or made a wrapper around Active Directory to
As someone who hasn't used either technology on real-world projects I wonder if anyone
was wondering if there are anyone else here that has signed up with the
I wonder if anyone knows the flag for gcc to disable tailcall optimizations. Basically
Having a bit of config trouble in Wordpress and wonder if anyone can help.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.