mirror of
https://github.com/korneliuszo/lumiax-controller.git
synced 2026-07-05 01:12:01 +02:00
run bt things on ready callback
This commit is contained in:
@@ -381,14 +381,9 @@ BT_CONN_CB_DEFINE(conn_callbacks) = {
|
||||
.disconnected = disconnected,
|
||||
};
|
||||
|
||||
static struct bt_gatt_cb gatt_callbacks = {
|
||||
};
|
||||
|
||||
void barrot_init()
|
||||
{
|
||||
|
||||
bt_gatt_cb_register(&gatt_callbacks);
|
||||
|
||||
bt_le_scan_start(BT_LE_SCAN_ACTIVE, device_found);
|
||||
return;
|
||||
}
|
||||
|
||||
+6
-3
@@ -53,6 +53,11 @@ int d_print(int c)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bt_enabled(int err)
|
||||
{
|
||||
barrot_init();
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if(!tlay2.Init())
|
||||
@@ -66,13 +71,11 @@ int main(void)
|
||||
if(err)
|
||||
return err;
|
||||
|
||||
err = bt_enable(NULL);
|
||||
err = bt_enable(bt_enabled);
|
||||
if (err) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
barrot_init();
|
||||
|
||||
|
||||
k_mutex_init(®_data.mut);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user