Subversion Repositories HomeAutomation

Rev

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

Rev 1504 Rev 1511
Line 132... Line 132...
132
    // shall we report diag status to CAN?
132
    // shall we report diag status to CAN?
133
    if (diagReportPending) {
133
    if (diagReportPending) {
134
        StdCan_Msg_t txMsg;
134
        StdCan_Msg_t txMsg;
135
        StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_SNS);
135
        StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_SNS);
136
        StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
136
        StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
137
        txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_INPUT;
137
        txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_PROTECTEDOUTPUT;
138
        txMsg.Header.ModuleId = act_protectedOutput_ID;
138
        txMsg.Header.ModuleId = act_protectedOutput_ID;
139
        txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_PINSTATUS;
139
        txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_PINSTATUS;
140
        txMsg.Length = 2;
140
        txMsg.Length = 2;
141
        txMsg.Data[0] = 0; //TODO: add support for more channels
141
        txMsg.Data[0] = 0; //TODO: add support for more channels
142
        // we follow the standard SNS_INPUT format, but the data corresponds to the "health" rather than physical level
142
        // we follow the standard SNS_INPUT format, but the data corresponds to the "health" rather than physical level
Line 152... Line 152...
152
 
152
 
153
 
153
 
154
void act_protectedOutput_HandleMessage(StdCan_Msg_t *rxMsg) {
154
void act_protectedOutput_HandleMessage(StdCan_Msg_t *rxMsg) {
155
    if (    StdCan_Ret_class(rxMsg->Header) == CAN_MODULE_CLASS_ACT &&
155
    if (    StdCan_Ret_class(rxMsg->Header) == CAN_MODULE_CLASS_ACT &&
156
        StdCan_Ret_direction(rxMsg->Header) == DIRECTIONFLAG_TO_OWNER &&
156
        StdCan_Ret_direction(rxMsg->Header) == DIRECTIONFLAG_TO_OWNER &&
157
        rxMsg->Header.ModuleType == CAN_MODULE_TYPE_ACT_OUTPUT &&
157
        rxMsg->Header.ModuleType == CAN_MODULE_TYPE_SNS_PROTECTEDOUTPUT &&
158
        rxMsg->Header.ModuleId == act_protectedOutput_ID)
158
        rxMsg->Header.ModuleId == act_protectedOutput_ID)
159
    {
159
    {
160
        switch (rxMsg->Header.Command) {
160
        switch (rxMsg->Header.Command) {
161
           
161
           
162
            case CAN_MODULE_CMD_PHYSICAL_SETPIN:
162
            case CAN_MODULE_CMD_PHYSICAL_SETPIN:
Line 181... Line 181...
181
void act_protectedOutput_List(uint8_t ModuleSequenceNumber)
181
void act_protectedOutput_List(uint8_t ModuleSequenceNumber)
182
{
182
{
183
    StdCan_Msg_t txMsg;
183
    StdCan_Msg_t txMsg;
184
    StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_ACT);
184
    StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_ACT);
185
    StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
185
    StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
186
    txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_OUTPUT;
186
    txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_PROTECTEDOUTPUT;
187
    txMsg.Header.ModuleId = act_protectedOutput_ID;
187
    txMsg.Header.ModuleId = act_protectedOutput_ID;
188
    txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_LIST;
188
    txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_LIST;
189
    txMsg.Length = 6;
189
    txMsg.Length = 6;
190
 
190
 
191
    txMsg.Data[0] = NODE_HW_ID_BYTE0;
191
    txMsg.Data[0] = NODE_HW_ID_BYTE0;