Skip to content

Commit

Permalink
fix protocol is_report arg error
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Feb 8, 2025
1 parent a5e3678 commit 8e88e48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/basic/include/maix_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,16 @@ namespace maix

/**
* @brief message is request or not, contrast with is_resp
* @maixpy maix.protocol.MSG.is_req
*/
bool is_req;

/**
* @brief message is request or not, contrast with is_resp
* @maixpy maix.protocol.MSG.is_report
*/
bool is_report;

/**
* Message body, read only, use set_body() to update
* @attention DO NOT manually change this value
Expand Down
2 changes: 2 additions & 0 deletions components/basic/src/maix_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ namespace maix::protocol
frame->version = data[i + 8] & FLAG_VERSION_MASK;
frame->is_resp = data[i + 8] & FLAG_IS_RESP_MASK;
frame->is_req = !frame->is_resp;
frame->is_report = data[i + 8] & FLAG_REPORT_MASK;
frame->resp_ok = data[i + 8] & FLAG_RESP_OK_MASK;
frame->cmd = data[i + 9];
frame->set_body(data + i + 10, data_len - 4);
Expand All @@ -181,6 +182,7 @@ namespace maix::protocol
version = VERSION;
is_resp = 0;
is_req = 1;
is_report = 0;
resp_ok = 0;
cmd = 0;
body = nullptr;
Expand Down

0 comments on commit 8e88e48

Please sign in to comment.