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