Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autogen/gatt_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ GATT_DATA(const uint8_t gattdb_uuidtable_128_map[]) =
};
GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t gattdb_attribute_field_2) = {
.properties = 0x0a,
.max_len = 13,
.data = { 0x45, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, },
.max_len = 16,
.data = { 0x4f, 0x44, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, },
};
GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_0) = {
.len = 2,
Expand Down
2 changes: 1 addition & 1 deletion config/btconf/gatt_configuration.btconf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<informativeText>Abstract: The generic_access service contains generic information about the device. All available Characteristics are readonly. </informativeText>
<characteristic id="device_name" name="Device Name" sourceId="org.bluetooth.characteristic.gap.device_name" uuid="2A00">
<informativeText/>
<value length="13" type="utf-8" variable_length="false">Empty Example</value>
<value length="16" type="utf-8" variable_length="true">OD000000</value>
<properties read="true" read_requirement="optional" write="true" write_requirement="optional"/>
</characteristic>
</service>
Expand Down
28 changes: 3 additions & 25 deletions opendisplay_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define MSD_PAYLOAD_LEN 16u
#define OD_NAME_PREFIX "OD"
#ifndef OD_APP_VERSION
#define OD_APP_VERSION 0x0019u
#define OD_APP_VERSION 0x0100u
#endif

#ifndef OPENDISPLAY_MAX_PIPE_LEN
Expand Down Expand Up @@ -74,7 +74,6 @@ static uint8_t reboot_flag = 1u;
static uint8_t connection_requested = 0u;

static uint16_t g_od_pipe_char;
static uint16_t g_od_appver_char;
static uint8_t g_connection;
static uint8_t s_adv_handle = 0xFFu;
static char s_dev_name[16];
Expand Down Expand Up @@ -1618,11 +1617,8 @@ static sl_status_t install_opendisplay_gatt(void)
uint16_t session;
uint16_t svc;
uint16_t ch_pipe;
uint16_t ch_ver;
sl_bt_uuid_16_t uuid_svc = { .data = { 0x46, 0x24 } };
sl_bt_uuid_16_t uuid_pipe = { .data = { 0x46, 0x24 } };
sl_bt_uuid_16_t uuid_ver = { .data = { 0x03, 0x00 } };
uint8_t ver_init[2] = { (uint8_t)(OD_APP_VERSION & 0xFFu), (uint8_t)((OD_APP_VERSION >> 8) & 0xFFu) };
uint8_t pipe_init = 0;
sl_status_t sc;

Expand Down Expand Up @@ -1661,22 +1657,6 @@ static sl_status_t install_opendisplay_gatt(void)
return sc;
}

sc = sl_bt_gattdb_add_uuid16_characteristic(session,
svc,
SL_BT_GATTDB_CHARACTERISTIC_READ,
0,
0,
uuid_ver,
sl_bt_gattdb_fixed_length_value,
2,
sizeof(ver_init),
ver_init,
&ch_ver);
if (sc != SL_STATUS_OK) {
(void)sl_bt_gattdb_abort(session);
return sc;
}

sc = sl_bt_gattdb_start_service(session, svc);
if (sc != SL_STATUS_OK) {
(void)sl_bt_gattdb_abort(session);
Expand All @@ -1689,8 +1669,6 @@ static sl_status_t install_opendisplay_gatt(void)
}

g_od_pipe_char = ch_pipe;
g_od_appver_char = ch_ver;
(void)g_od_appver_char;
return SL_STATUS_OK;
}

Expand Down Expand Up @@ -1792,8 +1770,7 @@ void opendisplay_ble_on_boot(uint8_t advertising_set_handle)
}
}
app_assert_status(sc);
printf("[OD] GATT 0x2446 ok, pipe_char=%u appver=%u\r\n",
(unsigned)g_od_pipe_char, (unsigned)g_od_appver_char);
printf("[OD] GATT 0x2446 ok, pipe_char=%u\r\n", (unsigned)g_od_pipe_char);
opendisplay_pipe_set_characteristic(g_od_pipe_char);

od_buttons_init_from_config();
Expand Down Expand Up @@ -1872,6 +1849,7 @@ void opendisplay_ble_schedule_deep_sleep(void)

void opendisplay_ble_process(void)
{
opendisplay_led_process();
uint32_t now_ms = sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count());
if (od_process_button_event(now_ms) && s_adv_handle != 0xFFu) {
build_and_apply_adv(s_adv_handle, s_dev_name);
Expand Down
2 changes: 1 addition & 1 deletion opendisplay_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static bool render_boot_screen(BBEPAPER &epd, const struct GlobalConfig *cfg)
(void)snprintf(name_line, sizeof(name_line), "OD%06lX", (unsigned long)last3);
{
uint16_t ver = opendisplay_ble_get_app_version();
(void)snprintf(fw_line, sizeof(fw_line), "FW: %u.%u",
(void)snprintf(fw_line, sizeof(fw_line), "FW:S %u.%u",
(unsigned)((ver >> 8) & 0xFFu), (unsigned)(ver & 0xFFu));
}
bytes_to_hex(key, sizeof(key), key_hex, sizeof(key_hex));
Expand Down
Loading
Loading