#include <yocto_messagebox.h>
Public Member Functions | |
virtual int | _invokeValueCallback (string value) |
virtual int | checkNewMessages (void) |
virtual int | clearPduCounters (void) |
virtual int | clearSIMSlot (int slot) |
string | command (void) |
virtual YSms | fetchPdu (int slot) |
string | get_command (void) |
virtual vector< YSms > | get_messages (void) |
int | get_pduReceived (void) |
virtual vector< YSms > | get_pdus (void) |
int | get_pduSent (void) |
string | get_slotsBitmap (void) |
int | get_slotsCount (void) |
int | get_slotsInUse (void) |
virtual string | gsm2str (string gsm) |
virtual vector< int > | gsm2unicode (string gsm) |
virtual int | initGsm2Unicode (void) |
virtual YSms | newMessage (string recipient) |
YMessageBox * | next (void) |
YMessageBox * | nextMessageBox (void) |
virtual int | nextMsgRef (void) |
int | pduReceived (void) |
int | pduSent (void) |
virtual int | registerValueCallback (YMessageBoxValueCallback callback) |
virtual int | sendFlashMessage (string recipient, string message) |
virtual int | sendTextMessage (string recipient, string message) |
int | set_command (const string &newval) |
int | set_pduReceived (int newval) |
int | set_pduSent (int newval) |
int | setCommand (const string &newval) |
int | setPduReceived (int newval) |
int | setPduSent (int newval) |
string | slotsBitmap (void) |
int | slotsCount (void) |
int | slotsInUse (void) |
virtual string | str2gsm (string msg) |
~YMessageBox () | |
Public Member Functions inherited from YFunction | |
void | _clearDataStreamCache () |
string | _decode_json_string (const string &json) |
string | _download (const string &url) |
YDataStream * | _findDataStream (YDataSet &dataset, const string &def) |
string | _get_json_path (const string &json, const string &path) |
vector< string > | _json_get_array (const string &json) |
string | _json_get_key (const string &json, const string &data) |
string | _json_get_string (const string &json) |
int | _parseEx (yJsonStateMachine &j) |
virtual int | _parserHelper (void) |
string | _parseString (yJsonStateMachine &j) |
string | _request (const string &request) |
string | _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context) |
void | _throw (YRETCODE errType, string errMsg) |
YRETCODE | _upload (const string &path, const string &content) |
YRETCODE | _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context) |
string | advertisedValue (void) |
void | clearCache () |
string | describe (void) |
string | errMessage (void) |
string | errorMessage (void) |
YRETCODE | errorType (void) |
YRETCODE | errType (void) |
YFUN_DESCR | functionDescriptor (void) |
string | get_advertisedValue (void) |
string | get_errorMessage (void) |
YRETCODE | get_errorType (void) |
virtual string | get_friendlyName (void) |
YFUN_DESCR | get_functionDescriptor (void) |
string | get_functionId (void) |
string | get_hardwareId (void) |
string | get_hubSerial () |
string | get_logicalName (void) |
YModule * | get_module (void) |
void * | get_userData (void) |
bool | isOnline (void) |
YRETCODE | load (int msValidity) |
virtual string | loadAttribute (string attrName) |
string | logicalName (void) |
YModule * | module (void) |
virtual int | muteValueCallbacks (void) |
YFunction * | next (void) |
YFunction * | nextFunction (void) |
virtual int | registerValueCallback (YFunctionValueCallback callback) |
int | set_advertisedValue (const string &newval) |
int | set_logicalName (const string &newval) |
void | set_userData (void *data) |
int | setAdvertisedValue (const string &newval) |
int | setLogicalName (const string &newval) |
void | setUserData (void *data) |
virtual int | unmuteValueCallbacks (void) |
void * | userData (void) |
virtual | ~YFunction () |
Static Public Member Functions | |
static YMessageBox * | Find (string func) |
static YMessageBox * | FindMessageBox (string func) |
static YMessageBox * | First (void) |
static YMessageBox * | FirstMessageBox (void) |
Static Public Member Functions inherited from YFunction | |
static void | _ClearCache (void) |
static YFunction * | Find (string func) |
static YFunction * | FindFunction (string func) |
static YFunction * | First (void) |
static YFunction * | FirstFunction (void) |
Static Public Attributes | |
static const string | COMMAND_INVALID = YAPI_INVALID_STRING |
static const int | PDURECEIVED_INVALID = YAPI_INVALID_UINT |
static const int | PDUSENT_INVALID = YAPI_INVALID_UINT |
static const string | SLOTSBITMAP_INVALID = YAPI_INVALID_STRING |
static const int | SLOTSCOUNT_INVALID = YAPI_INVALID_UINT |
static const int | SLOTSINUSE_INVALID = YAPI_INVALID_UINT |
Static Public Attributes inherited from YFunction | |
static const string | ADVERTISEDVALUE_INVALID = YAPI_INVALID_STRING |
static const string | FRIENDLYNAME_INVALID = YAPI_INVALID_STRING |
static const YFUN_DESCR | FUNCTIONDESCRIPTOR_INVALID = Y_FUNCTIONDESCRIPTOR_INVALID |
static const string | FUNCTIONID_INVALID = YAPI_INVALID_STRING |
static const string | HARDWAREID_INVALID = YAPI_INVALID_STRING |
static const string | LOGICALNAME_INVALID = YAPI_INVALID_STRING |
Protected Member Functions | |
virtual int | _parseAttr (YJSONObject *json_val) |
YMessageBox (const string &func) | |
Protected Member Functions inherited from YFunction | |
YRETCODE | _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg) |
string | _escapeAttr (const string &changeval) |
YRETCODE | _getDescriptor (YFUN_DESCR &fundescr, string &errMsg) |
YRETCODE | _getDevice (YDevice *&dev, string &errMsg) |
YRETCODE | _load_unsafe (int msValidity) |
YRETCODE | _nextFunction (string &hwId) |
int | _parse (YJSONObject *j) |
YRETCODE | _setAttr (string attrname, string newvalue) |
YFunction (const string &func) | |
Protected Attributes | |
string | _command |
vector< int > | _gsm2unicode |
bool | _gsm2unicodeReady |
string | _iso2gsm |
vector< YSms > | _messages |
int | _nextMsgRef |
int | _pduReceived |
vector< YSms > | _pdus |
int | _pduSent |
string | _prevBitmapStr |
string | _slotsBitmap |
int | _slotsCount |
int | _slotsInUse |
YMessageBoxValueCallback | _valueCallbackMessageBox |
Protected Attributes inherited from YFunction | |
string | _advertisedValue |
u64 | _cacheExpiration |
string | _className |
std::map< string, YDataStream * > | _dataStreams |
string | _func |
YFUN_DESCR | _fundescr |
string | _funId |
string | _hwId |
string | _lastErrorMsg |
YRETCODE | _lastErrorType |
string | _logicalName |
string | _serial |
yCRITICAL_SECTION | _this_cs |
void * | _userData |
YFunctionValueCallback | _valueCallbackFunction |
Friends | |
YMessageBox * | yFindMessageBox (const string &func) |
YMessageBox * | yFirstMessageBox (void) |
Additional Inherited Members | |
Static Protected Member Functions inherited from YFunction | |
static void | _AddToCache (const string &classname, const string &func, YFunction *obj) |
static YFunction * | _FindFromCache (const string &classname, const string &func) |
static void | _UpdateTimedReportCallbackList (YFunction *func, bool add) |
static void | _UpdateValueCallbackList (YFunction *func, bool add) |
Static Protected Attributes inherited from YFunction | |
static std::map< string, YFunction * > | _cache |
YMessageBox Class: MessageBox function interface
YMessageBox functions provides SMS sending and receiving capability to GSM-enabled Yoctopuce devices.
Definition at line 226 of file yocto_messagebox.h.
|
protected |
Definition at line 1273 of file yocto_messagebox.cpp.
YMessageBox::~YMessageBox | ( | ) |
Definition at line 1289 of file yocto_messagebox.cpp.
|
virtual |
Reimplemented from YFunction.
Definition at line 1627 of file yocto_messagebox.cpp.
|
protectedvirtual |
Reimplemented from YFunction.
Definition at line 1299 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 2000 of file yocto_messagebox.cpp.
|
virtual |
Clear the SMS units counters.
On failure, throws an exception or returns a negative error code.
Definition at line 2140 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 1643 of file yocto_messagebox.cpp.
|
inline |
Definition at line 351 of file yocto_messagebox.h.
|
virtual |
Definition at line 1649 of file yocto_messagebox.cpp.
|
inlinestatic |
Definition at line 488 of file yocto_messagebox.h.
|
static |
Retrieves a MessageBox interface for a given identifier. The identifier can be specified using several formats:
This function does not require that the MessageBox interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YMessageBox.isOnline() to test if the MessageBox interface is indeed online at a given time. In case of ambiguity when looking for a MessageBox interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
func | : a string that uniquely characterizes the MessageBox interface |
Definition at line 1576 of file yocto_messagebox.cpp.
|
inlinestatic |
Definition at line 512 of file yocto_messagebox.h.
|
static |
Starts the enumeration of MessageBox interfaces currently accessible. Use the method YMessageBox.nextMessageBox() to iterate on next MessageBox interfaces.
Definition at line 2246 of file yocto_messagebox.cpp.
string YMessageBox::get_command | ( | void | ) |
Definition at line 1511 of file yocto_messagebox.cpp.
|
virtual |
Returns the list of messages received and not deleted. This function will automatically decode concatenated SMS.
On failure, throws an exception or returns an empty list.
Definition at line 2230 of file yocto_messagebox.cpp.
int YMessageBox::get_pduReceived | ( | void | ) |
Returns the number of SMS units received so far.
On failure, throws an exception or returns Y_PDURECEIVED_INVALID.
Definition at line 1464 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 2127 of file yocto_messagebox.cpp.
int YMessageBox::get_pduSent | ( | void | ) |
Returns the number of SMS units sent so far.
On failure, throws an exception or returns Y_PDUSENT_INVALID.
Definition at line 1410 of file yocto_messagebox.cpp.
string YMessageBox::get_slotsBitmap | ( | void | ) |
Definition at line 1381 of file yocto_messagebox.cpp.
int YMessageBox::get_slotsCount | ( | void | ) |
Returns the total number of message storage slots on the SIM card.
On failure, throws an exception or returns Y_SLOTSCOUNT_INVALID.
Definition at line 1359 of file yocto_messagebox.cpp.
int YMessageBox::get_slotsInUse | ( | void | ) |
Returns the number of message storage slots currently in use.
On failure, throws an exception or returns Y_SLOTSINUSE_INVALID.
Definition at line 1330 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 1833 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 1749 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 1665 of file yocto_messagebox.cpp.
|
virtual |
Creates a new empty SMS message, to be configured and sent later on.
recipient | : a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign |
On failure, throws an exception or returns a negative error code.
Definition at line 2214 of file yocto_messagebox.cpp.
|
inline |
Definition at line 499 of file yocto_messagebox.h.
YMessageBox * YMessageBox::nextMessageBox | ( | void | ) |
Continues the enumeration of MessageBox interfaces started using yFirstMessageBox().
Definition at line 2236 of file yocto_messagebox.cpp.
|
virtual |
Definition at line 1637 of file yocto_messagebox.cpp.
|
inline |
Definition at line 333 of file yocto_messagebox.h.
|
inline |
Definition at line 308 of file yocto_messagebox.h.
|
virtual |
Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.
callback | : the callback function to call, or a NULL pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. |
Definition at line 1608 of file yocto_messagebox.cpp.
|
virtual |
Sends a Flash SMS (class 0 message). Flash messages are displayed on the handset immediately and are usually not saved on the SIM card. This function can send messages of more than 160 characters, using SMS concatenation. ISO-latin accented characters are supported. For sending messages with special unicode characters such as asian characters and emoticons, use newMessage to create a new message and define the content of using methods addText et addUnicodeData.
recipient | : a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign |
message | : the text to be sent in the message |
On failure, throws an exception or returns a negative error code.
Definition at line 2193 of file yocto_messagebox.cpp.
|
virtual |
Sends a regular text SMS, with standard parameters. This function can send messages of more than 160 characters, using SMS concatenation. ISO-latin accented characters are supported. For sending messages with special unicode characters such as asian characters and emoticons, use newMessage to create a new message and define the content of using methods addText and addUnicodeData.
recipient | : a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign |
message | : the text to be sent in the message |
On failure, throws an exception or returns a negative error code.
Definition at line 2167 of file yocto_messagebox.cpp.
int YMessageBox::set_command | ( | const string & | newval | ) |
Definition at line 1533 of file yocto_messagebox.cpp.
int YMessageBox::set_pduReceived | ( | int | newval | ) |
Changes the value of the incoming SMS units counter.
newval | : an integer corresponding to the value of the incoming SMS units counter |
On failure, throws an exception or returns a negative error code.
Definition at line 1495 of file yocto_messagebox.cpp.
int YMessageBox::set_pduSent | ( | int | newval | ) |
Changes the value of the outgoing SMS units counter.
newval | : an integer corresponding to the value of the outgoing SMS units counter |
On failure, throws an exception or returns a negative error code.
Definition at line 1441 of file yocto_messagebox.cpp.
|
inline |
Definition at line 355 of file yocto_messagebox.h.
|
inline |
Definition at line 346 of file yocto_messagebox.h.
|
inline |
Definition at line 321 of file yocto_messagebox.h.
|
inline |
Definition at line 296 of file yocto_messagebox.h.
|
inline |
Definition at line 291 of file yocto_messagebox.h.
|
inline |
Definition at line 279 of file yocto_messagebox.h.
|
virtual |
Definition at line 1924 of file yocto_messagebox.cpp.
|
friend |
Retrieves a MessageBox interface for a given identifier. The identifier can be specified using several formats:
This function does not require that the MessageBox interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method YMessageBox.isOnline() to test if the MessageBox interface is indeed online at a given time. In case of ambiguity when looking for a MessageBox interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
func | : a string that uniquely characterizes the MessageBox interface |
Definition at line 549 of file yocto_messagebox.h.
|
friend |
Starts the enumeration of MessageBox interfaces currently accessible. Use the method YMessageBox.nextMessageBox() to iterate on next MessageBox interfaces.
Definition at line 560 of file yocto_messagebox.h.
|
protected |
Definition at line 239 of file yocto_messagebox.h.
|
protected |
Definition at line 246 of file yocto_messagebox.h.
|
protected |
Definition at line 245 of file yocto_messagebox.h.
|
protected |
Definition at line 247 of file yocto_messagebox.h.
|
protected |
Definition at line 244 of file yocto_messagebox.h.
|
protected |
Definition at line 241 of file yocto_messagebox.h.
|
protected |
Definition at line 238 of file yocto_messagebox.h.
|
protected |
Definition at line 243 of file yocto_messagebox.h.
|
protected |
Definition at line 237 of file yocto_messagebox.h.
|
protected |
Definition at line 242 of file yocto_messagebox.h.
|
protected |
Definition at line 236 of file yocto_messagebox.h.
|
protected |
Definition at line 235 of file yocto_messagebox.h.
|
protected |
Definition at line 234 of file yocto_messagebox.h.
|
protected |
Definition at line 240 of file yocto_messagebox.h.
|
static |
Definition at line 268 of file yocto_messagebox.h.
|
static |
Definition at line 267 of file yocto_messagebox.h.
|
static |
Definition at line 266 of file yocto_messagebox.h.
|
static |
Definition at line 265 of file yocto_messagebox.h.
|
static |
Definition at line 264 of file yocto_messagebox.h.
|
static |
Definition at line 263 of file yocto_messagebox.h.