Skip to content

Commit

Permalink
fix for #392 - exposing OS_STREAM_STATE_* in public .h files for OS_S…
Browse files Browse the repository at this point in the history
…electSingle()
  • Loading branch information
CDKnightNASA committed Mar 27, 2020
1 parent 2c2ce1e commit f0fae6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
21 changes: 18 additions & 3 deletions src/os/inc/osapi-os-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ typedef struct
uint8 object_ids[(OS_MAX_NUM_OPEN_FILES + 7) / 8];
} OS_FdSet;

/**
* @brief For the OS_SelectSingle() function's in/out StateFlags parameter,
* the state(s) of the stream and the result of the select is a combination
* of one or more of these states.
*
* @sa OS_SelectSingle()
*/
typedef enum
{
OS_STREAM_STATE_BOUND = 0x01,
OS_STREAM_STATE_CONNECTED = 0x02,
OS_STREAM_STATE_READABLE = 0x04,
OS_STREAM_STATE_WRITABLE = 0x08,
} OS_StreamState_t;

/**
* @brief For the @ref OS_GetErrorName() function, to ensure
* everyone is making an array of the same length.
Expand Down Expand Up @@ -1409,9 +1424,9 @@ int32 OS_SelectMultiple(OS_FdSet *ReadSet, OS_FdSet *WriteSet, int32 msecs);
*
* This function can be used to wait for a single OSAL stream ID
* to become readable or writable. On entry, the "StateFlags"
* parameter should be set to the desired state (readble or writable)
* and upon return the flags will be set to the state actually
* detected.
* parameter should be set to the desired state (OS_STREAM_STATE_READABLE
* and/or OS_STREAM_STATE_WRITABLE) and upon return the flags
* will be set to the state actually detected.
*
* As this operates on a single ID, the filehandle is protected
* during this call, such that another thread accessing the same
Expand Down
8 changes: 0 additions & 8 deletions src/os/shared/os-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ typedef struct
uint16 flags;
}OS_common_record_t;

typedef enum
{
OS_STREAM_STATE_BOUND = 0x01,
OS_STREAM_STATE_CONNECTED = 0x02,
OS_STREAM_STATE_READABLE = 0x04,
OS_STREAM_STATE_WRITABLE = 0x08,
} OS_StreamState_t;

/*tasks */
typedef struct
{
Expand Down

0 comments on commit f0fae6a

Please sign in to comment.