1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Defines types for SMS adressing and the class TSmsAddr
26 #if !defined(SMSUADDR_H__)
29 #include <e32property.h>
32 /** SMS sockets family identifier.*/
33 const TUint KSMSAddrFamily = 0x010;
34 /** SMS sockets protocol ID. */
35 const TUint KSMSDatagramProtocol = 0x02;
36 /** The maximum number of SAPs the SMS sockets protocol supports. */
37 const TInt KSMSNumberSockets = 0x100;
38 /** The maximum datagram size the SMS sockets protocol supports. */
39 const TUint KSMSMaxDatagramSize = 255*160; // Based on 7 bit encoding
40 /** SMS sockets service flags. */
41 const TUint KSMSDatagramServiceInfo = KSIConnectionLess | KSIMessageBased ;
43 _LIT(KSmsDatagram,"SMS Datagram");
45 /** Specifies SMS sockets protocol level for the provider in the aLevel argument of RSocket::Ioctl(). */
46 const TUint KSolSmsProv = 0x100;
49 * Ioctl command for deleting SMS messages.
51 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
53 * @capability WriteUserData
54 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
56 const TUint KIoctlDeleteSmsMessage = 0x0300;
59 * Ioctl command for counting stored SMS messages.
61 * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged
62 * TUint. On completion, this holds the count of messages enumerated.
64 * @capability ReadUserData
65 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
67 const TUint KIoctlEnumerateSmsMessages = 0x0301;
70 * Ioctl command to indicate to the protocol that the client received messages
73 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
75 * @capability ReadUserData
76 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
78 const TUint KIoctlReadMessageSucceeded = 0x0304;
81 * Ioctl command to indicate to the protocol that the client failed to receive
82 * messages successfully.
84 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
86 * @capability ReadUserData
87 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
89 const TUint KIoctlReadMessageFailed = 0x0305;
92 * Ioctl command for sending SMS messages.
94 * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged
97 * @capability NetworkServices
98 * @see RSocket::Ioctl()
100 const TUint KIoctlSendSmsMessage = 0x0306;
103 * Ioctl command for writing SMS messages to SIM.
105 * For this command, the aDesc argument of RSocket::Ioctl() may be NULL or may hold a packaged
106 * descriptor large enough to store information on slots for the message. This descriptor will
107 * be populated upon completion of the request and shall be used by the client to update the
108 * CSmsMessage object that has been written, by invoking its UpdateSlotsL() method. This has
109 * to be done if the client wants to be able to delete this message from the store at some
110 * point, unless it opts to enumerate messages before deletion takes place.
112 * @capability WriteUserData
113 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
115 const TUint KIoctlWriteSmsMessage = 0x0307;
118 * Ioctl command for enumerating SMS parameter sets.
120 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
122 * @capability ReadDeviceData
123 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
125 const TUint KIoctlReadSmsParams = 0x0308;
128 * Ioctl command for completing SMSP list read request.
130 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
132 * @capability ReadDeviceData
133 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
135 const TUint KIoctlCompleteReadSmsParams = 0x0309;
138 * Ioctl command ofr writing SMS parameter sets.
140 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
142 * @capability WriteDeviceData
143 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
145 const TUint KIoctlWriteSmsParams = 0x0310;
148 * Ioctl command for finding out whether SMS stack is configured for handling
149 * of class 0 messages in out-of-disk condition or not.
151 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
153 * @capability WriteDeviceData
154 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
156 const TUint KIoctlSupportOODClass0SmsMessages = 0x0311;
159 * KIOctlSelect completion status if a modem is present.
161 * @capability WriteDeviceData
162 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
164 const TUint KIoctlSelectModemPresent = 0x400;
167 * KIOctlSelect completion status if a modem is not present.
169 * @capability WriteDeviceData
170 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
172 const TUint KIoctlSelectModemNotPresent = 0x401;
176 * Category for SMS Stack P&S variables.
178 const TUid KUidPSSMSStackCategory = {0x101F7989}; // RootServer's KUidCommsProcess
182 * Key for SMS Stack P&S Disk Space Monitor
184 const TInt KUidPSSMSStackDiskSpaceMonitorKey = 0x10282FAF;
188 * Category for SMS Stack P&S variables.
190 const RProperty::TType KUidPSSMSStackDiskSpaceMonitorKeyType = RProperty::EInt;
194 * State of Disk Space Monitor.
196 enum TSmsDiskSpaceMonitorStatus
198 /** The Disk Space status is unknown. */
199 ESmsDiskSpaceUnknown = 0,
201 /** The Disk Space status is believed to be available. */
202 ESmsDiskSpaceAvailable = 1,
204 /** The Disk Space status was not present during the last receive operation
205 and some PDU have been negatively acknowledged. */
206 ESmsDiskSpaceFull = 2
211 //typedef TBuf<KGsmMaxTelNumberSize> TSmsServiceCenterAddress;
213 /** Buffer to hold Service Center address. */
214 typedef TBuf<14> TSmsServiceCenterAddress;
215 /** Package buffer for TSmsServiceCenterAddress objects. */
216 typedef TPckgBuf<TSmsServiceCenterAddress> TSmsServiceCenterAddressBuf;
218 //note: Maintainers, please do *not* change the order of these enums!
220 * SMS address family for a socket.
226 ESmsAddrUnbound = 0, //< Not bound yet.
227 ESmsAddrSendOnly = 1, //< Only for sending, no reception.
228 ESmsAddrMessageIndication = 2, //< Matches on IEI 0x01 and DCS 0x1100xxxx, 0x1101xxxx and 0x1110xxxx.
229 ESmsAddrMatchIEI = 3, //< For matching Information Element Identifiers (IEI)
230 ESmsAddrMatchText = 4, //< For matching any text patterns
231 ESmsAddrRecvAny = 5, //< Receive all messages. Only one client can use this.
232 ESmsAddrStatusReport = 6, //< For receiving Status Reports.
233 ESmsAddrLocalOperation = 7, //< For local SIM operations.
234 ESmsAddrApplication8BitPort = 8, //< For sock port identification.
235 ESmsAddrApplication16BitPort = 9, //< For sock port identification.
236 ESmsAddrEmail = 10 //< for matching of email messages.
242 * SMS address for a socket.
246 class TSmsAddr : public TSockAddr
249 enum { EMaxTextMatchLength = 24 };
252 IMPORT_C TSmsAddrFamily SmsAddrFamily() const;
253 IMPORT_C void SetSmsAddrFamily(TSmsAddrFamily aFamily);
254 IMPORT_C TInt IdentifierMatch() const;
255 IMPORT_C void SetIdentifierMatch(TInt aIdentifier);
256 IMPORT_C TPtrC8 TextMatch() const;
257 IMPORT_C void SetTextMatch(const TDesC8& aText);
258 IMPORT_C TBool operator==(const TSmsAddr& aAddr) const;
262 #endif // SMSUADDR_H__