1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /*
- * 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: 1.000v
- double presentCurrent; // resolution: 1.000a
- double presentPower; // resolution: 1.000kw
- double totlizeImportEnergy; // resolution: 1.000kwh
- double totlizeExportEnergy; // resolution: 1.000kwh
- uint8_t LinkStatus; // 0 = unknow ,1 = link , 2 miss link
- }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_ */
|