import android.content.Context;
import android.widget.Toast;
+import android.util.Log;
import org.iotivity.base.OcPlatform;
import org.iotivity.base.ResourceProperty;
*/
public class Common {
+ private static final String TAG = "OIC_SIMPLE_COMMON";
public static final int DATA_SIZE = 3000;
+ public static String HOST = "coap+tcp://192.168.0.1:5683";
public static final String COAP_TCP = "coap+tcp://";
+ public static final String COAPS_TCP = "coaps+tcp://";
public static String TCP_ADDRESS = "192.168.0.1";
- public static final String TCP_PORT = ":8000";
+ public static String TCP_PORT = "5683";
+ public static final String PORT_SEPARATOR = ":";
public static final String IP_ADDRESS = "0.0.0.0";
public static final int IP_PORT = 0;
public static final String GET_COMMAND = "get_command";
public static final EnumSet<ResourceProperty> RESOURCE_PROPERTIES =
EnumSet.of(ResourceProperty.DISCOVERABLE, ResourceProperty.OBSERVABLE);
+ // MQ
+ public final static String MQ_DEFAULT_TOPIC_URI = "/oic/ps/cleanroom";
+ public final static String MQ_BROKER_URI = "/oic/ps";
+
+ private static String mLeAddress = null;
+
public static String getDateCurrentTimeZone() {
StringBuilder sb = new StringBuilder();
try {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,
- DateFormat.DEFAULT,
- Locale.getDefault());
+ DateFormat.DEFAULT,
+ Locale.getDefault());
Date currentTimeZone = calendar.getTime();
sb.append(dateFormat.format(currentTimeZone));
} catch (Exception e) {
public static void showToast(Context context, String msg) {
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}
+
+ public static void setLeAddress(String address)
+ {
+ Log.i(TAG, "setLeAddress : " + address.toString());
+ mLeAddress = address;
+ }
+
+ public static String getLeAddress()
+ {
+ Log.i(TAG, "getLeAddress : " + mLeAddress);
+ return mLeAddress;
+ }
}
+