public class YMessageBox extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YMessageBox.TimedReportCallback
TimedReportCallback for MessageBox
|
static interface |
YMessageBox.UpdateCallback
Deprecated UpdateCallback for MessageBox
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
_command |
protected ArrayList<Integer> |
_gsm2unicode |
protected boolean |
_gsm2unicodeReady |
protected byte[] |
_iso2gsm |
protected ArrayList<YSms> |
_messages |
protected int |
_nextMsgRef |
protected String |
_obey |
protected int |
_pduReceived |
protected ArrayList<YSms> |
_pdus |
protected int |
_pduSent |
protected String |
_prevBitmapStr |
protected String |
_slotsBitmap |
protected int |
_slotsCount |
protected int |
_slotsInUse |
protected YMessageBox.UpdateCallback |
_valueCallbackMessageBox |
static String |
COMMAND_INVALID
invalid command value
|
static String |
OBEY_INVALID
invalid obey value
|
static int |
PDURECEIVED_INVALID
invalid pduReceived value
|
static int |
PDUSENT_INVALID
invalid pduSent value
|
static String |
SLOTSBITMAP_INVALID
invalid slotsBitmap value
|
static int |
SLOTSCOUNT_INVALID
invalid slotsCount value
|
static int |
SLOTSINUSE_INVALID
invalid slotsInUse value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID| Modifier | Constructor and Description |
|---|---|
protected |
YMessageBox(String func) |
protected |
YMessageBox(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
String |
_AT(String cmd) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
checkNewMessages() |
int |
clearPduCounters()
Clear the SMS units counters.
|
int |
clearSIMSlot(int slot) |
YSms |
fetchPdu(int slot) |
static YMessageBox |
FindMessageBox(String func)
Retrieves a SMS message box interface for a given identifier.
|
static YMessageBox |
FindMessageBoxInContext(YAPIContext yctx,
String func)
Retrieves a SMS message box interface for a given identifier in a YAPI context.
|
static YMessageBox |
FirstMessageBox()
Starts the enumeration of SMS message box interfaces currently accessible.
|
static YMessageBox |
FirstMessageBoxInContext(YAPIContext yctx)
Starts the enumeration of SMS message box interfaces currently accessible.
|
String |
get_command() |
ArrayList<YSms> |
get_messages()
Returns the list of messages received and not deleted.
|
String |
get_obey()
Returns the phone number authorized to send remote management commands.
|
int |
get_pduReceived()
Returns the number of SMS units received so far.
|
ArrayList<YSms> |
get_pdus() |
int |
get_pduSent()
Returns the number of SMS units sent so far.
|
String |
get_slotsBitmap() |
int |
get_slotsCount()
Returns the total number of message storage slots on the SIM card.
|
int |
get_slotsInUse()
Returns the number of message storage slots currently in use.
|
String |
getObey()
Returns the phone number authorized to send remote management commands.
|
int |
getPduReceived()
Returns the number of SMS units received so far.
|
int |
getPduSent()
Returns the number of SMS units sent so far.
|
int |
getSlotsCount()
Returns the total number of message storage slots on the SIM card.
|
int |
getSlotsInUse()
Returns the number of message storage slots currently in use.
|
String |
gsm2str(byte[] gsm) |
ArrayList<Integer> |
gsm2unicode(byte[] gsm) |
int |
initGsm2Unicode() |
YSms |
newMessage(String recipient)
Creates a new empty SMS message, to be configured and sent later on.
|
YMessageBox |
nextMessageBox()
Continues the enumeration of SMS message box interfaces started using yFirstMessageBox().
|
int |
nextMsgRef() |
int |
registerValueCallback(YMessageBox.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
sendFlashMessage(String recipient,
String message)
Sends a Flash SMS (class 0 message).
|
int |
sendTextMessage(String recipient,
String message)
Sends a regular text SMS, with standard parameters.
|
int |
set_command(String newval) |
int |
set_obey(String newval)
Changes the phone number authorized to send remote management commands.
|
int |
set_pduReceived(int newval)
Changes the value of the incoming SMS units counter.
|
int |
set_pduSent(int newval)
Changes the value of the outgoing SMS units counter.
|
int |
setObey(String newval)
Changes the phone number authorized to send remote management commands.
|
int |
setPduReceived(int newval)
Changes the value of the incoming SMS units counter.
|
int |
setPduSent(int newval)
Changes the value of the outgoing SMS units counter.
|
byte[] |
str2gsm(String msg) |
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int SLOTSINUSE_INVALID
public static final int SLOTSCOUNT_INVALID
public static final String SLOTSBITMAP_INVALID
public static final int PDUSENT_INVALID
public static final int PDURECEIVED_INVALID
public static final String OBEY_INVALID
public static final String COMMAND_INVALID
protected int _slotsInUse
protected int _slotsCount
protected String _slotsBitmap
protected int _pduSent
protected int _pduReceived
protected String _obey
protected String _command
protected YMessageBox.UpdateCallback _valueCallbackMessageBox
protected int _nextMsgRef
protected String _prevBitmapStr
protected boolean _gsm2unicodeReady
protected byte[] _iso2gsm
protected YMessageBox(YAPIContext ctx, String func)
func - : functionidprotected YMessageBox(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int get_slotsInUse()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getSlotsInUse()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_slotsCount()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getSlotsCount()
throws YAPI_Exception
YAPI_Exception - on errorpublic String get_slotsBitmap() throws YAPI_Exception
YAPI_Exceptionpublic int get_pduSent()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPduSent()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_pduSent(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the value of the outgoing SMS units counterYAPI_Exception - on errorpublic int setPduSent(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the value of the outgoing SMS units counterYAPI_Exception - on errorpublic int get_pduReceived()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPduReceived()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_pduReceived(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the value of the incoming SMS units counterYAPI_Exception - on errorpublic int setPduReceived(int newval)
throws YAPI_Exception
newval - : an integer corresponding to the value of the incoming SMS units counterYAPI_Exception - on errorpublic String get_obey() throws YAPI_Exception
YAPI_Exception - on errorpublic String getObey() throws YAPI_Exception
YAPI_Exception - on errorpublic int set_obey(String newval) throws YAPI_Exception
newval - : a string corresponding to the phone number authorized to send remote management commandsYAPI_Exception - on errorpublic int setObey(String newval) throws YAPI_Exception
newval - : a string corresponding to the phone number authorized to send remote management commandsYAPI_Exception - on errorpublic String get_command() throws YAPI_Exception
YAPI_Exceptionpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exceptionpublic static YMessageBox FindMessageBox(String func)
func - : a string that uniquely characterizes the SMS message box interface, for instance
YHUBGSM1.messageBox.public static YMessageBox FindMessageBoxInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the SMS message box interface, for instance
YHUBGSM1.messageBox.public int registerValueCallback(YMessageBox.UpdateCallback callback)
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.public int _invokeValueCallback(String value)
_invokeValueCallback in class YFunctionpublic int nextMsgRef()
public int clearSIMSlot(int slot)
throws YAPI_Exception
YAPI_Exceptionpublic String _AT(String cmd) throws YAPI_Exception
YAPI_Exceptionpublic YSms fetchPdu(int slot) throws YAPI_Exception
YAPI_Exceptionpublic int initGsm2Unicode()
public String gsm2str(byte[] gsm)
public byte[] str2gsm(String msg)
public int checkNewMessages()
throws YAPI_Exception
YAPI_Exceptionpublic ArrayList<YSms> get_pdus() throws YAPI_Exception
YAPI_Exceptionpublic int clearPduCounters()
throws YAPI_Exception
YAPI_Exception - on errorpublic int sendTextMessage(String recipient, String message) throws YAPI_Exception
recipient - : a text string with the recipient phone number, either as a
national number, or in international format starting with a plus signmessage - : the text to be sent in the messageYAPI_Exception - on errorpublic int sendFlashMessage(String recipient, String message) throws YAPI_Exception
recipient - : a text string with the recipient phone number, either as a
national number, or in international format starting with a plus signmessage - : the text to be sent in the messageYAPI_Exception - on errorpublic YSms newMessage(String recipient) throws YAPI_Exception
recipient - : a text string with the recipient phone number, either as a
national number, or in international format starting with a plus signYAPI_Exception - on errorpublic ArrayList<YSms> get_messages() throws YAPI_Exception
YAPI_Exception - on errorpublic YMessageBox nextMessageBox()
public static YMessageBox FirstMessageBox()
public static YMessageBox FirstMessageBoxInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.