|
#include "include.h"
|
|
|
|
uint8 ger_ui8_actual_level = 0;
|
|
uint8 ger_ui8_dtr = 0;
|
|
uint8 ger_ui8_dtr1 = 0;
|
|
uint8 ger_ui8_dtr2 = 0;
|
|
uint32 ger_ui32_long_address = 0;
|
|
static bool NO_TEXT = false;
|
|
|
|
void Ger_PrintYesOrNo(DaliMessageStruct* p_s_message)
|
|
{
|
|
printf(": ");
|
|
|
|
if (p_s_message->b_Any_Answer)
|
|
{
|
|
printf(GER_TXT_YES);
|
|
}
|
|
else
|
|
{
|
|
printf(GER_TXT_NO);
|
|
}
|
|
}
|
|
|
|
bool Ger_b_MessageIsBroadcast(DaliMessageStruct* p_s_message)
|
|
{
|
|
if ((p_s_message->ui8_Address & 0x00FE) == 0x00FE)
|
|
{
|
|
if (NO_TEXT)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
printf(GER_TXT_ALL);
|
|
printf(" : ");
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool Ger_b_MessageIsShortAddressed(DaliMessageStruct* p_s_message)
|
|
{
|
|
if ((p_s_message->ui8_Address & 0x80) == 0x00)
|
|
{
|
|
if (NO_TEXT)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
printf(GER_TXT_DEVICE);
|
|
printf("%-3d: ", ui16_ExtractShortAddress(p_s_message->ui8_Address, p_s_message->ui8_Ext_Address));
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool Ger_b_MessageIsGroupAddressed(DaliMessageStruct* p_s_message)
|
|
{
|
|
uint8 ui8_group_address;
|
|
|
|
if ((p_s_message->ui8_Address & 0xE0) == 0x80)
|
|
{
|
|
if (NO_TEXT)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
ui8_group_address = p_s_message->ui8_Address >> 1;
|
|
ui8_group_address &= 0x0F;
|
|
printf(GER_TXT_UI8_CCB_GROUP);
|
|
printf(" %-2d: ", ui8_group_address);
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool Ger_b_MessageCommandIsDirectArcControl(DaliMessageStruct* p_s_message)
|
|
{
|
|
if ((p_s_message->ui8_Address & 0x01) == 0x0000)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool Ger_b_AnswerIsAvailable(DaliMessageStruct* p_s_message)
|
|
{
|
|
if (p_s_message->b_Answer_Available == false)
|
|
{
|
|
printf(GER_TXT_NO_ANSWER);
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
void Ger_PrintSearchMask(DaliMessageStruct* p_s_message, SearchMaskTypeEnum e_type)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_264_266);
|
|
|
|
switch (e_type)
|
|
{
|
|
case SEARCH_MASK_HIGH: printf(GER_TXT_DALI_CMD_264); break;
|
|
|
|
case SEARCH_MASK_MIDDLE: printf(GER_TXT_DALI_CMD_265); break;
|
|
|
|
case SEARCH_MASK_LOW: printf(GER_TXT_DALI_CMD_266); break;
|
|
}
|
|
|
|
printf(" = 0x%02X", p_s_message->ui8_Command);
|
|
|
|
switch (e_type)
|
|
{
|
|
case SEARCH_MASK_HIGH:
|
|
ger_ui32_long_address &= 0x00FFFF;
|
|
ger_ui32_long_address += ((uint32)p_s_message->ui8_Command << 16);
|
|
break;
|
|
|
|
case SEARCH_MASK_MIDDLE:
|
|
ger_ui32_long_address &= 0xFF00FF;
|
|
ger_ui32_long_address += ((uint32)p_s_message->ui8_Command << 8);
|
|
break;
|
|
|
|
case SEARCH_MASK_LOW:
|
|
ger_ui32_long_address &= 0xFFFF00;
|
|
ger_ui32_long_address += p_s_message->ui8_Command;
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Ger_PrintSpecialInstruction(DaliMessageStruct* p_s_message)
|
|
{
|
|
switch (p_s_message->ui8_Address)
|
|
{
|
|
case 161: printf(GER_TXT_DALI_CMD_256); break;
|
|
|
|
case 163:
|
|
ger_ui8_dtr = p_s_message->ui8_Command;
|
|
printf("DTR = %d", ger_ui8_dtr);
|
|
break;
|
|
|
|
case 165: printf(GER_TXT_DALI_CMD_258); break;
|
|
|
|
case 167: if (ui8_switch_state == SWITCH_SETTING_DALI)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_259);
|
|
}
|
|
else
|
|
{
|
|
printf(GER_TXT_DALI_CMD_259_CGLINE);
|
|
}
|
|
|
|
printf(": 0x%02X%02X%02X", (uint8)((ger_ui32_long_address >> 16) & 0xff), (uint8)((ger_ui32_long_address >> 8) & 0xff), (uint8)(ger_ui32_long_address & 0xff)); break;
|
|
|
|
case 169: printf(GER_TXT_DALI_CMD_260); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 171: printf(GER_TXT_DALI_CMD_261); break;
|
|
|
|
// 173-175: reserved
|
|
case 177: Ger_PrintSearchMask(p_s_message, SEARCH_MASK_HIGH); break;
|
|
|
|
case 179: Ger_PrintSearchMask(p_s_message, SEARCH_MASK_MIDDLE); break;
|
|
|
|
case 181: Ger_PrintSearchMask(p_s_message, SEARCH_MASK_LOW); break;
|
|
|
|
case 183: printf(GER_TXT_DALI_CMD_267); printf(" %d", ((uint16)p_s_message->ui8_Ext_Address << 7) + ((p_s_message->ui8_Command >> 1) & 0x7F)); break;
|
|
|
|
case 185: printf(GER_TXT_DALI_CMD_268); printf(" %d", ((uint16)p_s_message->ui8_Ext_Address << 7) + ((p_s_message->ui8_Command >> 1) & 0x7F)); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 187: printf(GER_TXT_DALI_CMD_269);
|
|
|
|
if (p_s_message->ui8_Command == 1)
|
|
{
|
|
printf(":Bit8,7 0x%02X", p_s_message->ui8_Answer & 0x03);
|
|
}
|
|
else
|
|
{
|
|
printf(":Bit6-0 0x%02X", p_s_message->ui8_Answer & 0x7F);
|
|
}
|
|
|
|
break;
|
|
|
|
case 189: printf(GER_TXT_DALI_CMD_270); break;
|
|
|
|
// 191: reserved
|
|
case 193: printf(GER_TXT_DALI_CMD_272); printf(" %d", p_s_message->ui8_Command); break;
|
|
|
|
case 195:
|
|
// if (ui8_switch_state == SWITCH_SETTING_DALI)
|
|
{
|
|
ger_ui8_dtr1 = p_s_message->ui8_Command;
|
|
printf("DTR1 = %d", ger_ui8_dtr1);
|
|
}
|
|
//else if (ui8_switch_state == SWITCH_SETTING_CGLINE)
|
|
//{
|
|
//printf("EMPFANGE LEUCHTENNAME: %c", p_s_message->ui8_command);
|
|
//}
|
|
break;
|
|
|
|
case 197:
|
|
ger_ui8_dtr2 = p_s_message->ui8_Command;
|
|
printf("DTR2 = %d", ger_ui8_dtr2);
|
|
break;
|
|
|
|
case 199:
|
|
if (ui8_switch_state == SWITCH_SETTING_DALI)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_275);
|
|
printf(" (BANK%d, ADRESSE 0x%02X = 0x%02X)", ger_ui8_dtr1, ger_ui8_dtr, p_s_message->ui8_Command);
|
|
ger_ui8_dtr++;
|
|
}
|
|
else if (ui8_switch_state == SWITCH_SETTING_CGLINE)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_032);
|
|
}
|
|
|
|
break;
|
|
|
|
case 225: //400
|
|
if (p_s_message->ui8_Ext_Address & 0x02)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_400);
|
|
|
|
if (p_s_message->ui8_Command > 253)
|
|
{
|
|
printf(" ALL ", p_s_message->ui8_Command);
|
|
}
|
|
else
|
|
{
|
|
printf(" %u ", p_s_message->ui8_Command);
|
|
}
|
|
|
|
Ger_PrintYesOrNo(p_s_message);
|
|
}
|
|
|
|
break;
|
|
|
|
case 227: //401
|
|
if (p_s_message->ui8_Ext_Address & 0x02)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_401);
|
|
printf(" - ");
|
|
|
|
switch (p_s_message->ui8_Command)
|
|
{
|
|
case 0: printf("RESET TEST TIME"); break;
|
|
|
|
case 1: printf("POSTPONE 24H NEXT TEST"); break;
|
|
|
|
case 16: printf("BAES of BAEH - REST MODE"); break;
|
|
|
|
case 17: printf("BAES of BAEH - EMERGENCY MODE"); break;
|
|
|
|
case 32: printf("ACTIVATE DBR FUNCTION"); break;
|
|
|
|
case 33: printf("DESACTIVATE DBR FUNCTION"); break;
|
|
|
|
case 34: printf("FIRE ALARM IN PROGRESS"); break;
|
|
|
|
case 35: printf("DBR SYNCHRONIZATION"); break;
|
|
|
|
case 36: printf("DBR LIFE FRAME"); break;
|
|
|
|
case 37: printf("DBR - ACTIVE FLASH MODE"); break;
|
|
|
|
case 38: printf("SUSPEND DBR"); break;
|
|
|
|
case 39: printf("SET DBR IN REST MODE"); break;
|
|
|
|
case 40: printf("SET DBR IN EMERGENCY MODE"); break;
|
|
|
|
default: break;
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
case 229: //402
|
|
if (p_s_message->ui8_Ext_Address & 0x02)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_402);
|
|
}
|
|
|
|
break;
|
|
|
|
case 231: //403
|
|
if (p_s_message->ui8_Ext_Address & 0x02)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_403);
|
|
}
|
|
|
|
break;
|
|
|
|
// 201 - x: reserved
|
|
|
|
default:
|
|
printf(GER_TXT_DALI_CMD_UNKNOWN);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Ger_PrintAnswer(DaliMessageStruct* p_s_message)
|
|
{
|
|
if (p_s_message->b_Answer_Available == true)
|
|
{
|
|
printf(": %d", p_s_message->ui8_Answer);
|
|
}
|
|
else
|
|
{
|
|
printf(": ");
|
|
printf(GER_TXT_NO_ANSWER);
|
|
}
|
|
}
|
|
|
|
void Ger_PrintGroups(DaliMessageStruct* p_s_message, uint8 ui8_offset)
|
|
{
|
|
uint8 ui8_counter;
|
|
uint8 ui8_groups;
|
|
printf(": ");
|
|
|
|
if (Ger_b_AnswerIsAvailable(p_s_message) == false)
|
|
{
|
|
return;
|
|
}
|
|
|
|
ui8_groups = p_s_message->ui8_Answer;
|
|
|
|
if (ui8_groups != 0)
|
|
{
|
|
for (ui8_counter = 0; ui8_counter < 8; ui8_counter++)
|
|
{
|
|
if (ui8_groups & 0x01)
|
|
{
|
|
printf("%d", ui8_counter + ui8_offset);
|
|
}
|
|
|
|
ui8_groups >>= 1;
|
|
|
|
if (ui8_groups != 0)
|
|
{
|
|
printf(", ");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
printf(GER_TXT_GROUP_NON);
|
|
}
|
|
}
|
|
|
|
void Ger_PrintValueWithUnit(UnitTypeEnum e_value_type, uint16 ui16_value)
|
|
{
|
|
printf(": %d", ui16_value);
|
|
|
|
if (e_value_type != UNIT_RAW)
|
|
{
|
|
printf(" (=");
|
|
|
|
switch (e_value_type)
|
|
{
|
|
case UNIT_LAMP_LEVEL: break;
|
|
|
|
case UNIT_HALF_MINUTES:
|
|
printf("%u,&u", (ui16_value / 2), ((ui16_value * 10) % 2));
|
|
break;
|
|
|
|
case UNIT_15_MINUTES:
|
|
printf("%u", (ui16_value * 15));
|
|
break;
|
|
|
|
case UNIT_DAY: case UNIT_WEEK: case UNIT_MINUTE: case UNIT_HOUR:
|
|
case UNIT_VOLT: case UNIT_AMPERE: case UNIT_PERCENT: case UNIT_DEGREE_CELSIUS:
|
|
case UNIT_RPM:
|
|
printf("%u", ui16_value);
|
|
break;
|
|
}
|
|
|
|
printf(" ");
|
|
|
|
switch (e_value_type)
|
|
{
|
|
case UNIT_LAMP_LEVEL: break;
|
|
|
|
case UNIT_15_MINUTES: printf("Minuten"); break;
|
|
|
|
case UNIT_HALF_MINUTES: case UNIT_MINUTE: printf("Minute"); break;
|
|
|
|
case UNIT_DAY: printf("Tag"); break;
|
|
|
|
case UNIT_WEEK: printf("Woche"); break;
|
|
|
|
case UNIT_HOUR: printf("Stunde"); break;
|
|
|
|
case UNIT_VOLT: printf("Volt"); break;
|
|
|
|
case UNIT_AMPERE: printf("Ampere"); break;
|
|
|
|
case UNIT_PERCENT: printf("%"); break;
|
|
|
|
case UNIT_DEGREE_CELSIUS: printf("?C"); break;
|
|
|
|
case UNIT_RPM: printf("U/min"); break;
|
|
}
|
|
|
|
if (ui16_value != 1)
|
|
{
|
|
switch (e_value_type)
|
|
{
|
|
case UNIT_HALF_MINUTES: if (ui16_value != 2)
|
|
{
|
|
printf("n");
|
|
} break;
|
|
|
|
case UNIT_WEEK: case UNIT_HOUR: case UNIT_MINUTE: printf("n"); break;
|
|
|
|
case UNIT_DAY: printf("e"); break;
|
|
}
|
|
}
|
|
|
|
printf(")");
|
|
}
|
|
}
|
|
|
|
void Ger_PrintFadeTimeAndRate(DaliMessageStruct* p_s_message)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_165);
|
|
printf(": ");
|
|
|
|
if (Ger_b_AnswerIsAvailable(p_s_message) == true)
|
|
{
|
|
printf("%d / %d", p_s_message->ui8_Answer >> 4, p_s_message->ui8_Answer & 0x0F);
|
|
}
|
|
else
|
|
{
|
|
//"NO ANSWER"
|
|
}
|
|
}
|
|
|
|
void Ger_PrintEmergencyMode(DaliMessageStruct* p_s_message)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_250);
|
|
printf(": ");
|
|
|
|
if (Ger_b_AnswerIsAvailable(p_s_message) == true)
|
|
{
|
|
if (p_s_message->ui8_Answer & 0x01)
|
|
{
|
|
printf("REST_MODE ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x02)
|
|
{
|
|
printf("STANDBY_MODE ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x04)
|
|
{
|
|
printf("OPERATION_MODE ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x08)
|
|
{
|
|
printf("EXTENDED_OPERATION_MODE");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x10)
|
|
{
|
|
printf("FT ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x20)
|
|
{
|
|
printf("DT ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x40)
|
|
{
|
|
printf("INHIBIT ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x80)
|
|
{
|
|
printf("POWER_ON ");
|
|
}
|
|
}
|
|
}
|
|
|
|
void Ger_PrintFeatures(DaliMessageStruct* p_s_message)
|
|
{
|
|
printf(GER_TXT_DALI_CMD_251);
|
|
|
|
if (Ger_b_AnswerIsAvailable(p_s_message) == true)
|
|
{
|
|
printf(" :0x%02X", p_s_message->ui8_Answer);
|
|
//QUERY FEATURES
|
|
//bit 0 integrated emergency device; ?0? = No
|
|
//bit 1 maintained device; ?0? = No
|
|
//bit 2 mixed mode maintained; ?0? = No
|
|
//bit 3 auto test capability; ?0? = No
|
|
//bit 4 adjustable emergency level; ?0? = No
|
|
//bit 5 reserved; ?0? = default value
|
|
//bit 6 reserved; ?0? = default value
|
|
//bit 7 reserved; ?0? = default value
|
|
}
|
|
}
|
|
|
|
uint8 Ger_PrintNormalInstruction(DaliMessageStruct* p_s_message)
|
|
{
|
|
uint8 ui8_counter = 0;
|
|
|
|
switch (p_s_message->ui8_Command)
|
|
{
|
|
case 0: printf(GER_TXT_DALI_CMD_000); break;
|
|
|
|
case 1: printf(GER_TXT_DALI_CMD_001); break;
|
|
|
|
case 2: printf(GER_TXT_DALI_CMD_002); break;
|
|
|
|
case 3: printf(GER_TXT_DALI_CMD_003); break;
|
|
|
|
case 4: printf(GER_TXT_DALI_CMD_004); break;
|
|
|
|
case 5: printf(GER_TXT_DALI_CMD_005); break;
|
|
|
|
case 6: printf(GER_TXT_DALI_CMD_006); break;
|
|
|
|
case 7: printf(GER_TXT_DALI_CMD_007); break;
|
|
|
|
case 8: printf(GER_TXT_DALI_CMD_008); break;
|
|
|
|
case 9: printf(GER_TXT_DALI_CMD_009); break;
|
|
|
|
// 10-15: reserved
|
|
case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
|
|
case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
|
|
printf(GER_TXT_DALI_CMD_016_031);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, p_s_message->ui8_Command & 0x0F);
|
|
break;
|
|
|
|
case 32: printf(GER_TXT_DALI_CMD_032); break;
|
|
|
|
case 33:
|
|
ger_ui8_dtr = ger_ui8_actual_level;
|
|
printf(GER_TXT_DALI_CMD_033);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, ger_ui8_dtr);
|
|
break;
|
|
|
|
// 34-41: reserved
|
|
case 42: printf(GER_TXT_DALI_CMD_042); break;
|
|
|
|
case 43: printf(GER_TXT_DALI_CMD_043); break;
|
|
|
|
case 44: printf(GER_TXT_DALI_CMD_044); break;
|
|
|
|
case 45: printf(GER_TXT_DALI_CMD_045); break;
|
|
|
|
case 46: printf(GER_TXT_DALI_CMD_046); break;
|
|
|
|
case 47: printf(GER_TXT_DALI_CMD_047); break;
|
|
|
|
// 48-63: reserved
|
|
case 64: case 65: case 66: case 67: case 68: case 69: case 70: case 71:
|
|
case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79:
|
|
printf(GER_TXT_DALI_CMD_064_079);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, p_s_message->ui8_Command & 0x0F);
|
|
break;
|
|
|
|
case 80: case 81: case 82: case 83: case 84: case 85: case 86: case 87:
|
|
case 88: case 89: case 90: case 91: case 92: case 93: case 94: case 95:
|
|
printf(GER_TXT_DALI_CMD_080_095);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, p_s_message->ui8_Command & 0x0F);
|
|
break;
|
|
|
|
case 96: case 97: case 98: case 99: case 100: case 101: case 102: case 103:
|
|
case 104: case 105: case 106: case 107: case 108: case 109: case 110: case 111:
|
|
printf(GER_TXT_DALI_CMD_096_111);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, (p_s_message->ui8_Command & 0x0F));
|
|
break;
|
|
|
|
case 112: case 113: case 114: case 115: case 116: case 117: case 118: case 119:
|
|
case 120: case 121: case 122: case 123: case 124: case 125: case 126: case 127:
|
|
printf(GER_TXT_DALI_CMD_112_127);
|
|
Ger_PrintValueWithUnit(UNIT_RAW, (p_s_message->ui8_Command & 0x0F));
|
|
break;
|
|
|
|
case 128: printf(GER_TXT_DALI_CMD_128); break;
|
|
|
|
case 129: printf(GER_TXT_DALI_CMD_129); break;
|
|
|
|
// 130-143: reserved
|
|
case 144: printf(GER_TXT_DALI_CMD_144); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 145: printf(GER_TXT_DALI_CMD_145); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 146: printf(GER_TXT_DALI_CMD_146); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 147: printf(GER_TXT_DALI_CMD_147); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 148: printf(GER_TXT_DALI_CMD_148); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 149: printf(GER_TXT_DALI_CMD_149); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 150: printf(GER_TXT_DALI_CMD_150); Ger_PrintYesOrNo(p_s_message); break;
|
|
|
|
case 151: printf(GER_TXT_DALI_CMD_151); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 152: printf(GER_TXT_DALI_CMD_152); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 153: printf(GER_TXT_DALI_CMD_153); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 154: printf(GER_TXT_DALI_CMD_154); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 155: printf(GER_TXT_DALI_CMD_155); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 156: printf(GER_TXT_DALI_CMD_156); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 157: printf(GER_TXT_DALI_CMD_157); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
// 158-159: reserved
|
|
case 160: printf(GER_TXT_DALI_CMD_160); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 161: printf(GER_TXT_DALI_CMD_161); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 162: printf(GER_TXT_DALI_CMD_162); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 163: printf(GER_TXT_DALI_CMD_163); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 164: printf(GER_TXT_DALI_CMD_164); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 165: Ger_PrintFadeTimeAndRate(p_s_message); break;
|
|
|
|
// 166-175: reserved
|
|
case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183:
|
|
case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191:
|
|
printf(GER_TXT_DALI_CMD_176_191); printf(" %d", p_s_message->ui8_Command & 0x0F); Ger_PrintAnswer(p_s_message);
|
|
break;
|
|
|
|
case 192: printf(GER_TXT_DALI_CMD_192); Ger_PrintGroups(p_s_message, 0); break;
|
|
|
|
case 193: printf(GER_TXT_DALI_CMD_193); Ger_PrintGroups(p_s_message, 8); break;
|
|
|
|
case 194: printf(GER_TXT_DALI_CMD_194); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 195: printf(GER_TXT_DALI_CMD_195); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 196: printf(GER_TXT_DALI_CMD_196); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 197: printf(GER_TXT_DALI_CMD_197); Ger_PrintAnswer(p_s_message); break;
|
|
|
|
// 198-223: reserved
|
|
case 224: printf(GER_TXT_DALI_CMD_224); break;
|
|
|
|
case 225: printf(GER_TXT_DALI_CMD_225); break;
|
|
|
|
case 226: printf(GER_TXT_DALI_CMD_226); break;
|
|
|
|
case 227: printf(GER_TXT_DALI_CMD_227); break;
|
|
|
|
case 228: printf(GER_TXT_DALI_CMD_228); break;
|
|
|
|
case 229: printf(GER_TXT_DALI_CMD_229); break;
|
|
|
|
case 230: printf(GER_TXT_DALI_CMD_230); break;
|
|
|
|
case 231: printf(GER_TXT_DALI_CMD_231); break;
|
|
|
|
case 232: printf(GER_TXT_DALI_CMD_232); break;
|
|
|
|
case 233: printf(GER_TXT_DALI_CMD_233); break;
|
|
|
|
case 234: printf(GER_TXT_DALI_CMD_234); Ger_PrintValueWithUnit(UNIT_15_MINUTES, ger_ui8_dtr); break;
|
|
|
|
case 235: printf(GER_TXT_DALI_CMD_235); Ger_PrintValueWithUnit(UNIT_15_MINUTES, ger_ui8_dtr); break;
|
|
|
|
case 236: printf(GER_TXT_DALI_CMD_236); Ger_PrintValueWithUnit(UNIT_DAY, ger_ui8_dtr); break;
|
|
|
|
case 237: printf(GER_TXT_DALI_CMD_237); Ger_PrintValueWithUnit(UNIT_WEEK, ger_ui8_dtr); break;
|
|
|
|
case 238: printf(GER_TXT_DALI_CMD_238); Ger_PrintValueWithUnit(UNIT_DAY, ger_ui8_dtr); break;
|
|
|
|
case 239: printf(GER_TXT_DALI_CMD_239); Ger_PrintValueWithUnit(UNIT_HALF_MINUTES, ger_ui8_dtr); break;
|
|
|
|
case 241: printf(GER_TXT_DALI_CMD_241), Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 242: printf(GER_TXT_DALI_CMD_242), Ger_PrintAnswer(p_s_message); break;
|
|
|
|
case 243: printf(GER_TXT_DALI_CMD_243); printf(" %dmin", (uint16)p_s_message->ui8_Answer * 2); break;
|
|
|
|
case 244: printf(GER_TXT_DALI_CMD_244); printf(" %dh", p_s_message->ui8_Answer); break;
|
|
|
|
case 245: printf(GER_TXT_DALI_CMD_243); printf(" %dh", p_s_message->ui8_Answer * 4); break;
|
|
|
|
case 246: printf(GER_TXT_DALI_CMD_246); printf(" %d", p_s_message->ui8_Answer); break;
|
|
|
|
case 247: printf(GER_TXT_DALI_CMD_247); printf(" %d", p_s_message->ui8_Answer); break;
|
|
|
|
case 248: printf(GER_TXT_DALI_CMD_248); printf(" %d", p_s_message->ui8_Answer); break;
|
|
|
|
case 249: printf(GER_TXT_DALI_CMD_249); printf(" %dh", p_s_message->ui8_Answer / 30); break;
|
|
|
|
case 250: Ger_PrintEmergencyMode(p_s_message); break;
|
|
|
|
case 251: Ger_PrintFeatures(p_s_message); break;
|
|
|
|
case 252: //QUERY FAILURE STATUS // INTERROGATION DU STATUT FAILURE ( etat de d?faillance)
|
|
printf(GER_TXT_DALI_CMD_252);
|
|
printf(" ");
|
|
|
|
if (!p_s_message->ui8_Answer)
|
|
{
|
|
printf("OK");
|
|
}
|
|
else
|
|
{
|
|
if (p_s_message->ui8_Answer & 0x01)
|
|
{
|
|
printf("E_COM_FAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x02)
|
|
{
|
|
printf("BATT_FAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x04)
|
|
{
|
|
printf("CHARGEFAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x08)
|
|
{
|
|
printf("LAMP_FAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x10)
|
|
{
|
|
printf("FT_DELAYFAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x20)
|
|
{
|
|
printf("BT_DELAYFAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x40)
|
|
{
|
|
printf("FT_FAIL ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x80)
|
|
{
|
|
printf("BT_FAIL ");
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
case 253: //QUERY EMERGENCY LIGHT STATUS //INTERROGATION DE L?ETAT D?URGENCE
|
|
printf(GER_TXT_DALI_CMD_253);
|
|
printf(" ");
|
|
|
|
if (p_s_message->ui8_Answer & 0x01)
|
|
{
|
|
printf("INHIBIT ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x02)
|
|
{
|
|
printf("FT_DONE ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x04)
|
|
{
|
|
printf("BT_DONE ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x08)
|
|
{
|
|
printf("CHARGE_OK ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x10)
|
|
{
|
|
printf("FT_REQUEST ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x20)
|
|
{
|
|
printf("BT_REQUEST ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x40)
|
|
{
|
|
printf("CC-FLAG_SET ");
|
|
}
|
|
|
|
if (p_s_message->ui8_Answer & 0x80)
|
|
{
|
|
printf("SELECTED ");
|
|
}
|
|
|
|
break;
|
|
|
|
case 255: //EQUERY EXTENDED VERSION NUMBER //Interrogation numero de version ?tendue
|
|
printf(GER_TXT_DALI_CMD_255);
|
|
printf("%d", p_s_message->ui8_Answer);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return ui8_counter;
|
|
}
|
|
|
|
void Ger_PrintDaliMessage(DaliMessageStruct* p_s_message)
|
|
{
|
|
uint8 ui8_ext_adress_bits = (((p_s_message->ui8_Ext_Address & 0x03) << 1)) + ((p_s_message->ui8_Ext_Address & 0x04) >> 2);
|
|
|
|
if (eep_time)
|
|
{
|
|
if (eep_time == SETTING_SDCARDONLY)
|
|
{
|
|
b_uart_on = false;
|
|
}
|
|
|
|
if (eep_time == SETTING_UARTONLY)
|
|
{
|
|
b_sdcard_on = false;
|
|
}
|
|
|
|
PrintTimestamp(p_s_message->s_Timestamp);
|
|
b_uart_on = true;
|
|
b_sdcard_on = true;
|
|
}
|
|
|
|
printf(GER_TXT_LINE);
|
|
printf(":%d ", p_s_message->ui8_Line_1or2);
|
|
NO_TEXT = true;
|
|
|
|
if (p_s_message->b_Any_Answer &&
|
|
((Ger_b_MessageIsBroadcast(p_s_message) || Ger_b_MessageIsShortAddressed(p_s_message) || Ger_b_MessageIsGroupAddressed(p_s_message)) && Ger_b_MessageCommandIsDirectArcControl(p_s_message) && p_s_message->ui8_Command >= 145 && p_s_message->ui8_Command <= 150) ||
|
|
(!(Ger_b_MessageIsBroadcast(p_s_message) || Ger_b_MessageIsShortAddressed(p_s_message) || Ger_b_MessageIsGroupAddressed(p_s_message)) && ((p_s_message->ui8_Address == 169) || (p_s_message->ui8_Address == 185) || ((p_s_message->ui8_Address == 225) && (p_s_message->ui8_Ext_Address & 0x02)))))
|
|
{
|
|
p_s_message->ui8_Answer = 255;
|
|
}
|
|
|
|
NO_TEXT = false;
|
|
printf("%03u|%01u|%03u|%03u -> ", p_s_message->ui8_Address, ui8_ext_adress_bits, p_s_message->ui8_Command, p_s_message->ui8_Answer);
|
|
|
|
if (p_s_message->ui8_Ext_Address == 255)
|
|
{
|
|
printf("BUS OFF");
|
|
return;
|
|
}
|
|
else if (p_s_message->ui8_Ext_Address == 254)
|
|
{
|
|
printf("BUS ON");
|
|
return;
|
|
}
|
|
else if (p_s_message->ui8_Ext_Address == 253)
|
|
{
|
|
printf("DSI-INSTR");
|
|
return;
|
|
}
|
|
|
|
if (Ger_b_MessageIsBroadcast(p_s_message) ||
|
|
Ger_b_MessageIsShortAddressed(p_s_message) ||
|
|
Ger_b_MessageIsGroupAddressed(p_s_message))
|
|
{
|
|
if (Ger_b_MessageCommandIsDirectArcControl(p_s_message))
|
|
{
|
|
// Direct lamp power level //Niveau de puissance direct de la lampe
|
|
ger_ui8_actual_level = p_s_message->ui8_Command;
|
|
printf(GER_TXT_DALI_CMD_DAPC); Ger_PrintValueWithUnit(UNIT_RAW, ger_ui8_actual_level);
|
|
}
|
|
else
|
|
{
|
|
// Normal commands //Ordre Normal
|
|
Ger_PrintNormalInstruction(p_s_message);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// Special commands//Ordre sp?cial
|
|
printf(GER_TXT_ALL);
|
|
printf(" : ");
|
|
Ger_PrintSpecialInstruction(p_s_message);
|
|
}
|
|
|
|
if (eep_temperature)
|
|
{
|
|
if (eep_temperature == SETTING_SDCARDONLY)
|
|
{
|
|
b_uart_on = false;
|
|
}
|
|
|
|
if (eep_temperature == SETTING_UARTONLY)
|
|
{
|
|
b_sdcard_on = false;
|
|
}
|
|
|
|
PrintTemperatureInCelsius();
|
|
b_uart_on = true;
|
|
b_sdcard_on = true;
|
|
}
|
|
|
|
printf("\r\n");
|
|
}
|