123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #include <unistd.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <cstring>
- #include <fcntl.h>
- #include "Feature.h"
- static const char* DEVICE_NAME = "/dev/ipa";
- Feature::Feature()
- {
- m_fd = open(DEVICE_NAME, O_RDWR);
- if (!m_fd)
- {
- cout << "Failed to open " << DEVICE_NAME << endl;
- }
- }
- Feature::~Feature()
- {
- if (m_fd)
- {
- close(m_fd);
- }
- }
- bool Feature::DeviceNodeIsOpened()
- {
- return (m_fd > 0 && fcntl(m_fd, F_GETFL) >= 0);
- }
|