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 17 package com.android.internal.telephony.cdma.sms; 18 19 20 public final class SmsEnvelope{ 21 /** 22 * Message Types 23 * (See 3GPP2 C.S0015-B 3.4.1) 24 */ 25 static public final int MESSAGE_TYPE_POINT_TO_POINT = 0x00; 26 static public final int MESSAGE_TYPE_BROADCAST = 0x01; 27 static public final int MESSAGE_TYPE_ACKNOWLEDGE = 0x02; 28 29 /** 30 * Supported Teleservices 31 * (See 3GPP2 N.S0005 and TIA-41) 32 */ 33 static public final int TELESERVICE_NOT_SET = 0x0000; 34 static public final int TELESERVICE_WMT = 0x1002; 35 static public final int TELESERVICE_VMN = 0x1003; 36 static public final int TELESERVICE_WAP = 0x1004; 37 static public final int TELESERVICE_WEMT = 0x1005; 38 39 /** 40 * The following are defined as extensions to the standard teleservices 41 */ 42 // Voice mail notification through Message Waiting Indication in CDMA mode or Analog mode. 43 // Defined in 3GPP2 C.S-0005, 3.7.5.6, an Info Record containing an 8-bit number with the 44 // number of messages waiting, it's used by some CDMA carriers for a voice mail count. 45 static public final int TELESERVICE_MWI = 0x40000; 46 47 // ServiceCategories for Cell Broadcast, see 3GPP2 C.R1001 table 9.3.1-1 48 //static public final int SERVICECATEGORY_EMERGENCY = 0x0010; 49 //... 50 51 /** 52 * maximum lengths for fields as defined in ril_cdma_sms.h 53 */ 54 static public final int SMS_BEARER_DATA_MAX = 255; 55 56 /** 57 * Provides the type of a SMS message like point to point, broadcast or acknowledge 58 */ 59 public int messageType; 60 61 /** 62 * The 16-bit Teleservice parameter identifies which upper layer service access point is sending 63 * or receiving the message. 64 * (See 3GPP2 C.S0015-B, v2, 3.4.3.1) 65 */ 66 public int teleService = TELESERVICE_NOT_SET; 67 68 /** 69 * The 16-bit service category parameter identifies the type of service provided 70 * by the SMS message. 71 * (See 3GPP2 C.S0015-B, v2, 3.4.3.2) 72 */ 73 public int serviceCategory; 74 75 /** 76 * The origination address identifies the originator of the SMS message. 77 * (See 3GPP2 C.S0015-B, v2, 3.4.3.4) 78 */ 79 public CdmaSmsAddress origAddress; 80 81 /** 82 * The destination address identifies the target of the SMS message. 83 * (See 3GPP2 C.S0015-B, v2, 3.4.3.4) 84 */ 85 public CdmaSmsAddress destAddress; 86 87 /** 88 * The 6-bit bearer reply parameter is used to request the return of a 89 * SMS Acknowledge Message. 90 * (See 3GPP2 C.S0015-B, v2, 3.4.3.5) 91 */ 92 public int bearerReply; 93 94 /** 95 * Cause Code values: 96 * The cause code parameters are an indication whether an SMS error has occurred and if so, 97 * whether the condition is considered temporary or permanent. 98 * ReplySeqNo 6-bit value, 99 * ErrorClass 2-bit value, 100 * CauseCode 0-bit or 8-bit value 101 * (See 3GPP2 C.S0015-B, v2, 3.4.3.6) 102 */ 103 public byte replySeqNo; 104 public byte errorClass; 105 public byte causeCode; 106 107 /** 108 * encoded bearer data 109 * (See 3GPP2 C.S0015-B, v2, 3.4.3.7) 110 */ 111 public byte[] bearerData; 112 113 public SmsEnvelope() { 114 // nothing to see here 115 } 116 117 } 118 119