I declare a char SendDataCmd[256]
variable that will store commands sent from the computer to the microcontroller via UART
. The commands have different sizes such as RST, ADV ON e SET SNAME=BC118
among others.
I have a function that will send the commands, below.
#include "bc118.h"
#include "usart.h"
#include "main.h"
char SendDataCmd[256];
int BC118_Init()
{
SendDataCmd[] = "RST";//Linha que não funciona
HAL_UART_Transmit(&huart1, &SendDataCmd, 1, 100);
SendDataCmd[] = "ADV ON";//Linha que não funciona
HAL_UART_Transmit(&huart1, &SendDataCmd, 1, 100);
}
I'm having trouble storing the commands inside SendDataCmd
since they have different size than the declared vector, how could I store them correctly within that vector?