yocto_messagebox.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_messagebox.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindMessageBox(), the high-level API for MessageBox functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #ifndef YOCTO_MESSAGEBOX_H
42 #define YOCTO_MESSAGEBOX_H
43 
44 #include "yocto_api.h"
45 
46 
47 //--- (generated code: YMessageBox return codes)
48 //--- (end of generated code: YMessageBox return codes)
49 //--- (generated code: YMessageBox definitions)
50 class YMessageBox; // forward declaration
51 
52 typedef void (*YMessageBoxValueCallback)(YMessageBox *func, const string& functionValue);
53 #define Y_SLOTSINUSE_INVALID (YAPI_INVALID_UINT)
54 #define Y_SLOTSCOUNT_INVALID (YAPI_INVALID_UINT)
55 #define Y_SLOTSBITMAP_INVALID (YAPI_INVALID_STRING)
56 #define Y_PDUSENT_INVALID (YAPI_INVALID_UINT)
57 #define Y_PDURECEIVED_INVALID (YAPI_INVALID_UINT)
58 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING)
59 //--- (end of generated code: YMessageBox definitions)
60 
61 //--- (generated code: YSms definitions)
62 //--- (end of generated code: YSms definitions)
63 
64 
65 //--- (generated code: YSms declaration)
72 #ifdef __BORLANDC__
73 #pragma option push -w-8022
74 #endif
75 //--- (end of generated code: YSms declaration)
76  //--- (generated code: YSms attributes)
77  // Attributes (function value cache)
79  int _slot;
80  bool _deliv;
81  string _smsc;
82  int _mref;
83  string _orig;
84  string _dest;
85  int _pid;
86  int _alphab;
87  int _mclass;
88  string _stamp;
89  string _udh;
90  string _udata;
91  int _npdu;
92  string _pdu;
93  vector<YSms> _parts;
94  string _aggSig;
95  int _aggIdx;
96  int _aggCnt;
97  //--- (end of generated code: YSms attributes)
98  //--- (generated code: YSms constructor)
99 
100  //--- (end of generated code: YSms constructor)
101  //--- (generated code: YSms initialization)
102  //--- (end of generated code: YSms initialization)
103 
104 public:
105  YSms(void);
106  YSms(YMessageBox *mbox);
107  //--- (generated code: YSms accessors declaration)
108 
109 
110  virtual int get_slot(void);
111 
112  virtual string get_smsc(void);
113 
114  virtual int get_msgRef(void);
115 
116  virtual string get_sender(void);
117 
118  virtual string get_recipient(void);
119 
120  virtual int get_protocolId(void);
121 
122  virtual bool isReceived(void);
123 
124  virtual int get_alphabet(void);
125 
126  virtual int get_msgClass(void);
127 
128  virtual int get_dcs(void);
129 
130  virtual string get_timestamp(void);
131 
132  virtual string get_userDataHeader(void);
133 
134  virtual string get_userData(void);
135 
136  virtual string get_textData(void);
137 
138  virtual vector<int> get_unicodeData(void);
139 
140  virtual int get_partCount(void);
141 
142  virtual string get_pdu(void);
143 
144  virtual vector<YSms> get_parts(void);
145 
146  virtual string get_concatSignature(void);
147 
148  virtual int get_concatIndex(void);
149 
150  virtual int get_concatCount(void);
151 
152  virtual int set_slot(int val);
153 
154  virtual int set_received(bool val);
155 
156  virtual int set_smsc(string val);
157 
158  virtual int set_msgRef(int val);
159 
160  virtual int set_sender(string val);
161 
162  virtual int set_recipient(string val);
163 
164  virtual int set_protocolId(int val);
165 
166  virtual int set_alphabet(int val);
167 
168  virtual int set_msgClass(int val);
169 
170  virtual int set_dcs(int val);
171 
172  virtual int set_timestamp(string val);
173 
174  virtual int set_userDataHeader(string val);
175 
176  virtual int set_userData(string val);
177 
178  virtual int convertToUnicode(void);
179 
180  virtual int addText(string val);
181 
182  virtual int addUnicodeData(vector<int> val);
183 
184  virtual int set_pdu(string pdu);
185 
186  virtual int set_parts(vector<YSms> parts);
187 
188  virtual string encodeAddress(string addr);
189 
190  virtual string decodeAddress(string addr,int ofs,int siz);
191 
192  virtual string encodeTimeStamp(string exp);
193 
194  virtual string decodeTimeStamp(string exp,int ofs,int siz);
195 
196  virtual int udataSize(void);
197 
198  virtual string encodeUserData(void);
199 
200  virtual int generateParts(void);
201 
202  virtual int generatePdu(void);
203 
204  virtual int parseUserDataHeader(void);
205 
206  virtual int parsePdu(string pdu);
207 
208  virtual int send(void);
209 
210  virtual int deleteFromSIM(void);
211 
212 #ifdef __BORLANDC__
213 #pragma option pop
214 #endif
215  //--- (end of generated code: YSms accessors declaration)
216 };
217 
218 
219 //--- (generated code: YMessageBox declaration)
227 #ifdef __BORLANDC__
228 #pragma option push -w-8022
229 #endif
230 //--- (end of generated code: YMessageBox declaration)
231 protected:
232  //--- (generated code: YMessageBox attributes)
233  // Attributes (function value cache)
236  string _slotsBitmap;
237  int _pduSent;
239  string _command;
243  vector<YSms> _pdus;
244  vector<YSms> _messages;
246  vector<int> _gsm2unicode;
247  string _iso2gsm;
248 
249  friend YMessageBox *yFindMessageBox(const string& func);
250  friend YMessageBox *yFirstMessageBox(void);
251 
252  // Function-specific method for parsing of JSON output and caching result
253  virtual int _parseAttr(YJSONObject* json_val);
254 
255  // Constructor is protected, use yFindMessageBox factory function to instantiate
256  YMessageBox(const string& func);
257  //--- (end of generated code: YMessageBox attributes)
258 
259 public:
260  ~YMessageBox();
261  //--- (generated code: YMessageBox accessors declaration)
262 
263  static const int SLOTSINUSE_INVALID = YAPI_INVALID_UINT;
264  static const int SLOTSCOUNT_INVALID = YAPI_INVALID_UINT;
265  static const string SLOTSBITMAP_INVALID;
266  static const int PDUSENT_INVALID = YAPI_INVALID_UINT;
267  static const int PDURECEIVED_INVALID = YAPI_INVALID_UINT;
268  static const string COMMAND_INVALID;
269 
277  int get_slotsInUse(void);
278 
279  inline int slotsInUse(void)
280  { return this->get_slotsInUse(); }
281 
289  int get_slotsCount(void);
290 
291  inline int slotsCount(void)
292  { return this->get_slotsCount(); }
293 
294  string get_slotsBitmap(void);
295 
296  inline string slotsBitmap(void)
297  { return this->get_slotsBitmap(); }
298 
306  int get_pduSent(void);
307 
308  inline int pduSent(void)
309  { return this->get_pduSent(); }
310 
320  int set_pduSent(int newval);
321  inline int setPduSent(int newval)
322  { return this->set_pduSent(newval); }
323 
331  int get_pduReceived(void);
332 
333  inline int pduReceived(void)
334  { return this->get_pduReceived(); }
335 
345  int set_pduReceived(int newval);
346  inline int setPduReceived(int newval)
347  { return this->set_pduReceived(newval); }
348 
349  string get_command(void);
350 
351  inline string command(void)
352  { return this->get_command(); }
353 
354  int set_command(const string& newval);
355  inline int setCommand(const string& newval)
356  { return this->set_command(newval); }
357 
385  static YMessageBox* FindMessageBox(string func);
386 
398  virtual int registerValueCallback(YMessageBoxValueCallback callback);
400 
401  virtual int _invokeValueCallback(string value);
402 
403  virtual int nextMsgRef(void);
404 
405  virtual int clearSIMSlot(int slot);
406 
407  virtual YSms fetchPdu(int slot);
408 
409  virtual int initGsm2Unicode(void);
410 
411  virtual vector<int> gsm2unicode(string gsm);
412 
413  virtual string gsm2str(string gsm);
414 
415  virtual string str2gsm(string msg);
416 
417  virtual int checkNewMessages(void);
418 
419  virtual vector<YSms> get_pdus(void);
420 
428  virtual int clearPduCounters(void);
429 
445  virtual int sendTextMessage(string recipient,string message);
446 
463  virtual int sendFlashMessage(string recipient,string message);
464 
475  virtual YSms newMessage(string recipient);
476 
485  virtual vector<YSms> get_messages(void);
486 
487 
488  inline static YMessageBox* Find(string func)
489  { return YMessageBox::FindMessageBox(func); }
490 
498  YMessageBox *nextMessageBox(void);
499  inline YMessageBox *next(void)
500  { return this->nextMessageBox();}
501 
511  static YMessageBox* FirstMessageBox(void);
512  inline static YMessageBox* First(void)
513  { return YMessageBox::FirstMessageBox();}
514 #ifdef __BORLANDC__
515 #pragma option pop
516 #endif
517  //--- (end of generated code: YMessageBox accessors declaration)
518 };
519 
520 //--- (generated code: YMessageBox functions declaration)
521 
549 inline YMessageBox* yFindMessageBox(const string& func)
550 { return YMessageBox::FindMessageBox(func);}
561 { return YMessageBox::FirstMessageBox();}
562 
563 //--- (end of generated code: YMessageBox functions declaration)
564 
565 #endif
vector< YSms > _parts
string command(void)
YMessageBox * yFindMessageBox(const string &func)
int setPduReceived(int newval)
vector< YSms > _messages
YMessageBoxValueCallback _valueCallbackMessageBox
int slotsInUse(void)
static const string SLOTSBITMAP_INVALID
static YMessageBox * FirstMessageBox(void)
string _udata
string _dest
string _prevBitmapStr
YMessageBox * next(void)
void(* YMessageBoxValueCallback)(YMessageBox *func, const string &functionValue)
string _smsc
string _orig
int _alphab
bool _deliv
int setPduSent(int newval)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
string _pdu
string _stamp
vector< int > _gsm2unicode
static YMessageBox * First(void)
string _aggSig
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
int setCommand(const string &newval)
static YMessageBox * FindMessageBox(string func)
int pduReceived(void)
static YMessageBox * Find(string func)
static const string COMMAND_INVALID
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
string slotsBitmap(void)
YMessageBox * yFirstMessageBox(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int _mclass
int _aggCnt
string _udh
int _aggIdx
int pduSent(void)
vector< YSms > _pdus
YMessageBox * _mbox
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
int slotsCount(void)


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11