Package org.ajwcc.pduUtils.gsm3040

Examples of org.ajwcc.pduUtils.gsm3040.Pdu


    // NOTE: - the mpRefNo is arbitrarily set to 1
    // - if the user wishes to extract the UDH per part, he would need to get all pduStrings
    // using getPdus(String smscNumber, int mpRefNo), use a
    // PduParser on each pduString in the returned list, then access the UDH via the Pdu object
    List<String> pdus = pduGenerator.generatePduList(pdu, 1);
    Pdu newPdu = new PduParser().parsePdu(pdus.get(0));
    byte[] udh = newPdu.getUDHData();
    if (udh != null) return PduUtils.bytesToPdu(udh);
    return null;
  }
View Full Code Here


  }

  public List<String> getPdus(String smscNumber, int mpRefNo)
  {
    PduGenerator pduGenerator = new PduGenerator();
    SmsSubmitPdu pdu = createPduObject();
    initPduObject(pdu, smscNumber);
    return pduGenerator.generatePduList(pdu, mpRefNo);
  }
View Full Code Here

  protected SmsSubmitPdu createPduObject()
  {
    // if you want to be able to change some other parts of the first octet
    // do it here
    SmsSubmitPdu pdu;
    if (this.statusReport)
    {
      pdu = PduFactory.newSmsSubmitPdu(PduUtils.TP_SRR_REPORT | PduUtils.TP_VPF_INTEGER);
    }
    else
View Full Code Here

  @Override
  public String getPduUserData()
  {
    // generate
    PduGenerator pduGenerator = new PduGenerator();
    SmsSubmitPdu pdu = createPduObject();
    initPduObject(pdu, "");
    // NOTE: - the mpRefNo is arbitrarily set to 1
    // - this won't matter since we aren't looking at the UDH in this method
    // - this method is not allowed for 7-bit messages with UDH
    // since it is probable that the returned value will not be
    // correct due to the encoding's dependence on the UDH
    // - if the user wishes to extract the UD per part, he would need to get all pduStrings
    // using getPdus(String smscNumber, int mpRefNo), use a
    // PduParser on each pduString in the returned list, then access the UD via the Pdu object
    List<String> pdus = pduGenerator.generatePduList(pdu, 1);
    // my this point, pdu will be updated with concat info (in udhi), if present
    if ((pdu.hasTpUdhi()) && (getEncoding() == MessageEncodings.ENC7BIT)) { throw new RuntimeException("getPduUserData() not supported for 7-bit messages with UDH"); }
    // sum up the ud parts
    StringBuffer ud = new StringBuffer();
    for (String pduString : pdus)
    {
      Pdu newPdu = new PduParser().parsePdu(pduString);
View Full Code Here

  @Override
  public String getPduUserDataHeader()
  {
    // generate
    PduGenerator pduGenerator = new PduGenerator();
    SmsSubmitPdu pdu = createPduObject();
    initPduObject(pdu, "");
    // NOTE: - the mpRefNo is arbitrarily set to 1
    // - if the user wishes to extract the UDH per part, he would need to get all pduStrings
    // using getPdus(String smscNumber, int mpRefNo), use a
    // PduParser on each pduString in the returned list, then access the UDH via the Pdu object
View Full Code Here

  }

  public ConcatInformationElement getConcatInfo()
  {
    checkForUDHI(UDH_CHECK_MODE_IGNORE_IF_NONE);
    ConcatInformationElement concat = (ConcatInformationElement) getInformationElement(ConcatInformationElement.CONCAT_8BIT_REF);
    if (concat == null)
    {
      concat = (ConcatInformationElement) getInformationElement(ConcatInformationElement.CONCAT_16BIT_REF);
    }
    return concat;
View Full Code Here

    return concat;
  }

  public int getMpRefNo()
  {
    ConcatInformationElement concat = getConcatInfo();
    if (concat != null) return concat.getMpRefNo();
    return 0;
  }
View Full Code Here

    return 0;
  }

  public int getMpMaxNo()
  {
    ConcatInformationElement concat = getConcatInfo();
    if (concat != null) return concat.getMpMaxNo();
    return 1;
  }
View Full Code Here

    return 1;
  }

  public int getMpSeqNo()
  {
    ConcatInformationElement concat = getConcatInfo();
    if (concat != null) return concat.getMpSeqNo();
    return 0;
  }
View Full Code Here

    return (PortInformationElement) getInformationElement(PortInformationElement.PORT_16BIT);
  }

  public int getDestPort()
  {
    PortInformationElement portIe = getPortInfo();
    if (portIe == null) return -1;
    return portIe.getDestPort();
  }
View Full Code Here

TOP

Related Classes of org.ajwcc.pduUtils.gsm3040.Pdu

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.