Fixed output when more than two elements have to put
FossilOrigin-Name: 398fd7b33f79756c1a9d4c1dd13107830e6d15ecf42b61ff6f462781b9f4964a
This commit is contained in:
parent
32d365b06a
commit
efbcf88fb8
@ -19,6 +19,8 @@ int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * d
|
|||||||
vendor specific payload */
|
vendor specific payload */
|
||||||
int start = a->vendor_id ? 10 : 4;
|
int start = a->vendor_id ? 10 : 4;
|
||||||
|
|
||||||
|
uint8_t * d = dst+l;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct mbag_item * item = mbag_get(radio->data,a->item_id);
|
struct mbag_item * item = mbag_get(radio->data,a->item_id);
|
||||||
@ -26,13 +28,13 @@ int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * d
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int len=0;
|
int len=0;
|
||||||
len += cw_put_byte(dst+start,radio->iid);
|
len += cw_put_byte(d+start,radio->iid);
|
||||||
len += cw_put_mbag_item(dst + start+1, item);
|
len += cw_put_mbag_item(d + start+1, item);
|
||||||
|
|
||||||
if (a->vendor_id)
|
if (a->vendor_id)
|
||||||
l+= len + cw_put_elem_vendor_hdr(dst, a->vendor_id, a->elem_id, len);
|
l+= len + cw_put_elem_vendor_hdr(d, a->vendor_id, a->elem_id, len);
|
||||||
else
|
else
|
||||||
l += len + cw_put_elem_hdr(dst, a->elem_id, len);
|
l += len + cw_put_elem_hdr(d, a->elem_id, len);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user