Commit f0cc768e authored by Wenxi XU's avatar Wenxi XU
Browse files

添加传输完成callback

parent 907e2ba3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -199,6 +199,10 @@ static void parse_sync(struct AresProtocol *protocol, uint8_t *buf, size_t len)

	memcpy(pack->data, data, data_len);

	if (pack->cb != NULL) {
		pack->cb(SYNC_PACK_STATUS_DONE);
	}

	return;
}

+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ int ares_dual_protocol_init(struct AresProtocol *protocol);

#define SYNC_PACK_STATUS_READ  BIT(0)
#define SYNC_PACK_STATUS_WRITE BIT(1)
#define SYNC_PACK_STATUS_DONE  BIT(2)

#define GET_8BITS(buf, n_byte)  (*(uint8_t *)(buf + n_byte))
#define GET_16BITS(buf, n_byte) (*(uint16_t *)(buf + n_byte))