Skip to content
Snippets Groups Projects
Commit b40d88f6 authored by schneider's avatar schneider
Browse files

feat(epicardium): Add v1.17 splash

parent dfcb2590
No related branches found
No related tags found
No related merge requests found
Pipeline #5174 passed
...@@ -62,7 +62,9 @@ static const appSlaveCfg_t bleSlaveCfg = ...@@ -62,7 +62,9 @@ static const appSlaveCfg_t bleSlaveCfg =
/*! configurable parameters for security */ /*! configurable parameters for security */
static const appSecCfg_t bleSecCfg = static const appSecCfg_t bleSecCfg =
{ {
.auth = DM_AUTH_MITM_FLAG | DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG, /*! Authentication and bonding flags */ //.auth = DM_AUTH_MITM_FLAG | DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG, /*! Authentication and bonding flags */
.auth = DM_AUTH_MITM_FLAG | DM_AUTH_BOND_FLAG, /*! Authentication and bonding flags */
//.auth = 0, /*! Authentication and bonding flags */
.iKeyDist = 0, /*! Initiator key distribution flags */ .iKeyDist = 0, /*! Initiator key distribution flags */
.rKeyDist = DM_KEY_DIST_LTK, /*! Responder key distribution flags */ .rKeyDist = DM_KEY_DIST_LTK, /*! Responder key distribution flags */
.oob=FALSE, /*! TRUE if Out-of-band pairing data is present */ .oob=FALSE, /*! TRUE if Out-of-band pairing data is present */
...@@ -86,11 +88,15 @@ static const appUpdateCfg_t bleUpdateCfg = ...@@ -86,11 +88,15 @@ static const appUpdateCfg_t bleUpdateCfg =
static const smpCfg_t bleSmpCfg = static const smpCfg_t bleSmpCfg =
{ {
.attemptTimeout = 3000, /*! 'Repeated attempts' timeout in msec */ .attemptTimeout = 3000, /*! 'Repeated attempts' timeout in msec */
.ioCap = SMP_IO_DISP_YES_NO, /*! I/O Capability */ //.ioCap = SMP_IO_DISP_YES_NO, /*! I/O Capability */
.ioCap = SMP_IO_DISP_ONLY, /*! I/O Capability */
//.ioCap = SMP_IO_NO_IN_NO_OUT, /*! I/O Capability */
.minKeyLen = 16, /*! Minimum encryption key length */ .minKeyLen = 16, /*! Minimum encryption key length */
.maxKeyLen = 16, /*! Maximum encryption key length */ .maxKeyLen = 16, /*! Maximum encryption key length */
.maxAttempts = 3, /*! Attempts to trigger 'repeated attempts' timeout */ .maxAttempts = 3, /*! Attempts to trigger 'repeated attempts' timeout */
.auth = DM_AUTH_MITM_FLAG | DM_AUTH_SC_FLAG, /*! Device authentication requirements */ //.auth = DM_AUTH_MITM_FLAG | DM_AUTH_SC_FLAG, /*! Device authentication requirements */
.auth = DM_AUTH_MITM_FLAG, /*! Device authentication requirements */
//.auth = 0, /*! Device authentication requirements */
.maxAttemptTimeout = 64000, /*! Maximum 'Repeated attempts' timeout in msec */ .maxAttemptTimeout = 64000, /*! Maximum 'Repeated attempts' timeout in msec */
.attemptDecTimeout = 64000, /*! Time msec before attemptExp decreases */ .attemptDecTimeout = 64000, /*! Time msec before attemptExp decreases */
.attemptExp = 2, /*! Exponent to raise attemptTimeout on maxAttempts */ .attemptExp = 2, /*! Exponent to raise attemptTimeout on maxAttempts */
...@@ -99,7 +105,8 @@ static const smpCfg_t bleSmpCfg = ...@@ -99,7 +105,8 @@ static const smpCfg_t bleSmpCfg =
/*! Configurable parameters for service and characteristic discovery */ /*! Configurable parameters for service and characteristic discovery */
static const appDiscCfg_t bleDiscCfg = static const appDiscCfg_t bleDiscCfg =
{ {
FALSE /*! TRUE to wait for a secure connection before initiating discovery */ //FALSE /*! TRUE to wait for a secure connection before initiating discovery */
TRUE /*! TRUE to wait for a secure connection before initiating discovery */
}; };
/* Configuration structure */ /* Configuration structure */
......
...@@ -23,8 +23,26 @@ static void *dyn_groups[ATTS_DYN_GROUP_COUNT] = {}; ...@@ -23,8 +23,26 @@ static void *dyn_groups[ATTS_DYN_GROUP_COUNT] = {};
static int next_dyn_group = 0; static int next_dyn_group = 0;
static int next_handle = ATTS_DYN_START_HANDLE; static int next_handle = ATTS_DYN_START_HANDLE;
static void hexdump(uint8_t *data, uint8_t len)
{
for (int i = 0; i < len; i++) {
printf("%02x ", data[i]);
}
printf("\n");
}
void ble_epic_att_api_event(attEvt_t *att_event) void ble_epic_att_api_event(attEvt_t *att_event)
{ {
printf("att event handle %d %d\n",
att_event->handle,
att_event->continuing);
printf("att event handle %p %d %p %d\n",
att_event,
sizeof(*att_event),
att_event->pValue,
att_event->valueLen);
hexdump(att_event->pValue, att_event->valueLen);
if (att_event->hdr.event != ATTS_HANDLE_VALUE_CNF || if (att_event->hdr.event != ATTS_HANDLE_VALUE_CNF ||
(att_event->handle >= ATTS_DYN_START_HANDLE && (att_event->handle >= ATTS_DYN_START_HANDLE &&
att_event->handle < next_handle)) { att_event->handle < next_handle)) {
......
...@@ -51,7 +51,7 @@ int main(void) ...@@ -51,7 +51,7 @@ int main(void)
&display_screen, 0, 0, 160, 80, GFX_RGB565, version_splash &display_screen, 0, 0, 160, 80, GFX_RGB565, version_splash
); );
if (strcmp(CARD10_VERSION, "v1.16") != 0) { if (strcmp(CARD10_VERSION, "v1.17") != 0) {
const int off = (160 - (int)strlen(version_buf) * 14) / 2; const int off = (160 - (int)strlen(version_buf) * 14) / 2;
epic_disp_print(10, 20, "Epicardium", 0xfe20, 0xfe20); epic_disp_print(10, 20, "Epicardium", 0xfe20, 0xfe20);
epic_disp_print( epic_disp_print(
......
epicardium/version-splash.png

2.31 KiB | W: | H:

epicardium/version-splash.png

15 KiB | W: | H:

epicardium/version-splash.png
epicardium/version-splash.png
epicardium/version-splash.png
epicardium/version-splash.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -167,7 +167,7 @@ void AppUiAction(uint8_t event) ...@@ -167,7 +167,7 @@ void AppUiAction(uint8_t event)
/*************************************************************************************************/ /*************************************************************************************************/
void AppUiDisplayPasskey(uint32_t passkey) void AppUiDisplayPasskey(uint32_t passkey)
{ {
APP_TRACE_INFO1(">>> Passkey: %d <<<", passkey); printf(">>> Passkey: %d <<<", passkey);
} }
/*************************************************************************************************/ /*************************************************************************************************/
......
...@@ -88,8 +88,31 @@ static void clear_events(void) ...@@ -88,8 +88,31 @@ static void clear_events(void)
} while (ret >= 0); } while (ret >= 0);
} }
#if 0
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
STATIC mp_obj_bluetooth_uuid_t create_mp_uuid(uint16_t uuid16, const uint8_t *uuid128) {
mp_obj_bluetooth_uuid_t result;
if (uuid16 != 0) {
result.data[0] = uuid16 & 0xff;
result.data[1] = (uuid16 >> 8) & 0xff;
result.type = MP_BLUETOOTH_UUID_TYPE_16;
} else {
reverse_128(uuid128, result.data);
result.type = MP_BLUETOOTH_UUID_TYPE_128;
}
return result;
}
#endif
#endif
static void handle_att_event(struct epic_att_event *att_event) static void handle_att_event(struct epic_att_event *att_event)
{ {
printf("MP got att event %d,%d,%d,%d\n",
att_event->hdr.event,
att_event->hdr.status,
att_event->handle,
att_event->continuing);
if (att_event->hdr.event == ATTS_HANDLE_VALUE_CNF) { if (att_event->hdr.event == ATTS_HANDLE_VALUE_CNF) {
gatts_status_entry_t *e = gatts_status_entry_t *e =
gatts_status_lookup(GATTS_STATUS, att_event->handle); gatts_status_lookup(GATTS_STATUS, att_event->handle);
...@@ -353,6 +376,8 @@ static void handle_att_event(struct epic_att_event *att_event) ...@@ -353,6 +376,8 @@ static void handle_att_event(struct epic_att_event *att_event)
static void handle_dm_event(struct epic_dm_event *dm_event) static void handle_dm_event(struct epic_dm_event *dm_event)
{ {
struct epic_wsf_header *hdr = (struct epic_wsf_header *)dm_event; struct epic_wsf_header *hdr = (struct epic_wsf_header *)dm_event;
printf("MP got DM event %d,%d\n", hdr->event, hdr->status);
if (hdr->event == DM_CONN_OPEN_IND) { if (hdr->event == DM_CONN_OPEN_IND) {
struct epic_hciLeConnCmpl_event *e = struct epic_hciLeConnCmpl_event *e =
(struct epic_hciLeConnCmpl_event *)dm_event; (struct epic_hciLeConnCmpl_event *)dm_event;
...@@ -885,6 +910,7 @@ int mp_bluetooth_gattc_write( ...@@ -885,6 +910,7 @@ int mp_bluetooth_gattc_write(
mode != MP_BLUETOOTH_WRITE_MODE_NO_RESPONSE) { mode != MP_BLUETOOTH_WRITE_MODE_NO_RESPONSE) {
return MP_EINVAL; return MP_EINVAL;
} }
// create operation
pending_gattc_operation_obj_t *op = m_new_obj_var( pending_gattc_operation_obj_t *op = m_new_obj_var(
pending_gattc_operation_obj_t, uint8_t, *value_len pending_gattc_operation_obj_t, uint8_t, *value_len
); );
...@@ -894,12 +920,14 @@ int mp_bluetooth_gattc_write( ...@@ -894,12 +920,14 @@ int mp_bluetooth_gattc_write(
op->mode = mode; op->mode = mode;
op->value_len = *value_len; op->value_len = *value_len;
memcpy(op->value, value, *value_len); memcpy(op->value, value, *value_len);
// add operation to list
mp_obj_list_append(ATTC_PENDING, MP_OBJ_FROM_PTR(op)); mp_obj_list_append(ATTC_PENDING, MP_OBJ_FROM_PTR(op));
size_t len; size_t len;
mp_obj_t *items; mp_obj_t *items;
mp_obj_list_get(ATTC_PENDING, &len, &items); mp_obj_list_get(ATTC_PENDING, &len, &items);
// is list size == 1: execute write
if (len == 1) { if (len == 1) {
if (mode == MP_BLUETOOTH_WRITE_MODE_NO_RESPONSE) { if (mode == MP_BLUETOOTH_WRITE_MODE_NO_RESPONSE) {
err = epic_ble_attc_write_no_rsp( err = epic_ble_attc_write_no_rsp(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment