DolphinV4 API  1.6.1.0
FILTER functions
Collaboration diagram for FILTER functions:

Macros

#define filter_setConfig(pu8Param, u8Index, u8NewValue)   pu8Param[u8Index]=u8NewValue; filter_init(pu8Param,u8Index);
#define filter_dropWeaker(u8dBm)   filter_add(FILTER_TYPE_DBM,u8dBm,FILTER_KIND_BLOCK);
#define filter_dropStronger(u8dBm)   filter_add(FILTER_TYPE_DBM,u8dBm,FILTER_KIND_APPLY);
#define filter_dropChoice(u8Choice)   filter_add(FILTER_TYPE_CHOICE,u8Choice,FILTER_KIND_BLOCK);
#define filter_allowChoice(u8Choice)   filter_add(FILTER_TYPE_CHOICE,u8Choice,FILTER_KIND_APPLY);
#define filter_dropId(u32Id)   filter_add(FILTER_TYPE_ID,u32Id,FILTER_KIND_BLOCK);
#define filter_allowId(u32Id)   filter_add(FILTER_TYPE_ID,u32Id,FILTER_KIND_APPLY);

Functions

void filter_init (uint8 *pu8Param, uint8 u8ParamToSet)
RETURN_TYPE filter_add (FILTER_TYPE u8filterType, uint32 u32compare, FILTER_KIND u8filterKind)
RETURN_TYPE filter_del (FILTER_TYPE u8filterType, uint32 u32compare)
void filter_delAll ()
void filter_enable (uint8 u8enable)
void filter_enable_repeater (uint8 u8enable)

Detailed Description

The FILTER module is used to filter received telegrams according:

When the filter is active telegrams which matches to the data specified with the filter module are dropped and the application does not receive them.
Note:
Because of internal changes how the filter module internally works compared to the API V1, it is necessary to define the two arrays, u32gFilterValue[1] and u8gFilterCfg[1] even if filters are not used. This is done in the EO3000I_CFG.c file
IDX_FILTER_OPERATOR is valid for all filters!!
FILTER_KIND=APPLY => BLOCK all other type of Telegrams.


Macro Definition Documentation

#define filter_setConfig (   pu8Param,
  u8Index,
  u8NewValue 
)    pu8Param[u8Index]=u8NewValue; filter_init(pu8Param,u8Index);

Sets one filter parameter

Parameters:
[in]*pu8ParamPointer to the list of parameters to set. See #filter_param[]
[in]u8IndexIndex of parameter to set. See FILTER_PARAM_IDX
[in]u8NewValueThe parameter value
Returns:
-
Note:
This macro is allowed to be used in an interrupt callback function!
See also:
filter_init
#define filter_dropWeaker (   u8dBm)    filter_add(FILTER_TYPE_DBM,u8dBm,FILTER_KIND_BLOCK);

BLOCKS weaker signal as -u8dBm dBm (z.b. -80, -90dBm...)

Parameters:
[in]u8dBmThe dBm value is an unsigned value but actualy should be interpretted as - dBm values
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropStronger, filter_dropChoice, filter_allowChoice, filter_dropId, filter_allowId
#define filter_dropStronger (   u8dBm)    filter_add(FILTER_TYPE_DBM,u8dBm,FILTER_KIND_APPLY);

BLOCKS stronger signal as -u8dBm dBm (z.b. -80, -90dBm...)

Parameters:
[in]u8dBmThe dBm value is an unsigned value but actualy should be interpretted as - dBm values
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropWeaker, filter_dropChoice, filter_allowChoice, filter_dropId, filter_allowId
#define filter_dropChoice (   u8Choice)    filter_add(FILTER_TYPE_CHOICE,u8Choice,FILTER_KIND_BLOCK);

BLOCKS choice u8Choice

Parameters:
[in]u8ChoiceChoice to block
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropStronger, filter_dropWeaker, filter_allowChoice, filter_dropId, filter_allowId
#define filter_allowChoice (   u8Choice)    filter_add(FILTER_TYPE_CHOICE,u8Choice,FILTER_KIND_APPLY);

ALLOWS choice u8Choice

Parameters:
[in]u8ChoiceChoice to allow
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropStronger, filter_dropWeaker, filter_dropChoice, filter_dropId, filter_allowId
#define filter_dropId (   u32Id)    filter_add(FILTER_TYPE_ID,u32Id,FILTER_KIND_BLOCK);

BLOCKS ID

