Home
last modified time | relevance | path

Searched refs:fileDescriptor (Results 1 – 25 of 37) sorted by relevance

12

/base/sensors/medical_sensor/frameworks/native/medical_sensor/src/
Dmy_file_descriptor_listener.cpp39 void MyFileDescriptorListener::OnReadable(int32_t fileDescriptor) in OnReadable() argument
42 if (fileDescriptor < 0) { in OnReadable()
43 HiLog::Error(LABEL, "%{public}s fileDescriptor: %{public}d", __func__, fileDescriptor); in OnReadable()
47 FileDescriptorListener::OnReadable(fileDescriptor); in OnReadable()
51 int32_t len = recv(fileDescriptor, receiveDataBuff_, maxLen, NULL); in OnReadable()
66 len = recv(fileDescriptor, receiveDataBuff_, maxLen, NULL); in OnReadable()
70 void MyFileDescriptorListener::OnWritable(int32_t fileDescriptor) {} in OnWritable() argument
77 void MyFileDescriptorListener::OnShutdown(int32_t fileDescriptor) in OnShutdown() argument
79 if (fileDescriptor < 0) { in OnShutdown()
80 HiLog::Error(LABEL, "%{public}s param is error: %{public}d", __func__, fileDescriptor); in OnShutdown()
[all …]
/base/sensors/sensor/frameworks/native/sensor/src/
Dsensor_file_descriptor_listener.cpp47 void SensorFileDescriptorListener::OnReadable(int32_t fileDescriptor) in OnReadable() argument
49 if (fileDescriptor < 0) { in OnReadable()
50 SEN_HILOGE("fileDescriptor:%{public}d", fileDescriptor); in OnReadable()
59 recv(fileDescriptor, receiveDataBuff_, sizeof(SensorData) * RECEIVE_DATA_SIZE, 0); in OnReadable()
75 len = recv(fileDescriptor, receiveDataBuff_, sizeof(SensorData) * RECEIVE_DATA_SIZE, 0); in OnReadable()
84 void SensorFileDescriptorListener::OnShutdown(int32_t fileDescriptor) in OnShutdown() argument
86 if (fileDescriptor < 0) { in OnShutdown()
87 SEN_HILOGE("Invalid fd:%{public}d", fileDescriptor); in OnShutdown()
97 void SensorFileDescriptorListener::OnException(int32_t fileDescriptor) in OnException() argument
99 if (fileDescriptor < 0) { in OnException()
[all …]
/base/notification/eventhandler/frameworks/eventhandler/test/unittest/
Dlib_event_epoll_io_waiter_test.cpp76 int32_t fileDescriptor = -1; variable
78 bool result = epollIoWaiter.AddFileDescriptor(fileDescriptor, events);
80 epollIoWaiter.RemoveFileDescriptor(fileDescriptor);
96 int32_t fileDescriptor = 1; variable
98 bool result = epollIoWaiter.AddFileDescriptor(fileDescriptor, events);
100 epollIoWaiter.RemoveFileDescriptor(fileDescriptor);
116 int32_t fileDescriptor = 1; variable
118 bool result = epollIoWaiter.AddFileDescriptor(fileDescriptor, events);
/base/web/webview/ohos_adapter/event_handler_adapter/src/
Devent_handler_adapter_impl.cpp29 void EventHandlerFDListenerAdapterImpl::OnReadable(int32_t fileDescriptor) in OnReadable() argument
32 listener_->OnReadable(fileDescriptor); in OnReadable()
42 …int32_t fileDescriptor, uint32_t events, const std::shared_ptr<EventHandlerFDListenerAdapter>& lis… in AddFileDescriptorListener() argument
49 …return eventHandler_->AddFileDescriptorListener(fileDescriptor, events, fileDescriptorListener) ==… in AddFileDescriptorListener()
52 void EventHandlerAdapterImpl::RemoveFileDescriptorListener(int32_t fileDescriptor) in RemoveFileDescriptorListener() argument
55 eventHandler_->RemoveFileDescriptorListener(fileDescriptor); in RemoveFileDescriptorListener()
/base/notification/eventhandler/test/fuzztest/filedescriptorlistener_fuzzer/
Dfiledescriptorlistener_fuzzer.cpp30 int32_t fileDescriptor = U32_AT(reinterpret_cast<const uint8_t*>(data)); in DoSomethingInterestingWithMyAPI() local
32 listener -> OnReadable(fileDescriptor); in DoSomethingInterestingWithMyAPI()
33 listener -> OnWritable(fileDescriptor); in DoSomethingInterestingWithMyAPI()
34 listener -> OnShutdown(fileDescriptor); in DoSomethingInterestingWithMyAPI()
35 listener -> OnException(fileDescriptor); in DoSomethingInterestingWithMyAPI()
/base/sensors/medical_sensor/frameworks/native/medical_sensor/include/
Dmy_file_descriptor_listener.h37 void OnReadable(int32_t fileDescriptor) override;
39 void OnWritable(int32_t fileDescriptor) override;
41 void OnShutdown(int32_t fileDescriptor) override;
43 void OnException(int32_t fileDescriptor) override;
/base/notification/eventhandler/frameworks/eventhandler/src/
Depoll_io_waiter.cpp34 inline int32_t EpollCtrl(int32_t epollFd, int32_t operation, int32_t fileDescriptor, uint32_t epoll… in EpollCtrl() argument
38 .data = {.fd = fileDescriptor}, in EpollCtrl()
41 return epoll_ctl(epollFd, operation, fileDescriptor, &epollEvent); in EpollCtrl()
206 bool EpollIoWaiter::AddFileDescriptor(int32_t fileDescriptor, uint32_t events) in AddFileDescriptor() argument
208 if ((fileDescriptor < 0) || ((events & FILE_DESCRIPTOR_EVENTS_MASK) == 0)) { in AddFileDescriptor()
209 … HILOGE("AddFileDescriptor(%{public}d, %{public}u): Invalid parameter", fileDescriptor, events); in AddFileDescriptor()
228 if (EpollCtrl(epollFd_, EPOLL_CTL_ADD, fileDescriptor, epollEvents) < 0) { in AddFileDescriptor()
238 void EpollIoWaiter::RemoveFileDescriptor(int32_t fileDescriptor) in RemoveFileDescriptor() argument
240 if (fileDescriptor < 0) { in RemoveFileDescriptor()
241 … HILOGE("RemoveFileDescriptor: Invalid param while removing fd, fd = %{public}d", fileDescriptor); in RemoveFileDescriptor()
[all …]
Dnative_implement_eventhandler.cpp156 int32_t fileDescriptor, uint32_t events, const FileDescriptorCallbacks *fdCallbacks) const in AddFileDescriptorListener() argument
160 fileDescriptor, events, nativeFileDescriptorListener); in AddFileDescriptorListener()
163 void EventRunnerNativeImplement::RemoveFileDescriptorListener(int32_t fileDescriptor) const in RemoveFileDescriptorListener()
165 eventRunner_->GetEventQueue()->RemoveFileDescriptorListener(fileDescriptor); in RemoveFileDescriptorListener()
Devent_queue.cpp375 … int32_t fileDescriptor, uint32_t events, const std::shared_ptr<FileDescriptorListener> &listener) in AddFileDescriptorListener() argument
377 if ((fileDescriptor < 0) || ((events & FILE_DESCRIPTOR_EVENTS_MASK) == 0) || (!listener)) { in AddFileDescriptorListener()
379 fileDescriptor, in AddFileDescriptorListener()
389 auto it = listeners_.find(fileDescriptor); in AddFileDescriptorListener()
391 …E("AddFileDescriptorListener: File descriptor %{public}d is already in listening", fileDescriptor); in AddFileDescriptorListener()
399 if (!ioWaiter_->AddFileDescriptor(fileDescriptor, events)) { in AddFileDescriptorListener()
404 listeners_.emplace(fileDescriptor, listener); in AddFileDescriptorListener()
429 void EventQueue::RemoveFileDescriptorListener(int32_t fileDescriptor) in RemoveFileDescriptorListener() argument
431 if (fileDescriptor < 0) { in RemoveFileDescriptorListener()
432 HILOGE("RemoveFileDescriptorListener(%{public}d): Invalid file descriptor", fileDescriptor); in RemoveFileDescriptorListener()
[all …]
/base/notification/eventhandler/frameworks/test/moduletest/
Devent_handler_fd_listener_module_test.cpp61 void OnReadable(int32_t fileDescriptor) override in OnReadable() argument
63 if (fileDescriptor < 0) { in OnReadable()
68 FileDescriptorListener::OnReadable(fileDescriptor); in OnReadable()
72 ssize_t retVal = read(fileDescriptor, message, sizeof(message) - 1); in OnReadable()
79 void OnWritable(int32_t fileDescriptor) override in OnWritable() argument
81 if (fileDescriptor < 0) { in OnWritable()
86 FileDescriptorListener::OnWritable(fileDescriptor); in OnWritable()
95 handler->RemoveFileDescriptorListener(fileDescriptor); in OnWritable()
96 auto f = [fileDescriptor]() { write(fileDescriptor, "test", sizeof("test")); }; in OnWritable()
102 void OnShutdown(int32_t fileDescriptor) override in OnShutdown() argument
[all …]
Devent_handler_press_module_test.cpp84 void OnReadable(int32_t fileDescriptor) override in OnReadable() argument
88 ssize_t retVal = read(fileDescriptor, message, sizeof(message) - 1); in OnReadable()
95 void OnWritable(int32_t fileDescriptor) override in OnWritable() argument
99 handler->RemoveFileDescriptorListener(fileDescriptor); in OnWritable()
105 … auto f = [fileDescriptor, message]() { write(fileDescriptor, message.c_str(), message.size()); }; in OnWritable()
/base/notification/eventhandler/interfaces/inner_api/
Dfile_descriptor_listener.h45 virtual void OnReadable(int32_t fileDescriptor);
52 virtual void OnWritable(int32_t fileDescriptor);
59 virtual void OnShutdown(int32_t fileDescriptor);
66 virtual void OnException(int32_t fileDescriptor);
Dnative_implement_eventhandler.h73 int32_t fileDescriptor, uint32_t events, const FileDescriptorCallbacks *fdCallbacks) const;
80 void RemoveFileDescriptorListener(int32_t fileDescriptor) const;
/base/sensors/sensor/frameworks/native/sensor/include/
Dsensor_file_descriptor_listener.h30 void OnReadable(int32_t fileDescriptor) override;
31 void OnShutdown(int32_t fileDescriptor) override;
32 void OnException(int32_t fileDescriptor) override;
/base/web/webview/ohos_adapter/interfaces/
Devent_handler_adapter.h28 virtual void OnReadable(int32_t fileDescriptor) = 0;
38 …int32_t fileDescriptor, uint32_t events, const std::shared_ptr<EventHandlerFDListenerAdapter>& lis…
40 virtual void RemoveFileDescriptorListener(int32_t fileDescriptor) = 0;
/base/notification/eventhandler/frameworks/native/src/
Dnative_interface_eventhandler.cpp61 …unnerAddFileDescriptorListener(const EventRunnerNativeImplement *nativeObj, int32_t fileDescriptor, in EventRunnerAddFileDescriptorListener() argument
68 return nativeObj->AddFileDescriptorListener(fileDescriptor, events, fileDescriptorCallbacks); in EventRunnerAddFileDescriptorListener()
71 …erRemoveFileDescriptorListener(const EventRunnerNativeImplement *nativeObj, int32_t fileDescriptor) in EventRunnerRemoveFileDescriptorListener() argument
77 nativeObj->RemoveFileDescriptorListener(fileDescriptor); in EventRunnerRemoveFileDescriptorListener()
/base/web/webview/ohos_adapter/event_handler_adapter/include/
Devent_handler_adapter_impl.h30 void OnReadable(int32_t fileDescriptor) override;
42 bool AddFileDescriptorListener(int32_t fileDescriptor, uint32_t events,
45 void RemoveFileDescriptorListener(int32_t fileDescriptor) override;
/base/usb/usb_manager/test/native/js_unittest/
DUsbCoreJsunit.test.js273 var fileDescriptor = usb.getFileDescriptor(gPipe);
274 console.info('usb case getFileDescriptor ret: ' + fileDescriptor);
296 var fileDescriptor = usb.getFileDescriptor(tempPipe);
297 expect(fileDescriptor < 0).assertTrue();
298 console.info('usb case getFileDescriptor ret: ' + fileDescriptor);
318 var fileDescriptor = usb.getFileDescriptor(tempPipe);
319 expect(fileDescriptor < 0).assertTrue();
320 console.info('usb case getFileDescriptor ret: ' + fileDescriptor);
340 var fileDescriptor = usb.getFileDescriptor(tempPipe);
341 expect(fileDescriptor < 0).assertTrue();
[all …]
/base/notification/eventhandler/test/fuzztest/noneiowaiter_fuzzer/
Dnoneiowaiter_fuzzer.cpp27 int32_t fileDescriptor = U32_AT(reinterpret_cast<const uint8_t*>(data)); in DoSomethingInterestingWithMyAPI() local
30 noneIoWaiter.AddFileDescriptor(fileDescriptor, events); in DoSomethingInterestingWithMyAPI()
31 noneIoWaiter.RemoveFileDescriptor(fileDescriptor); in DoSomethingInterestingWithMyAPI()
/base/notification/eventhandler/interfaces/kits/native/
Dnative_interface_eventhandler.h144 …entRunnerAddFileDescriptorListener(const EventRunnerNativeImplement *nativeObj, int fileDescriptor,
157 …unnerRemoveFileDescriptorListener(const EventRunnerNativeImplement *nativeObj, int fileDescriptor);
/base/notification/eventhandler/frameworks/eventhandler/include/
Dio_waiter.h70 virtual bool AddFileDescriptor(int32_t fileDescriptor, uint32_t events) = 0;
77 virtual void RemoveFileDescriptor(int32_t fileDescriptor) = 0;
Dnone_io_waiter.h41 bool AddFileDescriptor(int32_t fileDescriptor, uint32_t events) final;
42 void RemoveFileDescriptor(int32_t fileDescriptor) final;
Depoll_io_waiter.h48 bool AddFileDescriptor(int32_t fileDescriptor, uint32_t events) final;
49 void RemoveFileDescriptor(int32_t fileDescriptor) final;
/base/notification/eventhandler/test/fuzztest/epolliowaiter_fuzzer/
Depolliowaiter_fuzzer.cpp31 int32_t fileDescriptor = U32_AT(reinterpret_cast<const uint8_t*>(data)); in DoSomethingInterestingWithMyAPI() local
34 epollIoWaiter.RemoveFileDescriptor(fileDescriptor); in DoSomethingInterestingWithMyAPI()
/base/notification/eventhandler/test/fuzztest/nativeimplementeventhandler_fuzzer/
Dnativeimplementeventhandler_fuzzer.cpp30 int32_t fileDescriptor = U32_AT(reinterpret_cast<const uint8_t*>(data)); in DoSomethingInterestingWithMyAPI() local
32 eventRunnerNativeImplement.RemoveFileDescriptorListener(fileDescriptor); in DoSomethingInterestingWithMyAPI()

12