Skip to content

Commit 8e88e48

Browse files
committed
fix protocol is_report arg error
1 parent a5e3678 commit 8e88e48

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

components/basic/include/maix_protocol.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,16 @@ namespace maix
113113

114114
/**
115115
* @brief message is request or not, contrast with is_resp
116+
* @maixpy maix.protocol.MSG.is_req
116117
*/
117118
bool is_req;
118119

120+
/**
121+
* @brief message is request or not, contrast with is_resp
122+
* @maixpy maix.protocol.MSG.is_report
123+
*/
124+
bool is_report;
125+
119126
/**
120127
* Message body, read only, use set_body() to update
121128
* @attention DO NOT manually change this value

components/basic/src/maix_protocol.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ namespace maix::protocol
156156
frame->version = data[i + 8] & FLAG_VERSION_MASK;
157157
frame->is_resp = data[i + 8] & FLAG_IS_RESP_MASK;
158158
frame->is_req = !frame->is_resp;
159+
frame->is_report = data[i + 8] & FLAG_REPORT_MASK;
159160
frame->resp_ok = data[i + 8] & FLAG_RESP_OK_MASK;
160161
frame->cmd = data[i + 9];
161162
frame->set_body(data + i + 10, data_len - 4);
@@ -181,6 +182,7 @@ namespace maix::protocol
181182
version = VERSION;
182183
is_resp = 0;
183184
is_req = 1;
185+
is_report = 0;
184186
resp_ok = 0;
185187
cmd = 0;
186188
body = nullptr;

0 commit comments

Comments
 (0)