adbcommand.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef ADBCOMMAND_H
  2. #define ADBCOMMAND_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "command.h"
  7. #ifdef __cplusplus
  8. }
  9. #endif
  10. class AdbCommand
  11. {
  12. public:
  13. AdbCommand();
  14. public:
  15. static process_t adb_execute(const char *serial, const char *const adb_cmd[], size_t len);
  16. static process_t adb_forward(const char *serial, uint16_t local_port, const char *device_socket_name);
  17. static process_t adb_forward_remove(const char *serial, uint16_t local_port);
  18. static process_t adb_reverse(const char *serial, const char *device_socket_name, uint16_t local_port);
  19. static process_t adb_reverse_remove(const char *serial, const char *device_socket_name);
  20. static process_t adb_push(const char *serial, const char *local, const char *remote);
  21. static process_t adb_install(const char *serial, const char *local);
  22. static bool process_check_success(process_t proc, const char *name);
  23. static bool is_regular_file(const char *path);
  24. static int isDeviceConnected(char *pDevice);
  25. static int isWirelessConnected(char *pDevice);
  26. static bool adbConnect(const char *ip);
  27. static bool adbDisConnect(const char *ip);
  28. static bool adbReset();
  29. static bool pushFile(const char *serail, const char *src, const char *dest, int timeout);
  30. static bool adbForward(const char *serial, const char *device_socket_name, uint16_t local_port);
  31. static bool adbReverse(const char *serial, const char *device_socket_name, uint16_t local_port);
  32. static bool adbForwardRemove(const char *serial, uint16_t local_port);
  33. static bool adbReverseRemove(const char *serial, const char *device_socket_name);
  34. static bool adbExecute(const char *serial, const char *adb_cmd);
  35. static long getFileSize(const char *filePath);
  36. };
  37. #endif // ADBCOMMAND_H