rename tf response helpers to com_*

This commit is contained in:
2017-12-23 21:05:28 +01:00
parent 4f92b97305
commit 92c28c5daf
7 changed files with 48 additions and 48 deletions
+2 -2
View File
@@ -173,14 +173,14 @@ static bool Npx_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command, Paylo
break;
default:
tf_respond_bad_cmd(frame_id);
com_respond_bad_cmd(frame_id);
return false;
}
return true;
bad_count:
tf_respond_err(frame_id, "BAD PIXEL COUNT");
com_respond_err(frame_id, "BAD PIXEL COUNT");
return false;
}
+4 -4
View File
@@ -194,23 +194,23 @@ static bool Pin_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command, Paylo
case CMD_READ:
if (!priv->output) {
tf_respond_u8(frame_id, (bool) LL_GPIO_IsInputPinSet(priv->port, priv->ll_pin));
com_respond_u8(frame_id, (bool) LL_GPIO_IsInputPinSet(priv->port, priv->ll_pin));
} else goto must_be_input;
break;
default:
tf_respond_bad_cmd(frame_id);
com_respond_bad_cmd(frame_id);
return false;
}
return true;
must_be_output:
tf_respond_err(frame_id, "NOT OUTPUT PIN");
com_respond_err(frame_id, "NOT OUTPUT PIN");
return false;
must_be_input:
tf_respond_err(frame_id, "NOT INPUT PIN");
com_respond_err(frame_id, "NOT INPUT PIN");
return false;
}
+3 -3
View File
@@ -117,13 +117,13 @@ static bool Tst_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command, Paylo
switch (command) {
case CMD_PING:
tf_respond_ok(frame_id);
com_respond_ok(frame_id);
break;
case CMD_ECHO:;
uint32_t len;
const uint8_t *data = pp_tail(pp, &len);
tf_respond_buf(MSG_SUCCESS, frame_id, data, len);
com_respond_buf(frame_id, MSG_SUCCESS, data, len);
break;
case CMD_BULKREAD:;
@@ -138,7 +138,7 @@ static bool Tst_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command, Paylo
break;
default:
tf_respond_bad_cmd(frame_id);
com_respond_bad_cmd(frame_id);
return false;
}