@@ -590,17 +590,17 @@ PacketShared::STATUS PacketCommand::send(bool& sentPacket){
590
590
DEBUG_PORT.println (timestamp_micros);
591
591
#endif
592
592
if (_send_callback != NULL ){
593
- set_sendTimestamp (timestamp_micros); // markdown the time write now
594
- if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
595
- if ((_output_len + sizeof (uint32_t )) < PacketShared::DATA_BUFFER_SIZE){ // prevent buffer overrun
596
- pack_uint32 (timestamp_micros);
597
- }
598
- else {
599
- #ifdef PACKETCOMMAND_DEBUG
600
- DEBUG_PORT.println (F (" ### Error: appending send timestamp would overrun the output buffer" ));
601
- #endif
602
- }
603
- }
593
+ // set_sendTimestamp(timestamp_micros); //markdown the time write now
594
+ // if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
595
+ // if ((_output_len + sizeof(uint32_t)) < PacketShared::DATA_BUFFER_SIZE){ //prevent buffer overrun
596
+ // pack_uint32(timestamp_micros);
597
+ // }
598
+ // else{
599
+ // #ifdef PACKETCOMMAND_DEBUG
600
+ // DEBUG_PORT.println(F("### Error: appending send timestamp would overrun the output buffer"));
601
+ // #endif
602
+ // }
603
+ // }
604
604
// call the callback!
605
605
sentPacket = (*_send_callback)(*this );
606
606
return PacketShared::SUCCESS;
@@ -622,17 +622,17 @@ PacketShared::STATUS PacketCommand::send_nonblocking(){
622
622
DEBUG_PORT.println (timestamp_micros);
623
623
#endif
624
624
if (_send_nonblocking_callback != NULL ){
625
- set_sendTimestamp (timestamp_micros); // markdown the time write now
626
- if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
627
- if ((_output_len + sizeof (uint32_t )) < PacketShared::DATA_BUFFER_SIZE){ // prevent buffer overrun
628
- pack_uint32 (timestamp_micros);
629
- }
630
- else {
631
- #ifdef PACKETCOMMAND_DEBUG
632
- DEBUG_PORT.println (F (" ### Error: appending send timestamp would overrun the output buffer" ));
633
- #endif
634
- }
635
- }
625
+ // set_sendTimestamp(timestamp_micros); //markdown the time write now
626
+ // if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
627
+ // if ((_output_len + sizeof(uint32_t)) < PacketShared::DATA_BUFFER_SIZE){ //prevent buffer overrun
628
+ // pack_uint32(timestamp_micros);
629
+ // }
630
+ // else{
631
+ // #ifdef PACKETCOMMAND_DEBUG
632
+ // DEBUG_PORT.println(F("### Error: appending send timestamp would overrun the output buffer"));
633
+ // #endif
634
+ // }
635
+ // }
636
636
// call the nonblocking send callback
637
637
(*_send_nonblocking_callback)(*this );
638
638
return PacketShared::SUCCESS;
@@ -649,17 +649,17 @@ PacketShared::STATUS PacketCommand::send_nonblocking(){
649
649
PacketShared::STATUS PacketCommand::send_buffered (){
650
650
uint32_t timestamp_micros = micros ();
651
651
if (_send_buffered_callback != NULL ){
652
- set_sendTimestamp (timestamp_micros); // markdown the time write now
653
- if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
654
- if ((_output_len + sizeof (uint32_t )) < PacketShared::DATA_BUFFER_SIZE){ // prevent buffer overrun
655
- pack_uint32 (timestamp_micros);
656
- }
657
- else {
658
- #ifdef PACKETCOMMAND_DEBUG
659
- DEBUG_PORT.println (F (" ### Error: appending send timestamp would overrun the output buffer" ));
660
- #endif
661
- }
662
- }
652
+ // set_sendTimestamp(timestamp_micros); //markdown the time write now
653
+ // if (_output_flags & PacketShared::OPFLAG_APPEND_SEND_TIMESTAMP){
654
+ // if ((_output_len + sizeof(uint32_t)) < PacketShared::DATA_BUFFER_SIZE){ //prevent buffer overrun
655
+ // pack_uint32(timestamp_micros);
656
+ // }
657
+ // else{
658
+ // #ifdef PACKETCOMMAND_DEBUG
659
+ // DEBUG_PORT.println(F("### Error: appending send timestamp would overrun the output buffer"));
660
+ // #endif
661
+ // }
662
+ // }
663
663
// call the nonblocking send callback
664
664
(*_send_buffered_callback)(*this );
665
665
return PacketShared::SUCCESS;
@@ -780,7 +780,7 @@ void PacketCommand::resetInputBuffer(){
780
780
781
781
PacketShared::STATUS PacketCommand::enqueueInputBuffer (PacketQueue& pq){
782
782
#ifdef PACKETCOMMAND_DEBUG
783
- // DEBUG_PORT.println(F("# In PacketCommand::enqueueInputBuffer"));
783
+ DEBUG_PORT.println (F (" # In PacketCommand::enqueueInputBuffer" ));
784
784
#endif
785
785
// build a packet struct to hold current buffer state
786
786
PacketShared::Packet pkt;
@@ -894,7 +894,7 @@ PacketShared::STATUS PacketCommand::dequeueOutputBuffer(PacketQueue& pq){
894
894
_output_len = min (pkt.length , _outputBufferSize);
895
895
_output_index = _output_len; // IMPORTANT! set output index end of last entry so stuff could be added properly
896
896
_output_flags = pkt.flags ;
897
- memcpy (_output_buffer, pkt.data , _input_len );
897
+ memcpy (_output_buffer, pkt.data , _output_len );
898
898
return PacketShared::SUCCESS;
899
899
}
900
900
else {
0 commit comments