Lines Matching refs:pdu

58      * @param pdu PDU bytes
59 * @return An instance of this class, or null if invalid pdu
61 public static SmsCbMessage createFromPdu(byte[] pdu) {
63 return new SmsCbMessage(pdu);
65 Log.w(LOG_TAG, "Failed parsing SMS-CB pdu", e);
104 private SmsCbMessage(byte[] pdu) throws IllegalArgumentException {
105 mHeader = new SmsCbHeader(pdu);
109 if (pdu.length >= SmsCbHeader.PDU_LENGTH_ETWS) {
110 mPrimaryNotificationTimestamp = getTimestampMillis(pdu);
113 System.arraycopy(pdu, 13, mPrimaryNotificationDigitalSignature, 0, 43);
116 parseBody(pdu);
232 * @param pdu The pdu
234 private void parseBody(byte[] pdu) {
308 int nrPages = pdu[SmsCbHeader.PDU_HEADER_LENGTH];
310 if (pdu.length < SmsCbHeader.PDU_HEADER_LENGTH + 1 + (PDU_BODY_PAGE_LENGTH + 1)
312 throw new IllegalArgumentException("Pdu length " + pdu.length + " does not match "
322 int length = pdu[offset + PDU_BODY_PAGE_LENGTH];
329 sb.append(unpackBody(pdu, encoding, offset, length, hasLanguageIndicator));
335 int length = pdu.length - offset;
337 mBody = unpackBody(pdu, encoding, offset, length, hasLanguageIndicator);
342 * Unpack body text from the pdu using the given encoding, position and
343 * length within the pdu
345 * @param pdu The pdu
354 private String unpackBody(byte[] pdu, int encoding, int offset, int length,
360 body = GsmAlphabet.gsm7BitPackedToString(pdu, offset, length * 8 / 7);
371 if (hasLanguageIndicator && pdu.length >= offset + 2) {
374 mLanguage = GsmAlphabet.gsm7BitPackedToString(pdu, offset, 2);
380 body = new String(pdu, offset, (length & 0xfffe), "utf-16");
408 * @param pdu the ETWS primary notification PDU to decode
411 private long getTimestampMillis(byte[] pdu) {
412 // Timestamp starts after CB header, in pdu[6]
413 int year = IccUtils.gsmBcdByteToInt(pdu[6]);
414 int month = IccUtils.gsmBcdByteToInt(pdu[7]);
415 int day = IccUtils.gsmBcdByteToInt(pdu[8]);
416 int hour = IccUtils.gsmBcdByteToInt(pdu[9]);
417 int minute = IccUtils.gsmBcdByteToInt(pdu[10]);
418 int second = IccUtils.gsmBcdByteToInt(pdu[11]);
425 byte tzByte = pdu[12];