1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #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 homeplug1 * homeplug = (struct homeplug1 *) (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
|