ycapi.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef YCAPI_H
  2. #define YCAPI_H
  3. //#include "ycapi_global.h"
  4. //#include <QtCore/qglobal.h>
  5. #include <linux/input.h>
  6. #if defined(YCAPI_LIBRARY)
  7. # define YCAPISHARED_EXPORT Q_DECL_EXPORT
  8. #else
  9. # define YCAPISHARED_EXPORT Q_DECL_IMPORT
  10. #endif
  11. #define IO_POLLING_MODE 0
  12. #define IO_INTR_MODE 1
  13. #define IO_INTR_LOW_LEVEL_TRIGGERED 0
  14. #define IO_INTR_HIGH_LEVEL_TRIGGERED 1
  15. #define IO_INTR_FALLING_EDGE_TRIGGERED 2
  16. #define IO_INTR_RISING_EDGE_TRIGGERED 3
  17. #define IO_INTR_BOTH_EDGE_TRIGGERED 4
  18. //YCAPISHARED_EXPORT
  19. class Ycapi {
  20. public:
  21. Ycapi();
  22. bool BeepOn(bool bStatus);
  23. bool SetLed(bool bStatus);
  24. bool SetWDog(int interval);
  25. bool StartWDog();
  26. bool FeedWDog();
  27. bool StopWDog();
  28. bool WriteEEPROM(int addr,char *buf);
  29. bool ReadEEPROM(int addr,char *buf);
  30. bool ReadEEPROMLen(int addr,char *buf,int len);
  31. bool WriteEEPROMLen(int addr,char *buf,int len);
  32. bool SetIO( unsigned char level , unsigned char ioNum);
  33. bool SetIoMode(int ioNum,int ioMode ,int triggeredMode);
  34. unsigned char GetIO(unsigned char * level ,unsigned char ioNum);
  35. bool GetIoBlockMode( unsigned char * level,unsigned char ioNum);
  36. bool CopyDir(char * dstDir,char * srcDir);
  37. bool SetBacklightSwitch(bool flag);
  38. void SetBacklightOn(int BakLevel);
  39. bool SetBacklightTimeOut(int timeValue);
  40. void SetDefaultBackLightLevel(int level);
  41. bool EnableBackLightAuto(bool flag);
  42. bool GetEnableBackLightAuto();
  43. int GetDefaultBackLightLevel();
  44. int GetBacklightTimeOut();
  45. void SendStartBackligtSignal();
  46. void SendStopBackligtSignal();
  47. bool SetNetWork(int num,bool isDhcp,char * ip,char * subnetmask,char * gateway,char *dns);
  48. bool GetNetWorkCfg(int num,bool *isDhcp,char * ip,char * subnetmask,char * gateway,char *dns,char *macAddr);
  49. bool SetMacAddr(int num,char * macAddr);
  50. bool GetMacAddr(int num,char * macAddr);
  51. void RandomSetMacAddr();
  52. bool SetAutoStartPath(char * path);
  53. bool GetAutoStartPath(char * path);
  54. bool RunAutoStartPath();
  55. bool ReadTouchEvent();
  56. bool TouchDisable(bool flag);
  57. bool ReadAdc(int channel,double *data);
  58. int GetWifiName(char wifiname[512][512]);
  59. void CfgWifiSsidPwd(char * ssid,char * pwd);
  60. void ConnectWifi();
  61. void DisconnectWifi();
  62. bool GetWifiSsidPwd(char * ssid,char * pwd);
  63. void OpenCanFilter(int baudrate,struct can_filter *filter,int filter_count);
  64. void OpenCan(int baudrate);
  65. int WriteCan(int can_id,unsigned char *data,unsigned char dlc);
  66. int ReadCan(unsigned int *can_id,unsigned char *can_dlc,unsigned char *data);
  67. void CloseCan();
  68. void OpenCanFilter2(int baudrate,struct can_filter *filter,int filter_count);
  69. void OpenCan2(int baudrate);
  70. int WriteCan2(int can_id,unsigned char *data,unsigned char dlc);
  71. int ReadCan2(unsigned int *can_id,unsigned char *can_dlc,unsigned char *data);
  72. void CloseCan2();
  73. bool Connect3G() ;
  74. bool Disconnect3G();
  75. };
  76. #endif // YCAPI_H