1/* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.internal.telephony.cdma.sms; 18 19 20import com.android.internal.telephony.cdma.sms.CdmaSmsSubaddress; 21 22public final class SmsEnvelope { 23 /** 24 * Message Types 25 * (See 3GPP2 C.S0015-B 3.4.1) 26 */ 27 static public final int MESSAGE_TYPE_POINT_TO_POINT = 0x00; 28 static public final int MESSAGE_TYPE_BROADCAST = 0x01; 29 static public final int MESSAGE_TYPE_ACKNOWLEDGE = 0x02; 30 31 /** 32 * Supported Teleservices 33 * (See 3GPP2 N.S0005 and TIA-41) 34 */ 35 static public final int TELESERVICE_NOT_SET = 0x0000; 36 static public final int TELESERVICE_WMT = 0x1002; 37 static public final int TELESERVICE_VMN = 0x1003; 38 static public final int TELESERVICE_WAP = 0x1004; 39 static public final int TELESERVICE_WEMT = 0x1005; 40 static public final int TELESERVICE_SCPT = 0x1006; 41 42 /** 43 * The following are defined as extensions to the standard teleservices 44 */ 45 // Voice mail notification through Message Waiting Indication in CDMA mode or Analog mode. 46 // Defined in 3GPP2 C.S-0005, 3.7.5.6, an Info Record containing an 8-bit number with the 47 // number of messages waiting, it's used by some CDMA carriers for a voice mail count. 48 static public final int TELESERVICE_MWI = 0x40000; 49 50 // Service Categories for Cell Broadcast, see 3GPP2 C.R1001 table 9.3.1-1 51 // static final int SERVICE_CATEGORY_EMERGENCY = 0x0001; 52 //... 53 54 // CMAS alert service category assignments, see 3GPP2 C.R1001 table 9.3.3-1 55 public static final int SERVICE_CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT = 0x1000; 56 public static final int SERVICE_CATEGORY_CMAS_EXTREME_THREAT = 0x1001; 57 public static final int SERVICE_CATEGORY_CMAS_SEVERE_THREAT = 0x1002; 58 public static final int SERVICE_CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY = 0x1003; 59 public static final int SERVICE_CATEGORY_CMAS_TEST_MESSAGE = 0x1004; 60 public static final int SERVICE_CATEGORY_CMAS_LAST_RESERVED_VALUE = 0x10ff; 61 62 /** 63 * Provides the type of a SMS message like point to point, broadcast or acknowledge 64 */ 65 public int messageType; 66 67 /** 68 * The 16-bit Teleservice parameter identifies which upper layer service access point is sending 69 * or receiving the message. 70 * (See 3GPP2 C.S0015-B, v2, 3.4.3.1) 71 */ 72 public int teleService = TELESERVICE_NOT_SET; 73 74 /** 75 * The 16-bit service category parameter identifies the type of service provided 76 * by the SMS message. 77 * (See 3GPP2 C.S0015-B, v2, 3.4.3.2) 78 */ 79 public int serviceCategory; 80 81 /** 82 * The origination address identifies the originator of the SMS message. 83 * (See 3GPP2 C.S0015-B, v2, 3.4.3.3) 84 */ 85 public CdmaSmsAddress origAddress; 86 87 /** 88 * The destination address identifies the target of the SMS message. 89 * (See 3GPP2 C.S0015-B, v2, 3.4.3.3) 90 */ 91 public CdmaSmsAddress destAddress; 92 93 /** 94 * The origination subaddress identifies the originator of the SMS message. 95 * (See 3GPP2 C.S0015-B, v2, 3.4.3.4) 96 */ 97 public CdmaSmsSubaddress origSubaddress; 98 99 /** 100 * The 6-bit bearer reply parameter is used to request the return of a 101 * SMS Acknowledge Message. 102 * (See 3GPP2 C.S0015-B, v2, 3.4.3.5) 103 */ 104 public int bearerReply; 105 106 /** 107 * Cause Code values: 108 * The cause code parameters are an indication whether an SMS error has occurred and if so, 109 * whether the condition is considered temporary or permanent. 110 * ReplySeqNo 6-bit value, 111 * ErrorClass 2-bit value, 112 * CauseCode 0-bit or 8-bit value 113 * (See 3GPP2 C.S0015-B, v2, 3.4.3.6) 114 */ 115 public byte replySeqNo; 116 public byte errorClass; 117 public byte causeCode; 118 119 /** 120 * encoded bearer data 121 * (See 3GPP2 C.S0015-B, v2, 3.4.3.7) 122 */ 123 public byte[] bearerData; 124 125 public SmsEnvelope() { 126 // nothing to see here 127 } 128 129} 130 131