SCOM Serial Communication Protocol
0.5.2
|
Service filters. More...
Go to the source code of this file.
Macros | |
#define | HAL_LOG_CHANNEL SCOM |
#define | HAL_LOG_SUBCHANNEL SERVICE |
Functions | |
SCOMResult | SCOM_InitializeServiceMatchFilter (SCOMServiceMatchFilter *serviceMatchFilter, void *data, size_t max_data_size) |
SCOMResult | SCOM_DeinitializeServiceMatchFilter (SCOMServiceMatchFilter *serviceMatchFilter) |
SCOMResult | SCOM_SetupServiceMatchFilter (SCOMServiceMatchFilter *serviceMatchFilter, uint8_t serviceID, uint8_t primitiveID) |
SCOMResult | SCOM_WaitForServiceFilter (SCOMServiceMatchFilter *serviceMatchFilter, OSTime timeout) |
Service filters.
Definition in file scom_service_filter.c.
#define HAL_LOG_CHANNEL SCOM |
Definition at line 9 of file scom_service_filter.c.
#define HAL_LOG_SUBCHANNEL SERVICE |
Definition at line 10 of file scom_service_filter.c.
SCOMResult SCOM_DeinitializeServiceMatchFilter | ( | SCOMServiceMatchFilter * | serviceMatchFilter | ) |
Deinitializes a service match filter.
serviceMatchFilter | pointer to the SCOMServiceMatchFilter structure, describing the filter |
SCOM_RESULT_OK | |
SCOM_FILTER_ERROR | if the filter not exist |
Definition at line 142 of file scom_service_filter.c.
References SCOM_FILTER_ERROR, SCOM_RESULT_OK, and SCOMServiceMatchFilter::sem.
Referenced by SCOM_ServiceTransaction().
SCOMResult SCOM_InitializeServiceMatchFilter | ( | SCOMServiceMatchFilter * | serviceMatchFilter, |
void * | data, | ||
size_t | max_data_size | ||
) |
Initializes a service match filter.
serviceMatchFilter | pointer to the SCOMServiceMatchFilter structure, describing the filter |
data | pointer to the buffer, where to store received data from the matching frame |
max_data_size | capacity of the buffer |
SCOM_RESULT_OK | when the filter is set up successfully |
SCOM_FILTER_ERROR | if the filter could not be initializes properly |
Definition at line 121 of file scom_service_filter.c.
References SCOMServiceMatchFilter::data, SCOMServiceMatchFilter::filter, SCOMFilterDesc::filter_match_function, SCOMServiceMatchFilter::max_data_size, SCOMServiceMatchFilter::multi_id, SCOMServiceMatchFilter::offset, SCOM_FILTER_ERROR, SCOM_RESULT_OK, and SCOMServiceMatchFilter::sem.
Referenced by SCOM_ServiceTransaction().
SCOMResult SCOM_SetupServiceMatchFilter | ( | SCOMServiceMatchFilter * | serviceMatchFilter, |
uint8_t | serviceID, | ||
uint8_t | primitiveID | ||
) |
Sets up a previously initialized service match filter.
serviceMatchFilter | pointer to the SCOMServiceMatchFilter structure, describing the filter |
serviceID | service ID to match |
primitiveID | primitive ID within given service to match |
SCOM_RESULT_OK | when the filter is set up successfully |
SCOM_FILTER_ERROR | if the filter could not be set up properly |
Definition at line 155 of file scom_service_filter.c.
References SCOMServiceMatchFilter::primitiveID, SCOM_FILTER_ERROR, SCOM_RESULT_OK, SCOMServiceMatchFilter::sem, and SCOMServiceMatchFilter::serviceID.
Referenced by SCOM_ServiceTransaction().
SCOMResult SCOM_WaitForServiceFilter | ( | SCOMServiceMatchFilter * | serviceMatchFilter, |
OSTime | timeout | ||
) |
Performs a blocking call and waits for the specified filter to catch a matching frame. The blocking relies on the os_sem implementation.
serviceMatchFilter | pointer to the SCOMServiceMatchFilter structure, describing the filter |
timeout | maximum time to wait for the matching frame reception |
SCOM_RESULT_OK | when the filter caught the matching frame. The frame data is available in the serviceMatchFilter structure |
SCOM_FILTER_TIMEOUT | when the timeout was reached and the filter did not catch any matching frame |
SCOM_FILTER_ERROR | when the filter is invalid |
Definition at line 174 of file scom_service_filter.c.
References SCOM_FILTER_ERROR, SCOM_FILTER_TIMEOUT, SCOM_RESULT_OK, and SCOMServiceMatchFilter::sem.
Referenced by SCOM_ServiceTransaction().