AModemDriver.java line 343:
From:
if (buffer.charAt(buffer.length() - 1) != 0x0d) buffer.append((char)
0x0d);
To:
if (buffer.length() > 0 && buffer.charAt(buffer.length() - 1) != 0x0d)
buffer.append((char) 0x0d);

In PduParser.java (parsePdu):
From:
public Pdu parsePdu(String rawPdu)
{
        // encode pdu to byte[] for easier processing
        pduByteArray = PduUtils.pduToBytes(rawPdu);
        position = 0;
        // parse start and determine what type of pdu it is
        Pdu pdu = parseStart();
        pdu.setRawPdu(rawPdu);
        // parse depending on the pdu type
        switch (pdu.getTpMti())
        {
                        case PduUtils.TP_MTI_SMS_DELIVER:
                        parseSmsDeliverMessage((SmsDeliveryPdu) pdu);
                        break;
                case PduUtils.TP_MTI_SMS_SUBMIT:
                        parseSmsSubmitMessage((SmsSubmitPdu) pdu);
                        break;
                case PduUtils.TP_MTI_SMS_STATUS_REPORT:
                        parseSmsStatusReportMessage((SmsStatusReportPdu) pdu);
                        break;
        }
        return pdu;
}

To:
// Returns null if it cannot get
public Pdu parsePdu(String rawPdu)
{
        Pdu pdu = null;
        try
        {
                // encode pdu to byte[] for easier processing
                pduByteArray = PduUtils.pduToBytes(rawPdu);
                position = 0;
                // parse start and determine what type of pdu it is
                pdu = parseStart();
                pdu.setRawPdu(rawPdu);
                // parse depending on the pdu type
                switch (pdu.getTpMti())
                {
                        case PduUtils.TP_MTI_SMS_DELIVER:
                                parseSmsDeliverMessage((SmsDeliveryPdu) pdu);
                                break;
                        case PduUtils.TP_MTI_SMS_SUBMIT:
                                parseSmsSubmitMessage((SmsSubmitPdu) pdu);
                                break;
                        case PduUtils.TP_MTI_SMS_STATUS_REPORT:
                                
parseSmsStatusReportMessage((SmsStatusReportPdu) pdu);
                                break;
                }
         }
         catch (Exception e)
         {
         }
                return pdu;
}

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/smslib?hl=en.

Reply via email to