Parameters:
[in]u32IdId to block
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropStronger, filter_dropWeaker, filter_dropChoice, filter_allowChoice, filter_allowId
#define filter_allowId (   u32Id)    filter_add(FILTER_TYPE_ID,u32Id,FILTER_KIND_APPLY);

ALLOWS ID

Parameters:
[in]u32IdId to allow
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
See also:
filter_add, filter_dropStronger, filter_dropWeaker, filter_dropChoice, filter_allowChoice, filter_dropId

Function Documentation

void filter_init ( uint8 *  pu8Param,
uint8  u8ParamToSet 
)

Sets the filter parameters for radio communication, delete all filters, and disable filter functionality

Parameters:
[in]*pu8ParamPointer to the list of parameters to set. See FILTER_PARAM_IDX
[in]u8ParamToSetIt has to be SET_ALL_PARAM to set all parameters from FILTER_PARAM_IDX of the list
Returns:
-
Note:
This function is allowed to be used in an interrupt callback function ONLY if it is ensured that it is not used at the same time from the main program!
See also:
filter_setConfig, FILTER_PARAM_IDX
RETURN_TYPE filter_add ( FILTER_TYPE  u8filterType,
uint32  u32compare,
FILTER_KIND  u8filterKind 
)

Adds a filter to the filter list and enables filter functionality

Parameters:
[in]u8filterTypetype of filter, See FILTER_TYPE
[in]u32comparecompare value of filter (ID=32 bit, CHOICE=8 bit, REPT=1 bit)
[in]u8filterKindkind of filter, See FILTER_KIND
Returns:
OK added filter to filter buffer
MAX_FILTER_REACHED filter buffer is full
Note:
If FILTER_TYPE = CHOICE look filterable CHOICE_TYPE

Example 1:
Add filter for Choice,only RPS Telegramms are allowed!!

filter_init(filter_param, SET_ALL_PARAM);
....
//BLOCKS weaker signal as -70dBm (z.b. -80, -90dBm...)
....
//BLOCKS stronger signal as -70dBm (z.b. -60, -50dBm...)
....
//BLOCKS own telegrams which were repeated by an other module
uint32 u32Id;
....
misc_getId(&u32Id);

Example 2:
Add filter for Choice and dBm, only RPS telegrams stronger than -70dBm are received.

// Reduce filter sensivity, only telegrams with strength > -70dBm are received
// Enable filtering

In Dolphin APIConfigurator musst set: Filter -> ON Filter by -> OPERATION AND Filter Count -> 4 (in this case >=2)

Example 3:
Add filter for filtered repeating only RPS telegrams

// Enable filtering
Note:
The dBm values are unsigned values but actualy the should be interpretted as - dBm values
See also:
filter_del, filter_dropWeaker, filter_dropStronger, filter_dropChoice, filter_allowChoice, filter_dropId, filter_allowId
RETURN_TYPE filter_del ( FILTER_TYPE  u8filterType,
uint32  u32compare 
)

Deletes a filter from the filter list

Parameters:
[in]u8filterTypetype of filter, See FILTER_TYPE
[in]u32comparecompare value of filter (ID=32 bit, CHOICE=8 bit, REPT=1 bit)
Returns:
OK filter deleted from the filter buffer
FILTER_NOT_FOUND could not be found in the filter buffer

Example 1:
Add filter for ID 4711 and filter all other IDs to dev/null and then delete filter

filter_init(filter_param, SET_ALL_PARAM);
filter_dropId(0x00004711);
.....
filter_del(FILTER_TYPE_ID,0x00004711);
See also:
filter_add, filter_delAll
void filter_delAll ( )

Deletes all filters from the filter list and disables filter functionality

Parameters:
[in]-
Returns:
-

Example 1:
Add more filters and then delete filters

Note:
This function is allowed to be used in an interrupt callback function ONLY if it is ensured that it is not used at the same time from the main program!
See also:
filter_add, filter_del
void filter_enable ( uint8  u8enable)

Enables or disables filter functionality

Parameters:
[in]u8enableTRUE=filter functionality enabled, FALSE=filter functionality disabled
Returns:
-
Note:
This function is allowed to be used in an interrupt callback function ONLY if it is ensured that it is not used at the same time from the main program!
See also:
filter_add, filter_del
void filter_enable_repeater ( uint8  u8enable)

Enables or disables filter functionality for selective repeating

Parameters:
[in]u8enableTRUE=Filtering for repeater enabled, FALSE=Filtering for repeaterdisabled
Returns:
-
Note:
This function is allowed to be used in an interrupt callback function ONLY if it is ensured that it is not used at the same time from the main program!
See also:
filter_add, filter_del