X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/3de68addc94548e2191d83b7aa4ebec21957391e..cf90d8bc6c8e339682d96ae43959e1dabc5fefb9:/practicas/pipi/src/test_recv.cpp diff --git a/practicas/pipi/src/test_recv.cpp b/practicas/pipi/src/test_recv.cpp index b77b5f8..2471b4a 100644 --- a/practicas/pipi/src/test_recv.cpp +++ b/practicas/pipi/src/test_recv.cpp @@ -1,6 +1,4 @@ -#include "ethernetframe.h" -#include "media.h" #include "dev.h" #include #include @@ -11,16 +9,14 @@ int main() { - Media media(0xabcdef); - Dev dev(1234, media); + Dev dev(4321); struct msqid_ds minfo; - for (msgctl(media.que_id, IPC_STAT, &minfo); minfo.msg_qnum; - msgctl(media.que_id, IPC_STAT, &minfo)) + for (msgctl(dev.que_id, IPC_STAT, &minfo); minfo.msg_qnum; + msgctl(dev.que_id, IPC_STAT, &minfo)) { std::cout << "Quedan " << minfo.msg_qnum << " mensajes en la cola\n"; - EthernetFrame<1500> f(1234); - dev.recv(f); - std::cout << f._mac << " " << f._len << " " << f._frame << "\n"; + std::string s = dev.receive(); + std::cout << "Recibido '" << s << "' (len " << s.size() << ")\n"; } return 0; }