diff --git a/prj.conf b/prj.conf index 1147534..7b2ac6a 100644 --- a/prj.conf +++ b/prj.conf @@ -15,17 +15,23 @@ CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_DEVICE_NAME="Nordic Event Trigger Sample" +CONFIG_BT_DEVICE_NAME="Peripheral only evt trig sample" CONFIG_BT=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_MAX_CONN=2 -CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 -CONFIG_BT_BONDABLE=n - -CONFIG_BT_SCAN=y -CONFIG_BT_SCAN_FILTER_ENABLE=y -CONFIG_BT_SCAN_UUID_CNT=1 + +# Without this line, I get the error +# [00:00:17.473,297] bt_hci_core: opcode 0xfd13 status 0x01 +# Error for command SDC_HCI_OPCODE_CMD_VS_SET_CONN_EVENT_TRIGGER (-5). +# If I uncomment this line, everything works as expected in the peripheral role. +# CONFIG_BT_CENTRAL=y + +# CONFIG_BT_MAX_CONN=2 +# CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 +# CONFIG_BT_BONDABLE=n + +# CONFIG_BT_SCAN=y +# CONFIG_BT_SCAN_FILTER_ENABLE=y +# CONFIG_BT_SCAN_UUID_CNT=1 CONFIG_BT_CTLR_SDC_EVENT_TRIGGER=y diff --git a/src/main.c b/src/main.c index d4933da..e14e3b9 100644 --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,7 @@ #include #include #include -#include +// #include #include #include @@ -239,6 +239,7 @@ static void adv_start(void) printk("Advertising successfully started\n"); } +/* static void scan_filter_match(struct bt_scan_device_info *device_info, struct bt_scan_filter_match *filter_match, bool connectable) { @@ -299,7 +300,7 @@ static void scan_start(void) } printk("Scanning successfully started\n"); -} +} */ int main(void) { @@ -308,6 +309,7 @@ int main(void) k_work_init(&work, work_handler); console_init(); printk("Starting Connection Event Trigger Example.\n"); + printk("Code has been modified to only support the peripheral role.\n"); err = bt_enable(NULL); if (err) { @@ -316,17 +318,18 @@ int main(void) } while (true) { - printk("Choose device role - type c (central) or p (peripheral): "); + // printk("Choose device role - type c (central) or p (peripheral): "); + printk("Choose device role - p (peripheral):"); char input_char = console_getchar(); printk("\n"); - if (input_char == 'c') { + /* if (input_char == 'c') { printk("Central. Starting scanning\n"); scan_start(); break; - } else if (input_char == 'p') { + } else */ if (input_char == 'p') { printk("Peripheral. Starting advertising\n"); adv_start(); break;