WF_MulticastSetConfig Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
WF_MulticastSetConfig Function
C
void WF_MulticastSetConfig(
    tWFMultiCastConfig * p_config
);
Description

This function allows the application to configure up to two Multicast Address Filters on the MRF24W. If two active multicast filters are set up they are OR’d together – the MRF24W will receive and pass to the Host CPU received packets from either multicast address. The allowable values in p_config (tWFMultiCastConfig / WFMulticastConfigStruct) are: 

 

  • filterId -- WF_MULTICAST_FILTER_1 or WF_MULTICAST_FILTER_2

 

  • action -- WF_MULTICAST_DISABLE_ALL (default) The Multicast Filter discards all received multicast messages – they will not be forwarded to the Host PIC. The remaining fields in this structure are ignored.

 

WF_MULTICAST_ENABLE_ALL The Multicast Filter forwards all received multicast messages to the Host PIC. The remaining fields in this structure are ignored. 

WF_MULTICAST_USE_FILTERS The MAC filter will be used and the remaining fields in this structure configure which Multicast messages are forwarded to the Host PIC. 

 

  • macBytes -- Array containing the MAC address to filter on (using the destination address of each incoming 802.11 frame). Specific bytes with the MAC address can be designated as ‘don’t care’ bytes. See macBitMask. This field in only used if action = WF_MULTICAST_USE_FILTERS.

 

  • macBitMask -- A byte where bits 5:0 correspond to macBytes[5:0]. If the bit is zero then the corresponding MAC byte must be an exact match for the frame to be forwarded to the Host PIC. If the bit is one then the corresponding MAC byte is a ‘don’t care’ and not used in the Multicast filtering process. This field in only used if action = WF_MULTICAST_USE_FILTERS.

 

By default, both Multicast Filters are inactive.

Preconditions

MACInit must be called first.

Returns

None.

Remarks

Definition WF_USE_MULTICAST_FUNCTIONS needs to be enabled.

Example

- Filter on Multicast Address of 01:00:5e:xx:xx:xx where xx are don't care bytes. 

p_config->filterId = WF_MULTICAST_FILTER_1  

 

[0] [1] [2] [3] [4] [5] 

p_config->macBytes[] = 01, 00, 5e, ff, ff, ff (0xff are the don't care bytes) 

 

p_config->macBitMask = 0x38 --> bits 5:3 = 1 (don't care on bytes 3,4,5) 

--> bits 2:0 = 0 (exact match required on bytes 0,1,2) 

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.