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 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 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 |
---|---|
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 MessageBox interface for a given identifier.
|
static YMessageBox |
FindMessageBoxInContext(YAPIContext yctx,
String func)
Retrieves a MessageBox interface for a given identifier in a YAPI context.
|
static YMessageBox |
FirstMessageBox()
Starts the enumeration of MessageBox interfaces currently accessible.
|
static YMessageBox |
FirstMessageBoxInContext(YAPIContext yctx)
Starts the enumeration of MessageBox interfaces currently accessible.
|
String |
get_command() |
ArrayList<YSms> |
get_messages()
Returns the list of messages received and not deleted.
|
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.
|
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 MessageBox 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_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 |
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, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, 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, userData
public 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 COMMAND_INVALID
protected int _slotsInUse
protected int _slotsCount
protected String _slotsBitmap
protected int _pduSent
protected int _pduReceived
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 YFunction
Exception
public 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_Exception
public 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_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YMessageBox FindMessageBox(String func)
func
- : a string that uniquely characterizes the MessageBox interfacepublic static YMessageBox FindMessageBoxInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the MessageBox interfacepublic 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 YFunction
public int nextMsgRef()
public int clearSIMSlot(int slot) throws YAPI_Exception
YAPI_Exception
public YSms fetchPdu(int slot) throws YAPI_Exception
YAPI_Exception
public int initGsm2Unicode()
public String gsm2str(byte[] gsm)
public byte[] str2gsm(String msg)
public int checkNewMessages() throws YAPI_Exception
YAPI_Exception
public ArrayList<YSms> get_pdus() throws YAPI_Exception
YAPI_Exception
public 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 © 2019. All rights reserved.