mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
MSP_SET_NAME
This commit is contained in:
parent
1e4a0c72fc
commit
c04e6a4bd7
3 changed files with 10 additions and 0 deletions
|
@ -2505,6 +2505,9 @@ static void cliName(char *cmdline)
|
|||
cliPrintf("name %s\r\n", masterConfig.name);
|
||||
} else if (len <= MAX_NAME_LENGTH) {
|
||||
strcpy(masterConfig.name, cmdline);
|
||||
for (uint8_t i = len; i<MAX_NAME_LENGTH; i++) {
|
||||
masterConfig.name[i] = '\0';
|
||||
}
|
||||
cliPrintf("name %s\r\n", masterConfig.name);
|
||||
} else {
|
||||
cliPrintf("Max allowed name length is %d\r\n", MAX_NAME_LENGTH);
|
||||
|
|
|
@ -1875,6 +1875,12 @@ static bool processInCommand(void)
|
|||
masterConfig.baro_hardware = read8();
|
||||
masterConfig.mag_hardware = read8();
|
||||
break;
|
||||
|
||||
case MSP_SET_NAME:
|
||||
for (i = 0; i < MAX_NAME_LENGTH; i++) {
|
||||
masterConfig.name[i] = read8();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// we do not know how to handle the (valid) message, indicate error MSP $M!
|
||||
return false;
|
||||
|
|
|
@ -100,6 +100,7 @@ static const char * const boardIdentifier = TARGET_BOARD_IDENTIFIER;
|
|||
#define MSP_BUILD_INFO 5 //out message
|
||||
|
||||
#define MSP_NAME 10
|
||||
#define MSP_SET_NAME 11
|
||||
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue