1
0
Fork 0

Send sync when transitioning to UNINIT and add logging

This commit is contained in:
Shawn Nock 2019-07-16 16:09:05 -04:00
parent f0b8ff2d24
commit b6ed265eb8
1 changed files with 3 additions and 1 deletions

View File

@ -728,6 +728,7 @@ void gpio_init() {
static linkstate_t do_uninit(struct net_buf const *buf) {
switch (packet_get_type(buf)) {
case H5_SYNC:
LOG_DBG("RX'd SYNC: UNINIT -> UNINIT");
h5_send_sync_response();
return UNINIT;
case H5_SYNC_RESPONSE:
@ -768,9 +769,10 @@ static linkstate_t do_active(struct net_buf *buf) {
switch (packet_get_type(buf)) {
case H5_SYNC:
LOG_DBG("SYNC in ACTIVE state: ACTIVE -> UNINIT");
h5_send_sync();
return UNINIT;
case H5_SYNC_RESPONSE:
LOG_DBG("Bad packet for ACTIVE state: ACTIVE -> UNINIT");
LOG_DBG("SYNC_RESPONSE in ACTIVE state: ACTIVE -> UNINIT");
h5_send_sync();
return UNINIT;
case H5_CONFIG: