×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Jun 2005
    Location
    Philippines
    Posts
    163

    Question Sending a bit stream instead of a string stream by means of descriptors

    I need to implement a socket protocol that uses bits and bytes instead of strings in Symbian C++. Since the sockets can only write in descriptors and send data by means of descriptors, I need a way to edit the descriptor bit by bit. I need a function that concatenates TUint8 or TUint16 values into one long array of bits which the socket will send out as a bit/byte stream. I need something like an RFile::Read() which puts bits into a descriptor. Can anyone give suggestions how this can be done?

    The AppendNum() functions of descriptors convert the bytes/bits into their character equivalent. So I think that I cannot use that.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Sending a bit stream instead of a string stream by means of descriptors

    you could put a byte to byte-descriptor by doing something like this:

    TBuf8<2> iBuffer;

    iBuffer.Append(_L(" "));
    iBuffer[i] = 0xFF;

    The first line is used to first extend the buffer with one character byte and the second line is used to assign the real value to it.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Jun 2005
    Location
    Philippines
    Posts
    163

    Smile Re: Sending a bit stream instead of a string stream by means of descriptors

    So I would need to work with TBuf before I append it to an HBufC? Would this be the way to send an indefinite length of bits/bytes through sockets?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Sending a bit stream instead of a string stream by means of descriptors

    No, you could also work with HBufC directly, by using the Des()-function offered by this class.

    yucca

  5. #5
    Regular Contributor
    Join Date
    Jun 2005
    Location
    Philippines
    Posts
    163

    Smile Re: Sending a bit stream instead of a string stream by means of descriptors

    I thought you could not work with HBufC directly because when I tried assigning values
    iHeader->Des()[ 2 ] = iTimeStamp >> 16;
    iHeader->Des()[ 3 ] = iTimeStamp & 0xffff;
    my program would exit because I was assigning to some unknown memory location. The appending/copying/initializing of the buffer to some data or empty spaces first solves my error. Thanks

Similar Threads

  1. sending String over BT
    By ertra in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2005-08-10, 11:33
  2. sending String over BT
    By ertra in forum Bluetooth Technology
    Replies: 0
    Last Post: 2005-08-03, 23:11
  3. Sending long message
    By njoandy1 in forum Smart Messaging
    Replies: 2
    Last Post: 2005-02-06, 09:38
  4. Different Octave in RTTL and in Ringing Tone Bit String
    By mariapatricia_99 in forum Smart Messaging
    Replies: 0
    Last Post: 2002-12-22, 14:32
  5. D211 new linux driver 1.04 not working !!
    By franz_meyer in forum Multimodecards
    Replies: 1
    Last Post: 2002-12-12, 08:31

Posting Permissions

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