|
|
@ -19,7 +19,7 @@ |
|
|
|
* @param ... - replacements |
|
|
|
* @param ... - replacements |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void __attribute__((format(printf,3,4))) |
|
|
|
void __attribute__((format(printf,3,4))) |
|
|
|
tf_respond_snprintf(TF_TYPE type, TF_ID frame_id, const char *format, ...); |
|
|
|
com_respond_snprintf(TF_ID frame_id, TF_TYPE type, const char *format, ...); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Respond to a TF message with a buffer of fixed length and custom type. |
|
|
|
* Respond to a TF message with a buffer of fixed length and custom type. |
|
|
@ -30,7 +30,7 @@ tf_respond_snprintf(TF_TYPE type, TF_ID frame_id, const char *format, ...); |
|
|
|
* @param buf - byte buffer |
|
|
|
* @param buf - byte buffer |
|
|
|
* @param len - buffer size |
|
|
|
* @param len - buffer size |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_buf(TF_TYPE type, TF_ID frame_id, const uint8_t *buf, uint32_t len); |
|
|
|
void com_respond_buf(TF_ID frame_id, TF_TYPE type, const uint8_t *buf, uint32_t len); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Respond to a TF message with empty body and MSG_SUCCESS type. |
|
|
|
* Respond to a TF message with empty body and MSG_SUCCESS type. |
|
|
@ -38,7 +38,7 @@ void tf_respond_buf(TF_TYPE type, TF_ID frame_id, const uint8_t *buf, uint32_t l |
|
|
|
* |
|
|
|
* |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_ok(TF_ID frame_id); |
|
|
|
void com_respond_ok(TF_ID frame_id); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Same like tf_respond_buf(), but used for sending spontaneous reports. |
|
|
|
* Same like tf_respond_buf(), but used for sending spontaneous reports. |
|
|
@ -48,7 +48,7 @@ void tf_respond_ok(TF_ID frame_id); |
|
|
|
* @param buf - byte buffer |
|
|
|
* @param buf - byte buffer |
|
|
|
* @param len - buffer size |
|
|
|
* @param len - buffer size |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_send_buf(TF_TYPE type, const uint8_t *buf, uint32_t len); |
|
|
|
void com_send_buf(TF_TYPE type, const uint8_t *buf, uint32_t len); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Same like tf_respond_buf(), but the buffer length is measured with strlen. |
|
|
|
* Same like tf_respond_buf(), but the buffer length is measured with strlen. |
|
|
@ -59,7 +59,7 @@ void tf_send_buf(TF_TYPE type, const uint8_t *buf, uint32_t len); |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param str - character buffer, zero terminated |
|
|
|
* @param str - character buffer, zero terminated |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_str(TF_TYPE type, TF_ID frame_id, const char *str); |
|
|
|
void com_respond_str(TF_TYPE type, TF_ID frame_id, const char *str); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Schedule sending an ASCII string error response. |
|
|
|
* Schedule sending an ASCII string error response. |
|
|
@ -68,21 +68,21 @@ void tf_respond_str(TF_TYPE type, TF_ID frame_id, const char *str); |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param str - character buffer, zero terminated |
|
|
|
* @param str - character buffer, zero terminated |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_err(TF_ID frame_id, const char *str); |
|
|
|
void com_respond_err(TF_ID frame_id, const char *str); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Variant of sched_respond_err() for reporting bad received command code |
|
|
|
* Variant of sched_respond_err() for reporting bad received command code |
|
|
|
* |
|
|
|
* |
|
|
|
* @param msg_id - ID of the original msg |
|
|
|
* @param msg_id - ID of the original msg |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_bad_cmd(TF_ID frame_id); |
|
|
|
void com_respond_bad_cmd(TF_ID frame_id); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Variant of sched_respond_err() for reporting malformed commands (e.g. too short payload) |
|
|
|
* Variant of sched_respond_err() for reporting malformed commands (e.g. too short payload) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param msg_id - ID of the original msg |
|
|
|
* @param msg_id - ID of the original msg |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_malformed_cmd(TF_ID frame_id); |
|
|
|
void com_respond_malformed_cmd(TF_ID frame_id); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Schedule sending a one-byte response with MSG_SUCCESS type. |
|
|
|
* Schedule sending a one-byte response with MSG_SUCCESS type. |
|
|
@ -91,7 +91,7 @@ void tf_respond_malformed_cmd(TF_ID frame_id); |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param d - data |
|
|
|
* @param d - data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_u8(TF_ID frame_id, uint8_t d); |
|
|
|
void com_respond_u8(TF_ID frame_id, uint8_t d); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Schedule sending a two-byte response with MSG_SUCCESS type. |
|
|
|
* Schedule sending a two-byte response with MSG_SUCCESS type. |
|
|
@ -100,7 +100,7 @@ void tf_respond_u8(TF_ID frame_id, uint8_t d); |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param d - data |
|
|
|
* @param d - data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_u16(TF_ID frame_id, uint16_t d); |
|
|
|
void com_respond_u16(TF_ID frame_id, uint16_t d); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Schedule sending a 4-byte response with MSG_SUCCESS type. |
|
|
|
* Schedule sending a 4-byte response with MSG_SUCCESS type. |
|
|
@ -109,6 +109,6 @@ void tf_respond_u16(TF_ID frame_id, uint16_t d); |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param frame_id - ID of the original msg |
|
|
|
* @param d - data |
|
|
|
* @param d - data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void tf_respond_u32(TF_ID frame_id, uint32_t d); |
|
|
|
void com_respond_u32(TF_ID frame_id, uint32_t d); |
|
|
|
|
|
|
|
|
|
|
|
#endif //GEX_F072_MSG_RESPONSES_H
|
|
|
|
#endif //GEX_F072_MSG_RESPONSES_H
|
|
|
|