123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef READMFG_SOURCE
- #define READMFG_SOURCE
- #include <memory.h>
- #include "../plc/plc.h"
- #include "../ether/channel.h"
- #include "../tools/memory.h"
- #include "../tools/flags.h"
- signed ReadMFG (struct plc * plc, uint8_t MMV, uint16_t MMTYPE)
- {
- struct channel * channel = (struct channel *)(plc->channel);
- struct message * message = (struct message *)(plc->message);
- struct homeplug * homeplug = (struct homeplug *)(message);
- while ((plc->packetsize = readpacket (channel, message, sizeof (* message))) > 0)
- {
- if (homeplug->homeplug.MMV != MMV)
- {
- continue;
- }
- if (homeplug->homeplug.MMTYPE != HTOLE16 (MMTYPE))
- {
- continue;
- }
- break;
- }
- return (plc->packetsize);
- }
- #endif
|