b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /** |
| 2 | * Copyright (C) ARM Limited 2013-2014. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #ifndef UEVENT_H |
| 10 | #define UEVENT_H |
| 11 | |
| 12 | struct UEventResult { |
| 13 | const char *mAction; |
| 14 | const char *mDevPath; |
| 15 | const char *mSubsystem; |
| 16 | char mBuf[1<<13]; |
| 17 | }; |
| 18 | |
| 19 | class UEvent { |
| 20 | public: |
| 21 | UEvent(); |
| 22 | ~UEvent(); |
| 23 | |
| 24 | bool init(); |
| 25 | bool read(UEventResult *const result); |
| 26 | int getFd() const { return mFd; } |
| 27 | |
| 28 | private: |
| 29 | int mFd; |
| 30 | |
| 31 | // Intentionally undefined |
| 32 | UEvent(const UEvent &); |
| 33 | UEvent &operator=(const UEvent &); |
| 34 | }; |
| 35 | |
| 36 | #endif // UEVENT_H |