B2G/gecko/dom/system/gonk/RadioInterfaceLayer.js
/**
   * Fragment string for transmission.
   *
   * Fragment input text string into an array of objects that contains
   * attributes `body`, substring for this segment, `encodedBodyLength`,
   * length of the encoded segment body in septets.
   *
   * @param text
   *        Text string to be fragmented.
   * @param options
   *        Optional pre-calculated option object. The output array will be
   *        stored at options.segments if there are multiple segments.
   * @param strict7BitEncoding
   *        Optional. Enable Latin characters replacement with corresponding
   *        ones in GSM SMS 7-bit default alphabet.
   *
   * @return Populated options object.
   */
Fragment string for transmission.
Fragment input text string into an array of objects that contains
attributes `body`, substring for this segment, `encodedBodyLength`,
length of the encoded segment body in septets.

@param text
Text string to be fragmented.
@param options
Optional pre-calculated option object. The output array will be
stored at options.segments if there are multiple segments.

@return Populated options object.
Fragment string for transmission . Fragment input text string into an array of objects that contains attributes ` body ` substring for this segment ` encodedBodyLength ` length of the encoded segment body in septets . @param text Text string to be fragmented . @param options Optional pre - calculated option object . The output array will be stored at options . segments if there are multiple segments . @return Populated options object .
function _fragmentText(text, options, strict7BitEncoding) {
    if (!options) {
      options = this._calculateUserDataLength(text, strict7BitEncoding);
    }
    if (options.dcs == RIL.PDU_DCS_MSG_CODING_7BITS_ALPHABET) {
      const langTable = RIL.PDU_NL_LOCKING_SHIFT_TABLES[options.langIndex];
      const langShiftTable = RIL.PDU_NL_SINGLE_SHIFT_TABLES[options.langShiftIndex];
      options.segments = this._fragmentText7Bit(text,
                                                langTable, langShiftTable,
                                                options.segmentChars,
                                                strict7BitEncoding);
    } else {
      options.segments = this._fragmentTextUCS2(text,
                                                options.segmentChars);
    }
    options.segmentMaxSeq = options.segments.length;
    return options;
  }
function _fragmentText ( text , options , strict7BitEncoding ) { if ( ! options ) { options = this . _calculateUserDataLength ( text , strict7BitEncoding ) ; } if ( options . dcs == RIL . PDU_DCS_MSG_CODING_7BITS_ALPHABET ) { const langTable = RIL . PDU_NL_LOCKING_SHIFT_TABLES [ options . langIndex ] ; const langShiftTable = RIL . PDU_NL_SINGLE_SHIFT_TABLES [ options . langShiftIndex ] ; options . segments = this . _fragmentText7Bit ( text , langTable , langShiftTable , options . segmentChars , strict7BitEncoding ) ; } else { options . segments = this . _fragmentTextUCS2 ( text , options . segmentChars ) ; } options . segmentMaxSeq = options . segments . length ; return options ; }
Fragment string for transmission.
Fragment string for transmission .
// Re-sync options.segmentMaxSeq with actual length of returning array.