Skip to content

Commit

Permalink
clock config, manufacturer data in scan response, ble nfc conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoVrahe committed Dec 3, 2024
1 parent f07cebd commit 4a1d20f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_PERIOD=4000

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
Expand Down
10 changes: 5 additions & 5 deletions app/src/advertising.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ bool advertising_wl = false;
int bond_cnt = 0;
int bond_cnt_tmp = 0;

uint8_t pairing_data[2] = {0};
uint8_t manufacturer_data[8] = {0xff, 0xff, 0, 3, 'T', '3', 'W', '1' };

static const struct bt_data advertising_data[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
BT_DATA(BT_DATA_MANUFACTURER_DATA, pairing_data, 2),
};


static const struct bt_data scan_response_data[] = {
BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL),
BT_DATA(BT_DATA_MANUFACTURER_DATA, manufacturer_data, 8),
};

static void add_to_whitelist(const struct bt_bond_info *info, void *user_data){
Expand Down Expand Up @@ -74,13 +74,13 @@ void advertising_start(bool wl){

int err;

pairing_data[1] = 0x00; // todo color
manufacturer_data[3] = 0x03; // todo color

if (wl) {
advertising_setup_wl();
LOG_INF("Advertising with whitelist");

pairing_data[0] = 0x00;
manufacturer_data[2] = 0x00;

err = bt_le_adv_start(
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_SCANNABLE | BT_LE_ADV_OPT_FILTER_CONN | BT_LE_ADV_OPT_FILTER_SCAN_REQ,
Expand All @@ -91,7 +91,7 @@ void advertising_start(bool wl){
else {
LOG_INF("Advertising no whitelist");

pairing_data[0] = 0x01;
manufacturer_data[2] = 0x01;

err = bt_le_adv_start(
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_SCANNABLE,
Expand Down
1 change: 1 addition & 0 deletions boards/arm/t3w1_revA_nrf52832/t3w1_revA_nrf52832.dts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

&uicr {
gpio-as-nreset;
nfct-pins-as-gpios;
};

&gpiote {
Expand Down

0 comments on commit 4a1d20f

Please sign in to comment.