threadedRead now const uchar *

pipacketextractor Header mode now more flexible
fix splitTime mode
more refactoring
add virtual override to functions
remove piforeach
replace 0 to nullptr
iterate over pimap via iterators
replace CONNECTU to CONNECT# with compile time check
This commit is contained in:
Бычков Андрей
2022-07-26 17:18:08 +03:00
parent a4882dc054
commit d13e68c206
36 changed files with 615 additions and 623 deletions

View File

@@ -40,17 +40,17 @@ public:
if (test_) {
testt.setCRCEnabled(false);
testt.setName("TEST");
CONNECTU(&testt, sendRequest, this, ftsend);
CONNECT1(void, PIByteArray &, &testt, sendRequest, this, ftsend);
} else {
ft.setPacketSize(65000);
ft.setName("PIFT");
CONNECTU(&ft, sendRequest, this, ftsend);
CONNECT1(void, PIByteArray &, &ft, sendRequest, this, ftsend);
CONNECTU(&ft, sendFilesStarted, this, ftevent);
CONNECTU(&ft, receiveFilesStarted, this, ftevent);
CONNECTU(&ft, sendFilesFinished, this, ftevent);
CONNECTU(&ft, receiveFilesFinished, this, ftevent);
}
CONNECTU(&eth, threadedReadEvent, this, received);
CONNECT2(void, const uchar *, int, &eth, threadedReadEvent, this, received);
start(50);
eth.setParameter(PIEthernet::SeparateSockets);
eth.startThreadedRead();
@@ -136,7 +136,7 @@ private:
eth.send(data);
}
EVENT_HANDLER2(void, received, uchar * , readed, int, size) {
EVENT_HANDLER2(void, received, const uchar * , readed, int, size) {
PIByteArray ba(readed, size);
if(test_) {
testt.received(ba);