disable bluetooth cuz thats borked
This commit is contained in:
6
Pipfile.lock
generated
6
Pipfile.lock
generated
@ -50,7 +50,7 @@
|
||||
"sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3",
|
||||
"sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'",
|
||||
"version": "==2.9.0.post0"
|
||||
},
|
||||
"pyyaml": {
|
||||
@ -169,7 +169,7 @@
|
||||
"sha256:fc4b630cd3fa2cf7fce38afa91d7cfe844a9f75d7f0f36393fa98815e911d987",
|
||||
"sha256:fd5415dded15c3822597455bc02bcd66e81ef8b7a48cb71a33628fc9fdde39df"
|
||||
],
|
||||
"markers": "python_version < '3.14' and platform_python_implementation == 'CPython'",
|
||||
"markers": "platform_python_implementation == 'CPython' and python_version < '3.14'",
|
||||
"version": "==0.2.12"
|
||||
},
|
||||
"six": {
|
||||
@ -177,7 +177,7 @@
|
||||
"sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274",
|
||||
"sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'",
|
||||
"version": "==1.17.0"
|
||||
},
|
||||
"west": {
|
||||
|
@ -18,11 +18,11 @@ CONFIG_CFB_LOG_LEVEL_DBG=y
|
||||
CONFIG_CHARACTER_FRAMEBUFFER=y
|
||||
CONFIG_CBPRINTF_FP_SUPPORT=y
|
||||
|
||||
CONFIG_BT=y
|
||||
CONFIG_BT_SMP=y
|
||||
CONFIG_BT_PERIPHERAL=y
|
||||
CONFIG_BT_GATT_CLIENT=y
|
||||
CONFIG_BT_DEVICE_NAME="Mellifera"
|
||||
# CONFIG_BT=y
|
||||
# CONFIG_BT_SMP=y
|
||||
# CONFIG_BT_PERIPHERAL=y
|
||||
# CONFIG_BT_GATT_CLIENT=y
|
||||
# CONFIG_BT_DEVICE_NAME="Mellifera"
|
||||
|
||||
CONFIG_BOOTLOADER_MCUBOOT=y
|
||||
CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y
|
||||
# CONFIG_BOOTLOADER_MCUBOOT=y
|
||||
# CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y
|
@ -1,8 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
@ -12,74 +7,74 @@
|
||||
|
||||
#include <app_version.h>
|
||||
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/hci.h>
|
||||
// #include <zephyr/bluetooth/bluetooth.h>
|
||||
// #include <zephyr/bluetooth/hci.h>
|
||||
|
||||
LOG_MODULE_REGISTER(main, CONFIG_APP_LOG_LEVEL);
|
||||
|
||||
#define BLINK_PERIOD_MS_STEP 100U
|
||||
#define BLINK_PERIOD_MS_MAX 1000U
|
||||
|
||||
#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
|
||||
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
|
||||
// #define DEVICE_NAME CONFIG_BT_DEVICE_NAME
|
||||
// #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
|
||||
|
||||
/*
|
||||
* Set Advertisement data. Based on the Eddystone specification:
|
||||
* https://github.com/google/eddystone/blob/master/protocol-specification.md
|
||||
* https://github.com/google/eddystone/tree/master/eddystone-url
|
||||
*/
|
||||
static const struct bt_data ad[] = {
|
||||
BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
|
||||
BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0xaa, 0xfe),
|
||||
BT_DATA_BYTES(BT_DATA_SVC_DATA16,
|
||||
0xaa, 0xfe, /* Eddystone UUID */
|
||||
0x10, /* Eddystone-URL frame type */
|
||||
0x00, /* Calibrated Tx power at 0m */
|
||||
0x00, /* URL Scheme Prefix http://www. */
|
||||
'z', 'e', 'p', 'h', 'y', 'r',
|
||||
'p', 'r', 'o', 'j', 'e', 'c', 't',
|
||||
0x08) /* .org */
|
||||
};
|
||||
// /*
|
||||
// * Set Advertisement data. Based on the Eddystone specification:
|
||||
// * https://github.com/google/eddystone/blob/master/protocol-specification.md
|
||||
// * https://github.com/google/eddystone/tree/master/eddystone-url
|
||||
// */
|
||||
// static const struct bt_data ad[] = {
|
||||
// BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
|
||||
// BT_DATA_BYTES(BT_DATA_UUID16_ALL, 0xaa, 0xfe),
|
||||
// BT_DATA_BYTES(BT_DATA_SVC_DATA16,
|
||||
// 0xaa, 0xfe, /* Eddystone UUID */
|
||||
// 0x10, /* Eddystone-URL frame type */
|
||||
// 0x00, /* Calibrated Tx power at 0m */
|
||||
// 0x00, /* URL Scheme Prefix http://www. */
|
||||
// 'z', 'e', 'p', 'h', 'y', 'r',
|
||||
// 'p', 'r', 'o', 'j', 'e', 'c', 't',
|
||||
// 0x08) /* .org */
|
||||
// };
|
||||
|
||||
/* Set Scan Response data */
|
||||
static const struct bt_data sd[] = {
|
||||
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
|
||||
};
|
||||
// /* Set Scan Response data */
|
||||
// static const struct bt_data sd[] = {
|
||||
// BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
|
||||
// };
|
||||
|
||||
static void bt_ready(int err)
|
||||
{
|
||||
char addr_s[BT_ADDR_LE_STR_LEN];
|
||||
bt_addr_le_t addr = {0};
|
||||
size_t count = 1;
|
||||
// static void bt_ready(int err)
|
||||
// {
|
||||
// char addr_s[BT_ADDR_LE_STR_LEN];
|
||||
// bt_addr_le_t addr = {0};
|
||||
// size_t count = 1;
|
||||
|
||||
if (err)
|
||||
{
|
||||
LOG_ERR("Bluetooth init failed (err %d)", err);
|
||||
return;
|
||||
}
|
||||
// if (err)
|
||||
// {
|
||||
// LOG_ERR("Bluetooth init failed (err %d)", err);
|
||||
// return;
|
||||
// }
|
||||
|
||||
LOG_INF("Bluetooth initialized");
|
||||
// LOG_INF("Bluetooth initialized");
|
||||
|
||||
// Start advertising
|
||||
err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),
|
||||
sd, ARRAY_SIZE(sd));
|
||||
if (err)
|
||||
{
|
||||
LOG_ERR("Advertising failed to start (err %d)", err);
|
||||
return;
|
||||
}
|
||||
// // Start advertising
|
||||
// err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),
|
||||
// sd, ARRAY_SIZE(sd));
|
||||
// if (err)
|
||||
// {
|
||||
// LOG_ERR("Advertising failed to start (err %d)", err);
|
||||
// return;
|
||||
// }
|
||||
|
||||
/* For connectable advertising you would use
|
||||
* bt_le_oob_get_local(). For non-connectable non-identity
|
||||
* advertising an non-resolvable private address is used;
|
||||
* there is no API to retrieve that.
|
||||
*/
|
||||
// /* For connectable advertising you would use
|
||||
// * bt_le_oob_get_local(). For non-connectable non-identity
|
||||
// * advertising an non-resolvable private address is used;
|
||||
// * there is no API to retrieve that.
|
||||
// */
|
||||
|
||||
bt_id_get(&addr, &count);
|
||||
bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
|
||||
// bt_id_get(&addr, &count);
|
||||
// bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
|
||||
|
||||
LOG_INF("Beacon started, advertising as %s", addr_s);
|
||||
}
|
||||
// LOG_INF("Beacon started, advertising as %s", addr_s);
|
||||
// }
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@ -112,12 +107,12 @@ int main(void)
|
||||
LOG_INF("Starting Mellifera version %s...", APP_VERSION_STRING);
|
||||
// LOG_INF("Board: %s", BOARD);
|
||||
|
||||
// Initialize the Bluetooth Subsystem
|
||||
err = bt_enable(bt_ready);
|
||||
if (err)
|
||||
{
|
||||
LOG_ERR("Bluetooth init failed (err %d)", err);
|
||||
}
|
||||
// // Initialize the Bluetooth Subsystem
|
||||
// err = bt_enable(bt_ready);
|
||||
// if (err)
|
||||
// {
|
||||
// LOG_ERR("Bluetooth init failed (err %d)", err);
|
||||
// }
|
||||
|
||||
display = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
|
||||
if (!device_is_ready(display))
|
||||
@ -148,7 +143,7 @@ int main(void)
|
||||
display_blanking_off(display);
|
||||
|
||||
x_res = cfb_get_display_parameter(display, CFB_DISPLAY_WIDTH);
|
||||
y_res = cfb_get_display_parameter(display, CFB_DISPLAY_HEIGH);
|
||||
y_res = cfb_get_display_parameter(display, CFB_DISPLAY_HEIGHT);
|
||||
rows = cfb_get_display_parameter(display, CFB_DISPLAY_ROWS);
|
||||
ppt = cfb_get_display_parameter(display, CFB_DISPLAY_PPT);
|
||||
|
||||
|
@ -25,6 +25,8 @@ int main(void)
|
||||
int ret;
|
||||
bool led_state = true;
|
||||
|
||||
printf("Starting blinky...\n");
|
||||
|
||||
if (!gpio_is_ready_dt(&led))
|
||||
{
|
||||
return 0;
|
||||
|
@ -9,9 +9,9 @@ config BOARD_ENABLE_DCDC
|
||||
default y
|
||||
depends on BOARD_MELLIFERA_REV1
|
||||
|
||||
# BT_CTLR depends on BT. When BT is enabled we should default to also
|
||||
# enabling the controller.
|
||||
config BT_CTLR
|
||||
default y if BT
|
||||
# # BT_CTLR depends on BT. When BT is enabled we should default to also
|
||||
# # enabling the controller.
|
||||
# config BT_CTLR
|
||||
# default y if BT
|
||||
|
||||
endif # BOARD_MELLIFERA_REV1
|
Reference in New Issue
Block a user