'Comunicate with printer

Put beforehand, I've never work or study anything like that, at my workplace they gave me this Printer and I need to find out a way to let it comunicate (and print) with my pc throught STM32cubeide and this nucleo

This is my main.c:

int main(void)
{
    uint8_t txData[30] = {0};
    uint8_t rxData[50] = {0};

  HAL_StatusTypeDef ret;

  HAL_Init();

  uint32_t tout_led = 0;

  MX_GPIO_Init();
  MX_USART2_UART_Init();
  MX_USART1_UART_Init();
  /* USER CODE BEGIN 2 */

    strcpy((char*)txData, "Hello World!");

    char ch = 'A';

    ret = HAL_UART_Transmit(&huart2, txData, 5, 30);
    ret = HAL_UART_Receive(&huart2, rxData, 3, 50);

    while (1)
    {
    }
}

Most of the code has beeen wrote by my collegues, but I know that I should wrote, to let it print on the printer, inside the parenthesis of strcpy((char*)txData, "Hello World!");

But I dont know how, I never studied anything like that and the only person here who figuried out how to do it change occupation.

It is the manual they gave me, but I dont know what to do with it -> Manual Or more precisely, I dont know how to apply what it's written in c language.

If someone could help me, even just how to move around, it will be very much appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source