-#include "ethernetframe.h"
-#include "media.h"
-#include "dev.h"
+#include "devque.h"
#include <iostream>
#include <unistd.h>
#include <fcntl.h>
int main()
{
- Media media(0xabcdef);
- Dev dev(1234, media);
+ DevQue 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;
}