The first command specifies which messages are allowed to pass the filter (all others are blocked); the second command turns on the filtering behavior.
Below are example GC Protocol messages that contain these two commands for the indicated desired filtering: pass only J1850 messages that contain 0x24 in the second header byte.
The examples below use the following values as examples (they will probably need to be changed):
J1850 channel = 1
Client ID = 5 (this ID is provided to the client on connection with the Gryphon)
CMD_CARD_ADD_FILTER message:
GC frame header:
Source: SD_CLIENT (0x03)
Source channel: 0x05 (client's id)
Dest: SD_CARD (0x01)
Dest channel: 0x01 (channel ID of DLC card)
Data Length:0x00 0x18 (num of bytes following frame header)
Frame Type: FT_CMD (0x01)
Reserved: 0x00
Command header:
command: CMD_CARD_ADD_FILTER (0x48)
context: 0x00
reserved: 0x00, 0x00
Filter data:
Flags: FILTER_FLAG_PASS | FILTER_FLAG_ACTIVE (0x01|0x02=0x03)
Number of blocks: 0x01
reserved: 0x00 0x00 0x00 0x00 0x00 0x00
Filter block:
Byte offset: 0x00 0x01 (2nd header byte)
Length: 0x00 0x01 (1 byte to be compared)
Data Type: FILTER_DATA_TYPE_HEADER (0x01)
Operator: VALUE_EQ (0x05) (Check for equal value condition)
reserved: 0x00 0x00
Value: 0x24 (Value to be compared)
2nd value: 0x00 (not used for VALUE_EQ)
Padding: 0x00 0x00
Condensing the above, the hex values for the entire message:
0x03 0x05 0x01 0x01 0x00 0x14 0x01 0x00
0x48 0x00 0x00 0x00
0x03 0x01 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x01 0x00 0x01 0x01 0x05 0x00 0x00
0x24 0x00 0x00 0x00
CMD_CARD_SET_FILTER_MODE message:
GC frame header:
Source: SD_CLIENT (0x03)
Source channel: 0x05 (client's id)
Dest: SD_CARD (0x01)
Dest channel: 0x01 (channel ID of DLC card)
Data Length: 0x00 0x08
Frame Type: FT_CMD (0x01)
Reserved: 0x00
Command header:
command: CMD_CARD_SET_FILTER_MODE (0x4D)
context: 0x00
reserved: 0x00, 0x00
Command data:
Mode: FILTER_ON (0x05)
Reserved: 0x00 0x00 0x00
Condensing the above, the hex values for the entire message:
0x03 0x05 0x01 0x01 0x00 0x08 0x01 0x00
0x4d 0x00 0x00 0x00
0x05 0x00 0x00 0x00
This document was obtained from:
Dearborn Group, Inc.
(248) 488-2080
dg@dgtech.com
http://www.dgtech.com
Copyright © 2003 Dearborn Group Inc.