12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef PIBSCALERS_SOURCE
- #define PIBSCALERS_SOURCE
- #include <unistd.h>
- #include <errno.h>
- #include "../plc/plc.h"
- #include "../pib/pib.h"
- #include "../tools/error.h"
- uint16_t pibscalers (struct _file_ * pib)
- {
-
- struct pib_header pib_header;
- if (read (pib->file, &pib_header, sizeof (pib_header)) != sizeof (pib_header))
- {
- error (1, errno, "%s", pib->name);
- }
- if ((pib_header.FWVERSION == 0x01) &&
- (pib_header.PIBVERSION == 0x00))
- {
- return (PLC_CARRIERS);
- }
- if (pib_header.FWVERSION < 0x05)
- {
- return (INT_CARRIERS);
- }
- return (AMP_CARRIERS);
- }
- #endif
|