コード例 #1
0
ファイル: act_output.c プロジェクト: janulo/HomeAutomation
void act_output_List(uint8_t ModuleSequenceNumber)
{
	StdCan_Msg_t txMsg;
	StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_ACT);
	StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
	txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_OUTPUT;
	txMsg.Header.ModuleId = act_output_ID;
	txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_LIST;
	txMsg.Length = 6;

	uint32_t HwId=BIOS_GetHwId();
	txMsg.Data[0] = HwId&0xff;
	txMsg.Data[1] = (HwId>>8)&0xff;
	txMsg.Data[2] = (HwId>>16)&0xff;
	txMsg.Data[3] = (HwId>>24)&0xff;
	
	txMsg.Data[4] = NUMBER_OF_MODULES;
	txMsg.Data[5] = ModuleSequenceNumber;
	
	while (StdCan_Put(&txMsg) != StdCan_Ret_OK);
}
コード例 #2
0
void sns_rfid_List(uint8_t ModuleSequenceNumber)
{
    StdCan_Msg_t txMsg;

    StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_SNS); ///TODO: Change this to the actual class type
    StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER);
    txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_RFID; ///TODO: Change this to the actual module type
    txMsg.Header.ModuleId = sns_rfid_ID;
    txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_LIST;
    txMsg.Length = 6;

    uint32_t HwId=BIOS_GetHwId();
    txMsg.Data[0] = HwId&0xff;
    txMsg.Data[1] = (HwId>>8)&0xff;
    txMsg.Data[2] = (HwId>>16)&0xff;
    txMsg.Data[3] = (HwId>>24)&0xff;

    txMsg.Data[4] = NUMBER_OF_MODULES;
    txMsg.Data[5] = ModuleSequenceNumber;

    while (StdCan_Put(&txMsg) != StdCan_Ret_OK);
}