Modules#

EmberAfFileDescriptorDispatchStruct

File Descriptor Dispatch#

API and Callbacks for the File Descriptor Dispatch Component.

This plugin provides an API to register a file descriptor and a callback that is called when the select() function notifies the plugin there is data on that file descriptor.

API#

EmberStatus
emberAfPluginFileDescriptorDispatchAdd(EmberAfFileDescriptorDispatchStruct *dispatchStruct)

Enumerations#

enum
EMBER_AF_FILE_DESCRIPTOR_OPERATION_NONE = 0x00
EMBER_AF_FILE_DESCRIPTOR_OPERATION_READ = 0x01
EMBER_AF_FILE_DESCRIPTOR_OPERATION_WRITE = 0x02
EMBER_AF_FILE_DESCRIPTOR_OPERATION_EXCEPT = 0x03
EMBER_AF_FILE_DESCRIPTOR_OPERATION_MAX
}

Typedefs#

typedef void(*
EmberAfFileDescriptorReadyCallback)(void *data, EmberAfFileDescriptorOperation operation)

Functions#

API Documentation#

emberAfPluginFileDescriptorDispatchAdd#

EmberStatus emberAfPluginFileDescriptorDispatchAdd (EmberAfFileDescriptorDispatchStruct * dispatchStruct)
Parameters
TypeDirectionArgument NameDescription
EmberAfFileDescriptorDispatchStruct *N/AdispatchStruct

emberAfPluginFileDescriptorDispatchWaitForEvents#

EmberStatus emberAfPluginFileDescriptorDispatchWaitForEvents (uint32_t timeoutMs)
Parameters
TypeDirectionArgument NameDescription
uint32_tN/AtimeoutMs

emberAfPluginFileDescriptorDispatchRemove#

bool emberAfPluginFileDescriptorDispatchRemove (int fileDescriptor)
Parameters
TypeDirectionArgument NameDescription
intN/AfileDescriptor

Enumeration Documentation#

EmberAfFileDescriptorOperation#

EmberAfFileDescriptorOperation
Enumerator
EMBER_AF_FILE_DESCRIPTOR_OPERATION_NONE
EMBER_AF_FILE_DESCRIPTOR_OPERATION_READ
EMBER_AF_FILE_DESCRIPTOR_OPERATION_WRITE
EMBER_AF_FILE_DESCRIPTOR_OPERATION_EXCEPT
EMBER_AF_FILE_DESCRIPTOR_OPERATION_MAX

Typedef Documentation#

EmberAfFileDescriptorReadyCallback#

typedef void(* EmberAfFileDescriptorReadyCallback) (void *data, EmberAfFileDescriptorOperation operation) )(void *data, EmberAfFileDescriptorOperation operation)

Function Documentation#

emberAfPluginFileDescriptorDispatchBadFileDescriptorCallback#

void emberAfPluginFileDescriptorDispatchBadFileDescriptorCallback (int fd)

Bad file descriptor.

Parameters
TypeDirectionArgument NameDescription
intN/Afd

The bad file descriptor Ver.: always

The indicated file descriptor has been detected to be bad. For example, the file descriptor caused an EBADF error on a select() call. The file descriptor will be omitted from subsequent file descriptor polling. The application responsible for the file descriptor should take steps to recover and clean up.