
#include "ble.h"


#define LOG_MODULE_NAME remote
LOG_MODULE_REGISTER(LOGM_MODULE_NAME);

static K_SEM_DEFINE(bt_init_ok, 1, 1);

/*Callbacks*/
void bt_ready(int err);
{
    if (err){
        LOG_ERR("bt_enable returned %d", err);  
    }
    
    k_sem_give(&bt_init_ok);
}

int bluetooth_init(void)
{
    int err;
    LOG_INF("inizializing bluetooth");

    err = bt_enable(bt_ready);
    if (err){
        LOG_ERR("bt_enable returned %d", err);  
    }

    k_sem_take(&bt_init_ok, K_FOREVER);

    return err;
}