~ubuntu-branches/debian/jessie/gsmlib/jessie

« back to all changes in this revision

Viewing changes to gsmlib/gsm_event.cc

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-10-15 13:29:27 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131015132927-1i5iwvj21wue3uvu
Tags: 1.10+20120414.gita5e5ae9a-0.1
* Non-maintainer upload.
* Update to the latest Git version by Vianney Bouchaud.
* Use 3.0 (quilt) source package format.
* Own the run subdirectory (Closes: #689891).
* Don't remove the system user on package remove.
* Fix init script (LP: #30228).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <gsmlib/gsm_at.h>
20
20
#include <gsmlib/gsm_me_ta.h>
21
21
 
22
 
using namespace std;
23
22
using namespace gsmlib;
24
23
 
25
24
// GsmEvent members
26
25
 
27
 
void GsmEvent::dispatch(string s, GsmAt &at) throw(GsmException)
 
26
void GsmEvent::dispatch(std::string s, GsmAt &at) throw(GsmException)
28
27
{
29
28
  SMSMessageType messageType;
30
29
  bool indication = false;
70
69
    //    <number>,<type>[,<subaddr>,<satype>[,<alpha>]]
71
70
    s = s.substr(6);
72
71
    Parser p(s);
73
 
    string num = p.parseString();
 
72
    std::string num = p.parseString();
74
73
    if (p.parseComma(true))
75
74
    {
76
75
      unsigned int numberFormat;
80
79
        throw GsmException(stringPrintf(_("unexpected number format %d"),
81
80
                                        numberFormat), OtherError);
82
81
    }
83
 
    string subAddr;
84
 
    string alpha;
 
82
    std::string subAddr;
 
83
    std::string alpha;
85
84
    if (p.parseComma(true))
86
85
    {
87
86
      subAddr = p.parseString(true);
105
104
    // handle SMS storage indication
106
105
    s = s.substr(6);
107
106
    Parser p(s);
108
 
    string storeName = p.parseString();
 
107
    std::string storeName = p.parseString();
109
108
    p.parseComma();
110
109
    unsigned int index = p.parseInt();
111
110
    SMSReceptionIndication(storeName, index - 1, messageType);
114
113
    if (messageType == CellBroadcastSMS)
115
114
    {
116
115
      // handle CB message
117
 
      string pdu = at.getLine();
 
116
      std::string pdu = at.getLine();
118
117
 
119
118
      CBMessageRef cb = new CBMessage(pdu);
120
119
 
124
123
    else
125
124
    {
126
125
      // handle SMS
127
 
      string pdu = at.getLine();
 
126
      std::string pdu = at.getLine();
128
127
      
129
128
      // add missing service centre address if required by ME
130
129
      if (! at.getMeTa().getCapabilities()._hasSMSSCAprefix)
141
140
    }
142
141
}
143
142
 
144
 
void GsmEvent::callerLineID(string number, string subAddr, string alpha)
 
143
void GsmEvent::callerLineID(std::string number, std::string subAddr, std::string alpha)
145
144
{
146
145
  // ignore event
147
146
}
157
156
  // ignore event
158
157
}
159
158
 
160
 
void GsmEvent::SMSReceptionIndication(string storeName, unsigned int index,
 
159
void GsmEvent::SMSReceptionIndication(std::string storeName, unsigned int index,
161
160
                                      SMSMessageType messageType)
162
161
{
163
162
  // ignore event