12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*
- * meterComm.h
- *
- * Created on: 2021/6/4
- * Author: foluswen
- */
- #ifndef HEADER_METERCOMM_H_
- #define HEADER_METERCOMM_H_
- #include <sys/time.h>
- #include <sys/timeb.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <sys/shm.h>
- #include <sys/mman.h>
- #include <linux/wireless.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
- #include <unistd.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <termios.h>
- #include <errno.h>
- #include <errno.h>
- #include <string.h>
- #include <time.h>
- #include <ctype.h>
- #include <ifaddrs.h>
- #include <signal.h>
- typedef struct METER_INFO
- {
- double presetVoltage; // resolution: 1v
- double presentCurrent; // resolution: 1a
- double presentPower; // resolution: 1kw
- double totlizeImportEnergy; // resolution: 1kwh
- double totlizeExportEnergy; // resolution: 1kwh
- }Meter_Info;
- enum METER_MODEL
- {
- METER_MODEL_LEM_L18005A=0,
- };
- extern void meterInitialize(uint8_t model);
- extern void meterApiAssign(uint8_t meterIndex);
- extern int readVoltage(Meter_Info *meter_info);
- extern int readCurrent(Meter_Info *meter_info);
- extern int readPower(Meter_Info *meter_info);
- extern int readEnergy(Meter_Info *meter_info);
- extern unsigned char meterModel;
- extern char meterApiAddress[];
- #endif /* HEADER_METERCOMM_H_ */
|