public interface TapNLinkSys
Example: TapNLinkSys system; int time = system.getTimeMsSinceReset();
Modifier and Type | Field and Description |
---|---|
static int |
BYTECODEVERSION |
static int |
DELETE |
static int |
GET |
static int |
MAXVERSION |
static int |
MINVERSION |
static int |
MQTT_MSG_IN |
static int |
POST |
static int |
PUT |
static int |
TAPVERSION |
Modifier and Type | Method and Description |
---|---|
int |
connectMQTT(java.lang.String subscribedTopic)
Deprecated.
|
int[] |
convertTime(long timestamp)
Convert time stamp to standard C tm set of values.
|
int |
engineCommand(int cmd,
int obj,
int instance,
int resource,
byte[] payload)
Sends a command to the tap, using its object based resource API.
|
int |
engineCommand(int cmd,
int obj,
int instance,
int resource,
java.lang.Integer length,
byte[] payloadin,
byte[] payloadout) |
int |
getFreeHeap()
Determine the amount of available memory
Version: +1.97
|
double |
getRandom()
Build a random number
|
int |
getSleepDelay()
Returns the current period of time in second for the low power mode (duration
of the
timeout to leave the Low Power mode).
|
int |
getTimeMsSinceReset()
Returns time since last boot of the Tap, in milliseconds.
|
long |
getTimeStamp()
Returns time since 1st January 1970, in seconds.
|
int |
getVersion(int ver)
Returns version numbers of the Tap or the JVM.
|
int |
initLoRaWAN(int active_region,
int default_class,
boolean adr_enable,
int default_datarate,
int ping_periodicity)
Init for LoRaWAN communications (LoRa Tap only)
Version: +1.116
|
int |
joinLoRaWAN_ABP(byte[] DevAddr,
byte[] AppSKey,
byte[] NwkSKey)
Join LoRaWAN network using ABP method
Version: +2.10
|
int |
joinLoRaWAN_OTAA(byte[] JoinEUI,
byte[] AppKey,
byte[] NwkKey)
Join LoRaWAN network using OTAA method
Version: +1.116
|
void |
log(java.lang.String msg,
int mode)
Log information so it can be retrieved by IoTize Studio, or custom apps.
|
void |
pause(int ms)
Pause the Java thread for a given amount of time.
|
java.lang.String |
readMQTTMessage()
Deprecated.
Read a recently received MQTT message.
A message is available when the check() function has been notified
with the id TapNLinkSys.MQTT_MSG_IN (-2).
|
void |
resetJVM()
Reset the Java Virtual Machine without resetting the Tap
Version: +1.114
|
void |
resetLoRa()
Reset the LoRa without resetting the Tap
Version: +2.10
|
int |
sendLoRaWANMessage(int port,
byte[] msg,
int len)
Send a LoRaWAN message (LoRa Tap only)
Version: +1.114
|
int |
sendMQTTMessage(java.lang.String topic,
java.lang.String msg,
int qos)
Deprecated.
|
void |
setHeapSize(int size)
Specify the size of the dynamic heap.
|
void |
setSleepDelay(int newdelay)
Set the current period of time in second for the low power mode (duration of
the
timeout to leave the Low Power mode).
|
void |
setTimeStamp(long timestamp)
Set time (since 1st January 1970, in seconds).
|
int |
startBLE()
Starts the BLE of the Tap.
|
int |
startWifi()
Starts the Wifi of the Tap.
|
int |
stopBLE()
Stops the BLE of the Tap.
|
int |
stopWifi()
Stops the Wifi of the Tap.
|
int |
subscribeMQTT(java.lang.String subscribedTopic)
Deprecated.
|
static final int GET
static final int POST
static final int PUT
static final int DELETE
static final int TAPVERSION
static final int BYTECODEVERSION
static final int MINVERSION
static final int MAXVERSION
static final int MQTT_MSG_IN
int getTimeMsSinceReset()
long getTimeStamp()
void setTimeStamp(long timestamp)
int[] convertTime(long timestamp)
void pause(int ms)
ms
- the amount of time the thread of the JVM will NOT be called (in
milliseconds).@Deprecated int connectMQTT(java.lang.String subscribedTopic)
topic
- the MQTT topic to subscribe to@Deprecated int subscribeMQTT(java.lang.String subscribedTopic)
topic
- the MQTT topic to subscribe to@Deprecated int sendMQTTMessage(java.lang.String topic, java.lang.String msg, int qos)
topic
- the MQTT topic to publish tomsg
- the message to be publishedqos
- the quality of service required for the message (0, 1 or 2)@Deprecated java.lang.String readMQTTMessage()
int engineCommand(int cmd, int obj, int instance, int resource, byte[] payload)
cmd
- the method of the commandobj
- the id of the objectinstance
- the id of the instanceresource
- the id of the resourcepayload
- the single I/O buffer (either for GET or PUT)length
- the length of the answer bufferpayloadin
- the Input buffer (used when GET required parameters)payloadout
- the answer bufferint engineCommand(int cmd, int obj, int instance, int resource, java.lang.Integer length, byte[] payloadin, byte[] payloadout)
int getVersion(int ver)
ver
- the id of the version to getint getSleepDelay()
void setSleepDelay(int newdelay)
newdelay
- delay to be specified in secondsvoid setHeapSize(int size)
size
- size in bytesint getFreeHeap()
int sendLoRaWANMessage(int port, byte[] msg, int len)
port
- LoRaWAN FPort to send the payload to.msg
- Payload to send.len
- Size of the payload (bytes).int initLoRaWAN(int active_region, int default_class, boolean adr_enable, int default_datarate, int ping_periodicity)
active_region
- Active Region - For now, only EU868 and US815 are
available
[AS923 = 0, AU915 = 1, CN470 = 2, CN779 = 3, EU433 =
4,
EU868 = 5, KR920 = 6, IN865 = 7, US915 = 8, RU864 =
9]default_class
- Default Class
[CLASS_A = 0x00, CLASS_B = 0x01, CLASS_C = 0x02]adr_enable
- Holds the ADR statedefault_datarate
- Uplink datarate, when adr_enable is OFFping_periodicity
- Periodicity of the ping slotsint joinLoRaWAN_OTAA(byte[] JoinEUI, byte[] AppKey, byte[] NwkKey)
JoinEUI
- LORAWAN_JOIN_EUI/8 bytes (LORAWAN_APP_EUI for LoRaWAN 1.0.x)AppKey
- LORAWAN_APP_KEY/16 bytes (N/A for LoRaWAN 1.0.x)NwkKey
- LORAWAN_NWK_KEY/16 bytes (LORAWAN_APP_KEY for LoRaWAN 1.0.x)int joinLoRaWAN_ABP(byte[] DevAddr, byte[] AppSKey, byte[] NwkSKey)
DevAddr
- Device Address/4 bytesAppSKey
- LORAWAN_APP_S_KEY/16 bytes (LORAWAN_APP_S_KEY for LoRaWAN
1.0.x)NwkSKey
- LORAWAN_NWK_S_KEY/16 bytes for LoRaWAN 1.0.x
(LORAWAN_F_NWK_S_INT_KEY/LORAWAN_S_NWK_S_INT_KEY/LORAWAN_NWK_S_ENC_KEY
for LoRaWAN 1.1.x)void resetLoRa()
void resetJVM()
int startWifi()
int stopWifi()
int startBLE()
int stopBLE()
void log(java.lang.String msg, int mode)
msg
- The String to log (up to 200 chars)mode
- 0 to add to th current logged message, 1 to replace itdouble getRandom()