private final int OCSTACK_ERROR = 255;
private final int RESOURCEHOSTING_DO_NOT_THREADRUNNING = -2;
- private String TAG = "ResourceHosting";
+ private final String TAG = "NMResourceHosting : " + this.getClass().getSimpleName();
private TextView mLogTextView;
private String mLog = "";
/**
catch (Exception e)
{
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
+ Log.d(TAG, e.getMessage() + result);
}
break;
case R.id.btnStopHosting:
{
mLog = "";
mLogTextView.setText(mLog);
+ Log.i(TAG, "Log textbox is cleared");
}
/**
{
mLog += msg + "\n";
mLogTextView.setText(mLog);
+ Log.i(TAG, msg);
}
/**
OcPlatform.OnResourceFoundListener, OnGetListener, OnDeleteListener,
OnObserveListener, OnPutListener
{
- private final String TAG = "sample_consumer";
+ private final String TAG = "NMConsumer : " + this.getClass().getSimpleName();
public static final int OC_STACK_OK = 0;
public static final String OBSERVE = "Observe";
OcPlatform.Configure(cfg);
current_log_result += "Created Platform...\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
findResourceCandidate();
PRINT();
}
nmfindResource("", "/oc/core?rt=Resource.Hosting");
current_log_result += "Finding Resource... \n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
public void nmfindResource(String host, String resourceName)
e.printStackTrace();
current_log_result += e.getMessage() + "\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
{
current_log_result += "Getting Light Representation...\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
{
current_log_result += "Getting Light Representation...\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
try
{
e.printStackTrace();
current_log_result += e.getMessage() + "\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
}
Map<String, String> queryParamsMap = new HashMap<String, String>();
current_log_result += "startObserve\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
try
{
e.printStackTrace();
current_log_result += e.getMessage() + "\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
}
Map<String, String> queryParamsMap = new HashMap<String, String>();
current_log_result += "startGet\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
try
{
e.printStackTrace();
current_log_result += e.getMessage() + "\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
}
Map<String, String> queryParamsMap = new HashMap<String, String>();
current_log_result += "startPut\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
try
{
e.printStackTrace();
current_log_result += e.getMessage() + "\n";
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
}
{
case R.id.btn_observe:
tv_select_method_type.setText(OBSERVE);
+ Log.i(TAG, "Method: " + OBSERVE);
startObserve(curResource);
btn_observe.setClickable(false);
break;
case R.id.btn_get:
tv_select_method_type.setText(GET);
+ Log.i(TAG, "Method: " + GET);
startGet(curResource);
btn_get.setClickable(false);
break;
case R.id.btn_put:
tv_select_method_type.setText(PUT);
+ Log.i(TAG, "Method: " + PUT);
startPut(curResource);
btn_put.setClickable(false);
break;
tv_select_method_type.setText(POST);
Toast.makeText(this, "Not Supported Yet", Toast.LENGTH_SHORT)
.show();
+ Log.i(TAG, "Method: " + POST);
break;
case R.id.btn_delete:
tv_select_method_type.setText(DELETE);
+ Log.i(TAG, "Method: " + DELETE);
try {
startDelete(curResource);
} catch (OcException e) {
break;
case R.id.btn_clean:
cleanLogString();
+ Log.i(TAG, "Log textbox is cleared");
break;
default:
if (receive_result != null)
{
tv_receive_result.setText(receive_result);
+ Log.i(TAG, "Received: " + receive_result);
}
if (found_uri != null)
{
tv_found_uri.setText(found_uri);
+ Log.i(TAG, "URI: " + found_uri);
}
if (current_log_result != null)
{
tv_current_log_result.setText(current_log_result);
+ Log.i(TAG, current_log_result);
}
}
final String message = intent
.getStringExtra(MESSAGE);
tv_current_log_result.setText(message);
+ Log.i(TAG, message);
viewText();
}
}
public class SampleProvider extends Activity implements OnClickListener,
IMessageLogger
{
- private final static String TAG = "SampleProvider : ";
+ private final static String TAG = "NMProvider : SampleProvider";
private TextView mLogTextView;
private TextView mTempValue;
private TextView mHumValue;
break;
case R.id.btnLogClear:
mLogTextView.setText("");
+ Log.i(TAG, "Log message cleared");
break;
}
private OcResourceHandle mResourceHandle;
private List<Byte> mObservationIds;
- private static String TAG = "SampleProvider : ";
+ private static String TAG = "NMProvider : TemperatureResource";
TemperatureResource(Context context)
{
{
Log.e(TAG, "go exception");
logMessage(TAG + "RegisterResource error. " + e.getMessage());
- Log.e(TAG, e.getMessage());
+ Log.e(TAG, "RegisterResource error. " + e.getMessage());
}
// logMessage(TAG + "Successfully registered resource");
public void logMessage(String msg)
{
logMsg(msg);
+ Log.i(TAG, msg);
}
public void logMsg(final String text)
private static Context m_context;
private static final int TRUE = 1;
private static final int FALSE = 0;
+ private static final String LOG_TAG = "PPMSampleApp : FelixManager";
static final String ANDROID_FRAMEWORK_PACKAGES = ("android,"
+ "android.app,"
}
public static void LogEx(String info) {
- Log.d("felix", info);
+ Log.d(LOG_TAG, info);
}
private FelixManager(Context ctx) {
LogEx("Bundle: " + b.getSymbolicName());
}
} catch (Throwable ex) {
- Log.d("Felix", "could not create framework: " + ex.getMessage(), ex);
+ Log.d(LOG_TAG, "could not create framework: " + ex.getMessage(), ex);
}
}
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
if (b.getSymbolicName().equals(id)) {
- Log.d("Felix", "bundle: " + b.getBundleId()
+ Log.d(LOG_TAG, "bundle: " + b.getBundleId()
+ " symbolicName : " + b.getSymbolicName());
b.uninstall();
- Log.d("Felix", "uninstall end");
+ Log.d(LOG_TAG, "uninstall end");
}
}
} catch (BundleException e) {
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
if (!b.getSymbolicName().equals("org.apache.felix.framework")) {
- Log.d("Felix", "bundle: " + b.getBundleId()
+ Log.d(LOG_TAG, "bundle: " + b.getBundleId()
+ " symbolicName : " + b.getSymbolicName());
b.uninstall();
- Log.d("Felix", "uninstall end");
+ Log.d(LOG_TAG, "uninstall end");
}
}
} catch (BundleException e) {
public static int start(String id) {
int flag = TRUE;
- Log.d("Felix", "String id : " + id);
+ Log.d(LOG_TAG, "String id : " + id);
try {
BundleContext bContext = m_felix.getBundleContext();
bContext.registerService(Context.class.getName(), m_context, null);
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
- Log.d("Felix", "symbolicName : " + b.getSymbolicName());
+ Log.d(LOG_TAG, "symbolicName : " + b.getSymbolicName());
if (b.getSymbolicName().equals(id)) {
- Log.d("Felix", "bundle: " + b.getBundleId()
+ Log.d(LOG_TAG, "bundle: " + b.getBundleId()
+ " symbolicName : " + b.getSymbolicName());
b.start();
- Log.d("Felix", "start end");
+ Log.d(LOG_TAG, "start end");
}
}
} catch (BundleException e) {
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
if (b.getSymbolicName().equals(id)) {
- Log.d("Felix", "bundle: " + b.getBundleId()
+ Log.d(LOG_TAG, "bundle: " + b.getBundleId()
+ " symbolicName : " + b.getSymbolicName());
b.stop();
- Log.d("Felix", "stop end");
+ Log.d(LOG_TAG, "stop end");
}
}
} catch (BundleException e) {
}
public static String getValue(String name, String key) {
- Log.d("FELIX", "getValue");
+ Log.d(LOG_TAG, "getValue");
BundleContext bContext = m_felix.getBundleContext();
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
Dictionary<String, String> dic = b.getHeaders();
String bundlename = b.getSymbolicName();
- Log.d("FELIX", "Bundlename: " + bundlename);
+ Log.d(LOG_TAG, "Bundlename: " + bundlename);
if (bundlename.equals(name)) {
if (dic.get("Bundle-" + key) == null) {
- Log.d("FELIX", name + " null");
+ Log.d(LOG_TAG, name + " null");
return "";
}
- Log.d("FELIX", name + " " + dic.get("Bundle-" + key));
+ Log.d(LOG_TAG, name + " " + dic.get("Bundle-" + key));
return dic.get("Bundle-" + key);
}
}
}
public static String getState(String name) {
- Log.d("FELIX", "getState");
+ Log.d(LOG_TAG, "getState");
BundleContext bContext = m_felix.getBundleContext();
org.osgi.framework.Bundle[] bundles = bContext.getBundles();
for (org.osgi.framework.Bundle b : bundles) {
String bundlename = b.getSymbolicName();
if (bundlename.equals(name)) {
- Log.d("FELIX", state_to_string(b.getState()));
+ Log.d(LOG_TAG, state_to_string(b.getState()));
return state_to_string(b.getState());
}
}
- Log.d("FELIX", "null");
+ Log.d(LOG_TAG, "null");
return "";
}
public static int ObservePluginPath(String path) {
int flag = TRUE;
- Log.d("FELIX", "ObservePluginPath" + path);
+ Log.d(LOG_TAG, "ObservePluginPath" + path);
FileObserver observer = new FileObserver(path) {
@Override
public void onEvent(int event, String path) {
- Log.d("FELIX", "Observing start : " + path);
- Log.d("FELIX", "Observing event : " + getEventString(event));
+ Log.d(LOG_TAG, "Observing start : " + path);
+ Log.d(LOG_TAG, "Observing event : " + getEventString(event));
}
};
observer.startWatching();
int flag = TRUE;
if (path == "") {
System.out.println("PluginManager path is Null\n");
- Log.d("FELIX", "PluginManager path is Null\n");
+ Log.d(LOG_TAG, "PluginManager path is Null\n");
flag = FALSE;
return flag;
}
} else {
String fullPath = "/data/data/"
+ m_context.getPackageName() + "/" + path;
- Log.d("FELIX", fullPath);
+ Log.d(LOG_TAG, fullPath);
File dir = new File(fullPath);
if (!dir.exists())
}
}
} catch (IOException ex) {
- Log.e("tag", "I/O Exception", ex);
+ Log.e(LOG_TAG, "I/O Exception", ex);
}
}
out.close();
out = null;
} catch (Exception e) {
- Log.e("tag", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
}
}
\ No newline at end of file
import android.util.Log;
public class FoundResource implements OcPlatform.OnResourceFoundListener {
- final private static String TAG = "FoundResource";
+ final private static String TAG = "PPMSampleApp : FoundResource";
public void onResourceFound(OcResource resource) {
static ToggleButton Hue;
static android.widget.NumberPicker hue_color;
static Activity mActivity;
+ final private static String LOG_TAG = "PPMSampleApp : MainActivity";
PluginManager m_pm;
Map<Integer, Integer> onValueChangefinalVal = new HashMap<Integer, Integer>();
Map<Integer, Boolean> onValueChangeThreadStart = new HashMap<Integer, Boolean>();
String[] np_h = new String[11];
+
@Override
protected void onCreate(Bundle savedInstanceState) {
OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY,
OcConnectivityType.ALL, foundResource);
} catch (Exception e) {
- Log.e("Felix", "Exception : " + e);
+ Log.e(LOG_TAG, "Exception : " + e);
}
Belkin = (Button) findViewById(R.id.btn_belkin);
Belkin.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Belkin button click listener");
+ Log.i(LOG_TAG, "Belkin button click listener");
OcRepresentation rep = new OcRepresentation();
try {
if (belkinplug.m_power == null) {
- Log.i("Felix", "m_power is null");
+ Log.i(LOG_TAG, "m_power is null");
belkinplug.m_power = "on";
rep.setValue("power", "on");
}
if (belkinplug.m_power.equals("on")) {
Toast.makeText(getApplicationContext(), "Off",
Toast.LENGTH_SHORT).show();
- Log.i("Felix", "belkin wemo off");
+ Log.i(LOG_TAG, "belkin wemo off");
rep.setValue("power", "off");
} else if (belkinplug.m_power.equals("off")) {
Toast.makeText(getApplicationContext(), "On",
Toast.LENGTH_SHORT).show();
- Log.i("Felix", "belkin wemo on");
+ Log.i(LOG_TAG, "belkin wemo on");
rep.setValue("power", "on");
} else {
rep.setValue("power", "on");
rep.setValue("brightness", 0);
rep.setValue("color", 0);
} catch (OcException e) {
- Log.e("Felix", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
OnPutBelkinplug onPut = new OnPutBelkinplug();
if (belkinResource != null) {
} else {
Toast.makeText(getApplicationContext(), "Belkinplug null",
Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Belkinplug null");
}
}
});
belkinstart = (Button) findViewById(R.id.Button01);
belkinstart.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "start button click listener");
+ Log.i(LOG_TAG, "start button click listener");
m_pm.startPlugins("ResourceType", "device.smartplug");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
- Log.i("Felix", "run called!!!");
+ Log.i(LOG_TAG, "run called!!!");
FoundResource foundResource = new FoundResource();
try {
OcPlatform
belkinstop = (Button) findViewById(R.id.Button02);
belkinstop.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "stop button click listener");
+ Log.i(LOG_TAG, "stop button click listener");
m_pm.stopPlugins("ResourceType", "device.smartplug");
belkinResource = null;
try {
belkingetPlugins = (Button) findViewById(R.id.Button03);
belkingetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getPlugins button click listener");
+ Log.i(LOG_TAG, "getPlugins button click listener");
user_plugin = m_pm.getPlugins();
// key = "name";
state = "";
belkingetPlugins = (Button) findViewById(R.id.Button04);
belkingetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getState click listener");
+ Log.i(LOG_TAG, "getState click listener");
state = m_pm.getState("wemo");
if (state == "")
state = "null";
belkinrescan = (Button) findViewById(R.id.Button05);
belkinrescan.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Rescan Plugin click listener");
+ Log.i(LOG_TAG, "Rescan Plugin click listener");
m_pm.rescanPlugin();
try {
Thread.sleep(2000);
Gear = (Button) findViewById(R.id.btn_gear);
Gear.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Gear button click listener");
+ Log.i(LOG_TAG, "Gear button click listener");
OcRepresentation rep = new OcRepresentation();
try{
rep.setValue("brightness", 0);
rep.setValue("color", 0);
} catch (OcException e) {
- Log.e("Felix", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
if (gearResource != null) {
Toast.makeText(getApplicationContext(),
"Send Noti. to Gear", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Send Noti. to Gear");
try {
OnPutGear onPut = new OnPutGear();
gearResource.put(rep, new HashMap<String, String>(),
} else {
Toast.makeText(getApplicationContext(), "Gear is null",
Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Gear is null");
}
}
});
gearstart = (Button) findViewById(R.id.Button06);
gearstart.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "start button click listener");
+ Log.i(LOG_TAG, "start button click listener");
m_pm.startPlugins("ResourceType", "device.notify");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
- Log.i("Felix", "run called!!!");
+ Log.i(LOG_TAG, "run called!!!");
FoundResource foundResource = new FoundResource();
try {
OcPlatform
gearstop = (Button) findViewById(R.id.Button07);
gearstop.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "stop button click listener");
+ Log.i(LOG_TAG, "stop button click listener");
m_pm.stopPlugins("ResourceType", "device.notify");
gearResource = null;
try {
geargetPlugins = (Button) findViewById(R.id.Button08);
geargetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getPlugins button click listener");
+ Log.i(LOG_TAG, "getPlugins button click listener");
user_plugin = m_pm.getPlugins();
state = "";
id = "";
geargetPlugins = (Button) findViewById(R.id.Button09);
geargetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getState click listener");
+ Log.i(LOG_TAG, "getState click listener");
state = m_pm.getState("gearnoti");
if (state == "")
state = "null";
gearrescan = (Button) findViewById(R.id.Button10);
gearrescan.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Rescan Plugin click listener");
+ Log.i(LOG_TAG, "Rescan Plugin click listener");
m_pm.rescanPlugin();
try {
Thread.sleep(2000);
Hue = (ToggleButton) findViewById(R.id.tbtn_hue_power);
Hue.setOnClickListener(new ToggleButton.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Hue button click listener");
+ Log.i(LOG_TAG, "Hue button click listener");
OcRepresentation rep = new OcRepresentation();
ToggleButton t = (ToggleButton) v;
if (t.isChecked()) {
Toast.makeText(getApplicationContext(), "Hue ON",
Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Hue ON");
if (hueplug.m_bright == 0) {
- Log.e("Felix", "hueplug m_bright is 0");
+ Log.e(LOG_TAG, "hueplug m_bright is 0");
hueplug.m_bright = 128;
}
try {
rep.setValue("brightness", hueplug.m_bright);
rep.setValue("color", hueplug.m_color);
} catch (OcException e) {
- Log.e("Felix", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
OnPutHuebulb onPut = new OnPutHuebulb();
} else {
Toast.makeText(getApplicationContext(),
"HueResource null", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "HueResource null");
}
} else {
Toast.makeText(getApplicationContext(), "Hue OFF",
Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Hue OFF");
if (hueplug.m_bright == 0) {
- Log.e("Felix", "hueplug m_bright is 0");
+ Log.e(LOG_TAG, "hueplug m_bright is 0");
hueplug.m_bright = 128;
}
try {
rep.setValue("brightness", hueplug.m_bright);
rep.setValue("color", hueplug.m_color);
} catch (OcException e) {
- Log.e("Felix", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
OnPutHuebulb onPut = new OnPutHuebulb();
onPut);
} catch (OcException e) {
e.printStackTrace();
+ Log.e(LOG_TAG, e.getMessage());
}
} else {
Toast.makeText(getApplicationContext(),
"HueResource null", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "HueResource null");
}
}
}
huestart = (Button) findViewById(R.id.Button11);
huestart.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "start button click listener");
+ Log.i(LOG_TAG, "start button click listener");
m_pm.startPlugins("ResourceType", "device.light");
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
- Log.i("Felix", "run called!!!");
+ Log.i(LOG_TAG, "run called!!!");
FoundResource foundResource = new FoundResource();
try {
OcPlatform
huestop = (Button) findViewById(R.id.Button12);
huestop.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "stop button click listener");
+ Log.i(LOG_TAG, "stop button click listener");
m_pm.stopPlugins("ResourceType", "device.light");
hueResource = null;
try {
huegetPlugins = (Button) findViewById(R.id.Button13);
huegetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getPlugins button click listener");
+ Log.i(LOG_TAG, "getPlugins button click listener");
user_plugin = m_pm.getPlugins();
key = "name";
state = "";
huegetPlugins = (Button) findViewById(R.id.Button14);
huegetPlugins.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "getState click listener");
+ Log.i(LOG_TAG, "getState click listener");
state = m_pm.getState("hue");
if (state == "")
state = "null";
huerescan = (Button) findViewById(R.id.Button15);
huerescan.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
- Log.i("Felix", "Rescan Plugin click listener");
+ Log.i(LOG_TAG, "Rescan Plugin click listener");
m_pm.rescanPlugin();
try {
Thread.sleep(2000);
static public void updateConnectStatus(String device, boolean status) {
if (device.equals("belkinplug")) {
if (status) {
- Log.i("Felix", "belkingplug status green");
+ Log.i(LOG_TAG, "belkingplug status green");
Toast.makeText(mActivity.getApplicationContext(),
"Belkin Connected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Belkin Connected");
} else {
- Log.i("Felix", "belkingplug status gray");
+ Log.i(LOG_TAG, "belkingplug status gray");
Toast.makeText(mActivity.getApplicationContext(),
"Belkin Disonnected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Belkin Disonnected");
}
} else if (device.equals("gear")) {
if (status) {
- Log.i("Felix", "gear status green");
+ Log.i(LOG_TAG, "gear status green");
Toast.makeText(mActivity.getApplicationContext(),
"Gear Connected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Gear Connected");
} else {
- Log.i("Felix", "gear status gray");
+ Log.i(LOG_TAG, "gear status gray");
Toast.makeText(mActivity.getApplicationContext(),
"Gear Disconnected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Gear Disonnected");
}
} else if (device.equals("huebulb")) {
if (status) {
- Log.i("Felix", "huebulb status green");
+ Log.i(LOG_TAG, "huebulb status green");
Toast.makeText(mActivity.getApplicationContext(),
"Hue Connected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Hue Connected");
} else {
- Log.i("Felix", "huebulb status gray");
+ Log.i(LOG_TAG, "huebulb status gray");
Toast.makeText(mActivity.getApplicationContext(),
"Hue Disconnected", Toast.LENGTH_SHORT).show();
+ Log.i(LOG_TAG, "Hue Disconnected");
}
if (hueplug.m_power.equals("on")) {
@Override
protected void onResume() {
- Log.i("Felix", "onResume()");
+ Log.i(LOG_TAG, "onResume()");
super.onResume();
}
@Override
protected void onPause() {
- Log.i("Felix", "onPause()");
+ Log.i(LOG_TAG, "onPause()");
super.onPause();
finish();
}
@Override
protected void onStop() {
- Log.i("Felix", "onStop()");
+ Log.i(LOG_TAG, "onStop()");
super.onStop();
}
@Override
protected void onDestroy() {
- Log.i("Felix", "onDestroy()");
+ Log.i(LOG_TAG, "onDestroy()");
System.exit(1);
super.onDestroy();
}
try {
sleep(1000, 0);
} catch (Exception e) {
- Log.i("Felix", "waitForFinal exception : " + e);
+ Log.i(LOG_TAG, "waitForFinal exception : " + e);
}
- Log.i("Felix", "Final Value for NUMBERPICKER[" + idx + "] : "
+ Log.i(LOG_TAG, "Final Value for NUMBERPICKER[" + idx + "] : "
+ onValueChangefinalVal.get(idx));
if (idx == R.id.np_hue_color) {
hueplug.m_color = 6300 * onValueChangefinalVal.get(idx);
- Log.i("Felix", "m_color = " + hueplug.m_color);
+ Log.i(LOG_TAG, "m_color = " + hueplug.m_color);
OcRepresentation rep = new OcRepresentation();
if (hueplug.m_power == null) {
rep.setValue("brightness", hueplug.m_bright = 180);
rep.setValue("color", hueplug.m_color);
} catch (OcException e) {
- Log.e("Felix", e.getMessage());
+ Log.e(LOG_TAG, e.getMessage());
}
OnPutHuebulb onPut = new OnPutHuebulb();
if (hueResource != null) {
- Log.i("Felix", "huebulbResource is not null");
+ Log.i(LOG_TAG, "huebulbResource is not null");
try {
hueResource.put(rep, new HashMap<String, String>(),
onPut);
e.printStackTrace();
}
} else {
- Log.i("Felix", "huebulbResource is null");
+ Log.i(LOG_TAG, "huebulbResource is null");
}
}
onValueChangeThreadStart.put(idx, false);
import android.util.Log;
public class OnGetBelkinplug implements OcResource.OnGetListener {
- final private static String TAG = "OnGetBelkinplug";
+ final private static String TAG = "PPMSampleApp : OnGetBelkinplug";
@Override
public void onGetCompleted(List<OcHeaderOption> headerOptions,
import android.util.Log;
public class OnGetGear implements OcResource.OnGetListener {
- final private static String TAG = "OnGetGear";
+ final private static String TAG = "PPMSampleApp : OnGetGear";
@Override
public void onGetCompleted(List<OcHeaderOption> headerOptions,
import android.util.Log;
public class OnGetHuebulb implements OcResource.OnGetListener {
- final private static String TAG = "OnGetHuebulb";
+ final private static String TAG = "PPMSampleApp : OnGetHuebulb";
@Override
public void onGetCompleted(List<OcHeaderOption> headerOptions,
import android.util.Log;
public class OnPutBelkinplug implements OcResource.OnPutListener {
- final private static String TAG = "OnPutBelkinplug";
+ final private static String TAG = "PPMSampleApp : OnPutBelkinplug";
@Override
public void onPutCompleted(List<OcHeaderOption> options,
import android.util.Log;
public class OnPutGear implements OcResource.OnPutListener {
- final private static String TAG = "OnPutGear";
+ final private static String TAG = "PPMSampleApp : OnPutGear";
@Override
public void onPutCompleted(List<OcHeaderOption> options,
import android.util.Log;
public class OnPutHuebulb implements OcResource.OnPutListener {
- final private static String TAG = "OnPutHuebulb";
+ final private static String TAG = "PPMSampleApp : OnPutHuebulb";
@Override
public void onPutCompleted(List<OcHeaderOption> options,
System.loadLibrary("PluginManager");
}
+ private static final String LOG_TAG = "PPMSampleApp : PluginManager";
+
private native int jniStartPlugins(String key, String value);
private native int jniStopPlugins(String key, String value);
private native String jniGetState(String plugID);
private static void LogEx(String info) {
- Log.d("PluginManager.java", info);
+ Log.d(LOG_TAG, info);
}
}
sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
sprintf(buf, "onObserve Response error: = %d<br>", eCode);
strcpy(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::exit(-1);
sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
}
sprintf(buf, "onPost Response error: = %d<br>", eCode);
strcpy(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::exit(-1);
sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
}
sprintf(buf, "onPost Response error: = %d<br>", eCode);
strcpy(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::exit(-1);
sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
sprintf(buf, "onPut Response error: = %d<br>", eCode);
strcpy(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::exit(-1);
sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
sprintf(buf, "onGET Response error: = %d<br>", eCode);
strcpy(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::exit(-1);
putFanRepresentation(curFanResource);
}
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
}
std::cout << "Resource is invalid" << std::endl;
strcpy(temp_string, "Resource is invalid");
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
}
sprintf(buf, "value ID = %s<br>", user_plugin[i].getID().c_str());
strcat(temp_string, buf);
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
std::cout << "value Name = " << user_plugin[i].getName() << std::endl;
strcpy(temp_string, "start fan Plugin<br>");
strcat(temp_string, "fan Plugin is getting started. Please wait...<br>");
m_ThreadContext.log = temp_string;
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
&m_ThreadContext);
m_pm->startPlugins("ResourceType", "oic.fan");
private ArrayList<Integer> mRunningQueries = new ArrayList<Integer>();
private IQueryEngineEvent mQueryEngineEventListener = null;
- private final String LOG_TAG = this.getClass().getSimpleName();
+ private final String LOG_TAG = "SSMSampleApp : " + this.getClass().getSimpleName();
private static MainActivity activityObj;
void PrintLog(String log) {
data.putString("Log", log);
msg.setData(data);
logHandler.sendMessage(msg);
+ Log.i(LOG_TAG, log);
}
private Handler logHandler = new Handler() {
switch (v.getId()) {
case R.id.btClear:
edtQuery.setText("");
+ Log.i(LOG_TAG, "Query textbox is cleared");
break;
case R.id.btLogClear:
tvLog.setText("");
+ Log.i(LOG_TAG, "Log textbox is cleared");
break;
case R.id.btFullDevice:
edtQuery.setText("subscribe Device if Device.dataId != 0");
+ Log.i(LOG_TAG, "subscribe Device if Device.dataId != 0");
break;
case R.id.btDiscomfortIndex:
edtQuery.setText("subscribe Device.DiscomfortIndexSensor if Device.DiscomfortIndexSensor.discomfortIndex > 0");
+ Log.i(LOG_TAG, "subscribe Device.DiscomfortIndexSensor if Device.DiscomfortIndexSensor.discomfortIndex > 0");
break;
}
}
OIC::IModelData *pModelData = NULL;
std::vector<std::string> affectedModels;
- dlog_print(DLOG_ERROR, LOG_TAG, "Event received!");
+ dlog_print(DLOG_INFO, LOG_TAG, "Event received! cqid = %d", cqid);
sprintf(buf, "Event received! cqid = %d<br>", cqid);
strcpy(log, buf);
for (int i = 0; i < dataCount; i++)
{
pResult->getModelData(*itor, i, &pModelData);
+ dlog_print(DLOG_INFO, LOG_TAG, "dataId: %d<br>", pModelData->getDataId());
sprintf(buf, "dataId: %d<br>", pModelData->getDataId());
strcat(log, buf);
for (int j = 0; j < pModelData->getPropertyCount(); j++)
{
+ dlog_print(DLOG_INFO, LOG_TAG, "Type: %s Value: %s<br>",
+ (pModelData->getPropertyName(j)).c_str(),
+ (pModelData->getPropertyValue(j)).c_str());
sprintf(buf, "Type: %s Value: %s<br>",
(pModelData->getPropertyName(j)).c_str(),
(pModelData->getPropertyValue(j)).c_str());
if (res == OIC::SSM_S_OK)
{
updateLog(ad, "The query has been registered!<br>");
+ dlog_print(DLOG_INFO, LOG_TAG, "QID : %d\n", qid);
sprintf(log, "QID : %d<br>", qid);
updateLog(ad, log);
}
else
{
+ dlog_print(DLOG_INFO, LOG_TAG, "Error occured(%d)\n", res);
sprintf(log, "Error occured(%d)<br>", res);
updateLog(ad, log);
}
try
{
int val = atoi(query_id_str);
+ dlog_print(DLOG_INFO, LOG_TAG, "%d", val - 1);
sprintf(output, "%d", val - 1);
elm_entry_entry_set(ad->unregister_query_id, output);
}
try
{
int val = atoi(query_id_str);
+ dlog_print(DLOG_INFO, LOG_TAG, "%d", val + 1);
sprintf(output, "%d", val + 1);
elm_entry_entry_set(ad->unregister_query_id, output);
}
if (res == OIC::SSM_S_OK)
{
updateLog(ad, "The query has been unregistered!<br>");
+ dlog_print(DLOG_INFO, LOG_TAG, "QID : %d\n", qid);
sprintf(log, "QID : %d<br>", qid);
updateLog(ad, log);
}
else
{
+ dlog_print(DLOG_INFO, LOG_TAG, "Error occured(%d)\n", res);
sprintf(log, "Error occured(%d)<br>", res);
updateLog(ad, log);
}
*/
public class ActionListener implements IActionListener {
- private final String LOG_TAG = this.getClass()
- .getSimpleName();
+ private final String LOG_TAG = "[TMSample] " + this.getClass()
+ .getSimpleName();
private static Message msg;
private String logMessage;
private GroupApiActivity groupApiActivityObj = null;
case 0:
logs.setText("");
logs.setText(logMessage);
+ Log.i(LOG_TAG, logMessage);
}
}
};
.get(CONFIGURATION_COLLECTION_RESOURCE_URI);
if (null == configurationCollection
|| null == configurationCollection.resource) {
- Log.e(LOG_TAG, "configuration collection resource doest not exist!");
displayToastMessage("Configuration collection resource does not exist!");
}
if (false == configurationResourceFlag) {
- Log.e(LOG_TAG, "configuration resource doest not exist!");
displayToastMessage("Configuration resource does not exist!");
} else {
final Dialog dialog = new Dialog(mcontext);
.get(CONFIGURATION_COLLECTION_RESOURCE_URI);
if (null == configurationCollection
|| null == configurationCollection.resource) {
- Log.e(LOG_TAG, "configuration collection resource doest not exist!");
displayToastMessage("Configuration collection resource does not exist!");
return;
}
if (false == configurationResourceFlag) {
- Log.e(LOG_TAG, "configuration resource doest not exist!");
displayToastMessage("Configuration resource does not exist!");
return;
}
.get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
if (null == diagnosticsCollection
|| null == diagnosticsCollection.resource) {
- Log.e(LOG_TAG, "Diagnostic collection doest not exist!");
displayToastMessage("Diagnostic collection does not exist!");
return;
}
if (false == diagnosticsResourceFlag) {
- Log.e(LOG_TAG, "Diagnostic resource doest not exist!");
displayToastMessage("Diagnostic resource does not exist!");
return;
}
.get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
if (null == diagnosticsCollection
|| null == diagnosticsCollection.resource) {
- Log.e(LOG_TAG, "Diagnostic collection doest not exist!");
displayToastMessage("Diagnostic collection does not exist!");
return;
}
if (false == diagnosticsResourceFlag) {
- Log.e(LOG_TAG, "Diagnostic resource doest not exist!");
displayToastMessage("Diagnostic resource does not exist!");
return;
}
private void displayToastMessage(String message) {
Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
toast.show();
+ Log.i(LOG_TAG, message);
}
private void collectionFound(OcResource resource) {
*/
public class ConfigurationListener implements IConfigurationListener {
- private final String LOG_TAG = this.getClass().getSimpleName();
+ private final String LOG_TAG = "[TMSample] " + this.getClass().getSimpleName();
@Override
public void onBootStrapCallback(Vector<OcHeaderOption> headerOptions,
*/
public class DiagnosticListener implements IDiagnosticsListener {
- private final String LOG_TAG = this.getClass().getSimpleName();
+ private final String LOG_TAG = "[TMSample] " + this.getClass().getSimpleName();
@Override
public void onRebootCallback(Vector<OcHeaderOption> headerOptions,
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
// For Scheduled ActionSet
public static Context mcontext;
public static Calendar scheduleTime;
+
+ private final String LOG_TAG = "[TMSample] " + this.getClass()
+ .getSimpleName();;
@Override
protected void onCreate(Bundle savedInstanceState) {
case 1:
logs.setText("");
logs.setText(logMessage);
+ Log.i(LOG_TAG, logMessage);
}
}
};
public void displayToastMessage(String message) {
Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
toast.show();
+ Log.i(LOG_TAG, message);
}
}
*/
public class GroupClient {
- private static final String LOG_TAG = "GroupClient";
+ private static final String LOG_TAG = "[TMSample] GroupClient";
private static Message msg;
public String logMessage;
String uri = resource.getUri();
if (uri.equals("/b/collection") == true) {
String hostAddress = resource.getHost();
- Log.d("URI: onGroupFindCallback", uri);
- Log.d("HOST: onGroupFindCallback", hostAddress);
+ Log.d(LOG_TAG, "onGroupFindCallback URI : " + uri);
+ Log.d(LOG_TAG, "onGroupFindCallback HOST : " + hostAddress);
groupResource = resource;
Message msg = Message.obtain();
msg.what = 1;
groupApiActivityObj.getHandler().sendMessage(msg);
} else {
- Log.d("onGroupFindCallback URI : ", uri);
+ Log.d(LOG_TAG, "onGroupFindCallback URI : " + uri);
}
} else {
Log.i(LOG_TAG, "Resource is NULL");
private ArrayAdapter<String> apis;
private ArrayList<String> apisList;
private ListView list;
- private final String LOG_TAG = this.getClass()
- .getSimpleName();
+ private final String LOG_TAG = "[TMSample] " + this.getClass()
+ .getSimpleName();
public ThingsManager thingsManagerObj = new ThingsManager();
@Override
dialog = dialogBuilder.create();
dialog.show();
+ Log.i(LOG_TAG, "WiFi is not enabled/connected! Please connect the WiFi and start application again...");
return;
}
// If wifi is connected calling the configure method for configuring the
*/
public class MainActivity extends Activity {
- private final String LOG_TAG = this.getClass().getSimpleName();
+ private final String LOG_TAG = "[CON-SERVER]" + this.getClass().getSimpleName();
private Handler mHandler;
private static MainActivity mainActivityObj;
private ConfigurationServer conServerObj;
switch (msg.what) {
case 0:
editText.setText(message);
+ Log.i(LOG_TAG, message);
}
}
};
AlertDialog dialog = dialogBuilder.create();
dialog.show();
+ Log.i(LOG_TAG, "WiFi is not enabled/connected! Please connect the WiFi and start application again...");
return;
}
dialog.setProgress(0);
dialog.setMax(100);
dialog.show();
+ Log.i(LOG_TAG, "Rebooting.. Please wait ...");
Thread thread = new Thread() {
@Override
public void run() {
if (OC_STACK_OK == sendResponseForResource(request))
{
ehResult = OC_EH_OK;
+ dlog_print(DLOG_INFO, LOG_TAG, "#### sendResponse success.");
}
else
{
elm_entry_entry_append(log_entry, log->c_str());
elm_entry_cursor_end_set(log_entry);
+ dlog_print(DLOG_INFO, LOG_TAG, "%s", log->c_str());
dlog_print(DLOG_INFO, LOG_TAG, "#### updateLog exit!!!!");
return NULL;
logMessage += "currency : " + defaultCurrency + "<br>";
logMessage += "Region : " + defaultRegion + "<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+
//Call updateLog in the thread safe mode
ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
{
logMessage += "Resources were created already!!! <br>";
}
+
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
// Show the log in the UI
ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
}
logMessage = "----------------------------<br>";
logMessage += "*** System Reboot Success ***<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
//Show the log
ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
logMessage += "----------------------<br>";
dlog_print(DLOG_INFO, LOG_TAG, "FoundHost: %s", resourceURI.c_str());
dlog_print(DLOG_INFO, LOG_TAG, "FoundUri : %s", hostAddress.c_str());
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
&logMessage);
else
{
// Resource is invalid
+
logMessage = "Found Resource invalid!";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
&logMessage);
}
logMessage += "----------------------<br>";
dlog_print(DLOG_INFO, LOG_TAG, "Host: %s", resourceURI.c_str());
dlog_print(DLOG_INFO, LOG_TAG, "Uri : %s", hostAddress.c_str());
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
&logMessage);
logMessage = logMessage + "Region : " + rep.getValue< std::string >("r") + "<br>";
}
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
&logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### onUpdateConfigurationsCallback: EXIT!!!!");
}
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### onGetConfigurationsCallback: exit!!!!");
}
logMessage = logMessage + "FactoryReset : " +
rep.getValue< std::string >("value") + "<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### onFactoryReset: exit!!!!");
}
logMessage = logMessage + "Reboot : " +
rep.getValue< std::string >("value") + "<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### onReboot: exit!!!!");
}
string logMessage;
logMessage = "Resource created : <br>" + typeName + "<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### createResourceCollection: exit!!!!");
}
{
dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
string logMessage = "FIRST CREATE GROUP <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
return;
}
dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
string logMessage = "FIRST CREATE GROUP <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
return;
}
{
string logMessage = "UpdateConfigurations called successfully<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
}
dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
string logMessage = "FIRST CREATE GROUP <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
return;
}
{
string logMessage = "FactoryReset called successfully<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
}
dlog_print(DLOG_INFO, LOG_TAG, "Note that you first create a group to use this command");
string logMessage = "FIRST CREATE GROUP <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
return;
}
{
string logMessage = "Reboot called successfully<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
}
dlog_print(DLOG_INFO, LOG_TAG, "#### reboot EXIT!!!!");
string logMessage;
logMessage = "Supported Configuration List :<br>" + listOfSupportedConfigurationUnits + "<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### getListOfSupportedConfigurationUnits EXIT!!!!");
}
dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL RegionValue");
string logMessage = "Region Value should not be NULL<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
}
else
{
dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
string logMessage = "FIRST CREATE GROUP <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
return;
}
dlog_print(DLOG_INFO, LOG_TAG, "#### Invalid Parameter");
}
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
}
}
}
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### onPost callback received EXIT!!!!");
string logMessage = "NO LIGHTSERVER FOUND <br>";
logMessage += "----------------------<br>";
dlog_print(DLOG_INFO, LOG_TAG, "#### NO LIGHT SERVER FOUND");
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
delete actionSet;
string logMessage = "Create actionset AllBulbOFF success <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### createActionSet_AllBulbOff EXIT");
}
string logMessage = "Create actionset AllBulbON success <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### createActionSet_AllBulbOff OFF EXIT");
}
string logMessage = "Actionset OFF called successfully <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### executeActionSetOff EXIT");
}
string logMessage = "Actionset ON called successfully <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### executeActionSetOn EXIT");
}
string logMessage = "Actionset OFF DELETED <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### deleteActionSetOff EXIT");
}
string logMessage = "Actionset ON DELETED <br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
dlog_print(DLOG_INFO, LOG_TAG, "#### deleteActionSetOn EXIT");
}
logMessage = "onObserve error!!!";
}
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
}
(*rsrc)->observe(ObserveType::Observe, QueryParamsMap(), &onObserve);
dlog_print(DLOG_INFO, LOG_TAG, "#### after calling observe() for bookmark!!!!");
}
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
}
dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL DateTime Value");
string logMessage = "DateTime should not be NULL<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
}
else
dlog_print(DLOG_INFO, LOG_TAG, "#### Incorrect date/time values");
string logMessage = "Incorrect date/time value<br>";
logMessage += "----------------------<br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
}
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showGroupAPIs, NULL);
}
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
&logMessage);
}