Subversion Repositories HomeAutomation

Rev

Rev 851 | Rev 869 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 851 Rev 852
Line 11... Line 11...
11
    ///TODO: Stuff that needs doing is done here
11
    ///TODO: Stuff that needs doing is done here
12
}
12
}
13
 
13
 
14
void <template>_HandleMessage(StdCan_Msg_t *rxMsg)
14
void <template>_HandleMessage(StdCan_Msg_t *rxMsg)
15
{
15
{
16
    StdCan_Msg_t txMsg;
-
 
17
    uint8_t n = 0;
-
 
18
 
-
 
19
    if (    StdCan_Ret_class(rxMsg->Header) == CAN_CLASS_MODULE_<template> && ///TODO: Change this to the actual class type
16
    if (    StdCan_Ret_class(rxMsg->Header) == CAN_CLASS_MODULE_DEF && ///TODO: Change this to the actual class type
20
        StdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER &&
17
        StdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER &&
21
        rxMsg->Header.ModuleType == CAN_TYPE_MODULE_<template> && ///TODO: Change this to the actual module type
18
        rxMsg->Header.ModuleType == CAN_TYPE_MODULE_def_default && ///TODO: Change this to the actual module type
22
        rxMsg->Header.ModuleId == <template>_ID)
19
        rxMsg->Header.ModuleId == <template>_ID)
23
    {
20
    {
24
        switch (rxMsg->Header.Command)
21
        switch (rxMsg->Header.Command)
25
        {
22
        {
26
        case CAN_CMD_MODULE_DUMMY:
23
        case CAN_CMD_MODULE_DUMMY:
Line 32... Line 29...
32
 
29
 
33
void <template>_List(uint8_t ModuleSequenceNumber)
30
void <template>_List(uint8_t ModuleSequenceNumber)
34
{
31
{
35
    StdCan_Msg_t txMsg;
32
    StdCan_Msg_t txMsg;
36
   
33
   
37
    StdCan_Set_class(txMsg.Header, CAN_CLASS_MODULE_<template>); ///TODO: Change this to the actual class type
34
    StdCan_Set_class(txMsg.Header, CAN_CLASS_MODULE_DEF); ///TODO: Change this to the actual class type
38
    StdCan_Set_direction(txMsg.Header, DIR_FROM_OWNER);
35
    StdCan_Set_direction(txMsg.Header, DIR_FROM_OWNER);
39
    txMsg.Header.ModuleType = CAN_TYPE_MODULE_<template>; ///TODO: Change this to the actual module type
36
    txMsg.Header.ModuleType = CAN_TYPE_MODULE_def_default; ///TODO: Change this to the actual module type
40
    txMsg.Header.ModuleId = <template>_ID;
37
    txMsg.Header.ModuleId = <template>_ID;
41
    txMsg.Header.Command = CAN_CMD_MODULE_NMT_LIST;
38
    txMsg.Header.Command = CAN_CMD_MODULE_NMT_LIST;
42
    txMsg.Length = 6;
39
    txMsg.Length = 6;
43
 
40
 
44
    txMsg.Data[0] = NODE_HW_ID_BYTE0;
41
    txMsg.Data[0] = NODE_HW_ID_BYTE0;