Change-Id: I6dfdce96f30a6b6dce9f1627e5014e182e4d790d
Signed-off-by: Lohit Agarwalla <l.agarwalla@samsung.com>
char *mac = NULL;
- bt_initialize();
+ int ret = bt_initialize();
+ if (ret != BT_ERROR_NONE) {
+ _ERR("bt_initialize() failed.");
+ return std::string();
+ }
+
bt_adapter_state_e btState;
- bt_adapter_get_state(&btState);
+ ret = bt_adapter_get_state(&btState);
+ if (ret != BT_ERROR_NONE) {
+ _ERR("Failed to get bt_adapter state");
+ return std::string();
+ }
+
if (btState == BT_ADAPTER_ENABLED) {
bt_adapter_get_address(&mac);
if (mac != NULL) {