Rev 170 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 170 | Rev 173 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | * Communication services. |
2 | * Communication services. |
| 3 | * |
3 | * |
| 4 | * @date 2006- |
4 | * @date 2006-12-17 |
| 5 | * @author Jimmy Myhrman |
5 | * @author Jimmy Myhrman |
| 6 | */ |
6 | */ |
| 7 | 7 | ||
| 8 | /*----------------------------------------------------------------------------- |
8 | /*----------------------------------------------------------------------------- |
| 9 | * Includes |
9 | * Includes |
| Line 67... | Line 67... | ||
| 67 | * Parses a received CAN message in accordance with the protocol. |
67 | * Parses a received CAN message in accordance with the protocol. |
| 68 | * |
68 | * |
| 69 | * @param msg |
69 | * @param msg |
| 70 | * Pointer to the CAN message structure. |
70 | * Pointer to the CAN message structure. |
| 71 | */ |
71 | */ |
| 72 | static void Com_ParseReceivedMessage(Can_Message_t * |
72 | static void Com_ParseReceivedMessage(Can_Message_t *canMsg) { |
| 73 |
|
73 | /* |
| 74 | printf("Com_ParseReceivedMessage: {ID=%x, DLC=%u, EXT=%u, RTR=%u}\n\r", msg->Id, msg->DataLength, msg->ExtendedFlag, msg->RemoteFlag); |
- | |
| 75 |
|
74 | * Prepare a COM message. |
| 76 | 75 | */ |
|
| 77 |
|
76 | Com_Message_t comMsg; |
| - | 77 | comMsg.Funct = (canMsg->Id & 0x1E000000L) >> 25; /* bit[25..28] */ |
|
| - | 78 | comMsg.Funcc = (canMsg->Id & 0x01FF8000L) >> 15; /* bit[15..24] */ |
|
| - | 79 | comMsg.Nid = (canMsg->Id & 0x00007E00L) >> 9; /* bit[9..14] */ |
|
| - | 80 | comMsg.Sid = (canMsg->Id & 0x000001FFL) >> 0; /* bit[0..8] */ |
|
| 78 | 81 | ||
| - | 82 | /* |
|
| - | 83 | * Parse the COM message. |
|
| - | 84 | */ |
|
| - | 85 | //TODO |
|
| 79 | } |
86 | } |