return;
}
+ LOG_DBG(adapter_state);
obj->adapter_enabled_ = (adapter_state == BT_ADAPTER_ENABLED) ? true : false;
if (obj->js_reply_needed_) {
return;
}
+ LOG_DBG(name);
picojson::value::object o;
o["cmd"] = picojson::value("AdapterUpdated");
return;
}
+ LOG_DBG(visibility_mode);
picojson::value::object o;
const char* visible =
return;
}
+ LOG_DBG(discovery_state);
picojson::value::object o;
switch (discovery_state) {
return false;
}
+ LOG_DBG(device_info->remote_name);
picojson::value::object o;
char* alias = device_info->remote_name;
o["Alias"] = picojson::value(alias);
return;
}
+
+ LOG_DBG("");
picojson::value::object o;
o["cmd"] = picojson::value("");
o["reply_id"] = picojson::value(obj->callbacks_id_map_["CreateBonding"]);
LOG_ERR("remote_address is NULL!");
return;
}
+
+ LOG_DBG("");
picojson::value::object o;
o["cmd"] = picojson::value("");
o["reply_id"] = picojson::value(obj->callbacks_id_map_["DestroyBonding"]);
picojson::value::object o;
+ LOG_DBG(connection_state);
+
if (result) {
LOG_ERR("onSocketConnected() is failed");
o["error"] = picojson::value(static_cast<double>(1));
LOG_ERR("data is NULL");
return;
}
+
+ LOG_DBG("");
picojson::value::object o;
o["cmd"] = picojson::value("SocketHasData");
o["socket_fd"] = picojson::value(static_cast<double>(data->socket_fd));
CAPI_ERR(
bt_socket_create_rfcomm(msg.get("uuid").to_str().c_str(), &socket_fd),
error);
+ LOG_DBG(msg.get("uuid").to_str().c_str());
+ LOG_DBG(socket_fd);
if (error) {
o["error"] = picojson::value(static_cast<double>(1));
InternalPostMessage(picojson::value(o));
#include "common/extension.h"
#include "common/picojson.h"
+#define LOG_DBG(msg) std::cout << "[DBG] " << __FUNCTION__ << ":" << __LINE__ << " -- "<< msg << std::endl
#define LOG_ERR(msg) std::cerr << "[Error] " << msg << std::endl
// Macros interfacing with C code from Bluetooth API.
#define CAPI(fnc) \
do { \
+ LOG_DBG(#fnc); \
int _er = (fnc); \
if (_er != BT_ERROR_NONE) { \
LOG_ERR(#fnc " failed"); \
+ LOG_ERR(_er); \
} \
} while (0)
// same CAPI macro providing error code
#define CAPI_ERR(fnc, _er) \
do { \
+ LOG_DBG(#fnc); \
_er = (fnc); \
if (_er != BT_ERROR_NONE) { \
LOG_ERR(#fnc " failed"); \