diff --git a/dap_stream_ch_pkt.c b/dap_stream_ch_pkt.c index 16bb083727bb7c63ff60d3dea250d28fb0daf08b..76b1196c130d6b4e0734d723d48aa849d0cbda1e 100644 --- a/dap_stream_ch_pkt.c +++ b/dap_stream_ch_pkt.c @@ -57,7 +57,7 @@ void stream_ch_pkt_deinit() * @param data_size * @return */ -size_t stream_ch_pkt_write_seq_id(struct dap_stream_ch * ch, uint8_t type, uint64_t seq_id, const void * data, uint32_t data_size) +size_t stream_ch_pkt_write(struct dap_stream_ch * ch, uint8_t type, const void * data, uint32_t data_size) { pthread_mutex_lock( &ch->mutex); @@ -70,7 +70,8 @@ size_t stream_ch_pkt_write_seq_id(struct dap_stream_ch * ch, uint8_t type, uint6 hdr.size=data_size; hdr.type=type; hdr.enc_type = ch->proc->enc_type; - hdr.seq_id=seq_id; + hdr.seq_id=ch->stream->seq_id; + ch->stream->seq_id++; if(data_size+sizeof(hdr)> sizeof(ch->buf) ){ log_it(L_ERROR,"Too big data size %lu, bigger than encryption buffer size %lu",data_size,sizeof(ch->buf)); @@ -86,18 +87,6 @@ size_t stream_ch_pkt_write_seq_id(struct dap_stream_ch * ch, uint8_t type, uint6 } -/** - * @brief stream_ch_pkt_write - * @param sid - * @param data - * @param data_size - * @return - */ -size_t stream_ch_pkt_write(struct dap_stream_ch * ch, uint8_t type, const void * data, uint32_t data_size) -{ - return stream_ch_pkt_write_seq_id(ch,type,0,data,data_size); -} - /** * @brief stream_ch_pkt_write_str * @param sid diff --git a/dap_stream_ch_pkt.h b/dap_stream_ch_pkt.h index 95bdb24dd8597d1a8ad88fb2dc82f88196908b21..db92bc077eb4d657ea589fa33d44c78d55a8b3ff 100644 --- a/dap_stream_ch_pkt.h +++ b/dap_stream_ch_pkt.h @@ -46,6 +46,5 @@ void stream_ch_pkt_deinit(); size_t stream_ch_pkt_write_f(struct dap_stream_ch * ch, uint8_t type, const char * str,...); size_t stream_ch_pkt_write(struct dap_stream_ch * ch, uint8_t type, const void * data, uint32_t data_size); -size_t stream_ch_pkt_write_seq_id(struct dap_stream_ch * ch, uint8_t type, uint64_t seq_id, const void * data, uint32_t data_size); size_t stream_ch_send_keepalive(struct dap_stream_ch * ch);