Rev 530 | Rev 532 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 530 | Rev 531 | ||
---|---|---|---|
Line 432... | Line 432... | ||
432 | case 't': // request for the GPS time |
432 | case 't': // request for the GPS time |
433 | UART1_Request_SystemTime = TRUE; |
433 | UART1_Request_SystemTime = TRUE; |
434 | break; |
434 | break; |
Line 435... | Line 435... | ||
435 | 435 | ||
436 | case 'm': // request for the license string |
- | |
437 | if(UART_VersionInfo.HWMajor < 20) break; // this command is not supported on old Hardware -> they don't have an EEPROM |
436 | case 'm': // request for the license string |
438 | UART1_Request_LicenseString = SerialMsg.pData[0]; |
437 | UART1_Request_LicenseString = SerialMsg.pData[0]; |
439 | if(UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) |
438 | if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && (UART_VersionInfo.HWMajor >= 20)) |
440 | { |
439 | { |
441 | memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter |
440 | memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter |
442 | } |
441 | } |
443 | break; |
442 | break; |
Line 1114... | Line 1113... | ||
1114 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG)); |
1113 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG)); |
1115 | UART1_Request_ErrorMessage = FALSE; |
1114 | UART1_Request_ErrorMessage = FALSE; |
1116 | } |
1115 | } |
1117 | else if(UART1_Request_LicenseString && (UART1_tx_buffer.Locked == FALSE)) |
1116 | else if(UART1_Request_LicenseString && (UART1_tx_buffer.Locked == FALSE)) |
1118 | { |
1117 | { |
1119 | u8 result = 1; |
1118 | u8 result = 1, cmd = 0; |
1120 | if(UART1_Request_LicenseString == LIC_CMD_READ_LICENSE) |
1119 | if(UART1_Request_LicenseString == LIC_CMD_READ_LICENSE) |
1121 | { |
1120 | { |
1122 | result = LIC_CMD_READ_LICENSE; |
1121 | result = LIC_CMD_READ_LICENSE; |
1123 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
1122 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
1124 | } |
1123 | } |
1125 | else |
1124 | else |
1126 | if((UART1_Request_LicenseString == LIC_CMD_ERASE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
1125 | if((UART1_Request_LicenseString == LIC_CMD_ERASE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN) && (UART_VersionInfo.HWMajor >= 20)) |
1127 | { |
1126 | { |
1128 | result = LIC_CMD_ERASE_LICENSE; |
1127 | result = LIC_CMD_ERASE_LICENSE; |
1129 | DeleteLicenseInEEPROM(); |
1128 | DeleteLicenseInEEPROM(); |
1130 | CheckLicense(GET_LICENSE); |
1129 | CheckLicense(GET_LICENSE); |
1131 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1130 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1132 | } |
1131 | } |
1133 | else |
1132 | else |
1134 | if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
1133 | if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN) && (UART_VersionInfo.HWMajor >= 20)) |
1135 | { |
1134 | { |
- | 1135 | cmd = LIC_CMD_WRITE_LICENSE; |
|
1136 | if(CheckLicense(CHECK_ONLY)) //new license is okay |
1136 | if(CheckLicense(CHECK_ONLY)) //new license is okay |
1137 | { |
1137 | { |
1138 | WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL); |
1138 | WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL); |
1139 | result = 1; |
1139 | result = 1; |
1140 | } |
1140 | } |
1141 | else //new license is NOT okay |
1141 | else //new license is NOT okay |
1142 | { |
1142 | { |
1143 | ClearLicenseText(); |
1143 | ClearLicenseText(); |
- | 1144 | result = 0; |
|
1144 | result = CheckLicense(GET_LICENSE); // fetch a license if available |
1145 | CheckLicense(GET_LICENSE); // fetch a license if available |
1145 | } |
1146 | } |
1146 | //MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1147 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &cmd, 1,&result, 1 ); |
1147 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
- | |
1148 | } |
1148 | } |
1149 | UART1_Request_LicenseString = 0; |
1149 | UART1_Request_LicenseString = 0; |
1150 | } |
1150 | } |
1151 | #ifdef FOLLOW_ME |
1151 | #ifdef FOLLOW_ME |
1152 | else if(CheckDelay(UART1_FollowMe_Timer) && (UART1_tx_buffer.Locked == FALSE)) |
1152 | else if(CheckDelay(UART1_FollowMe_Timer) && (UART1_tx_buffer.Locked == FALSE)) |