How to send Hex byte array using UART?

Hi

     I use nRF7002-DK, SDK:V2.5.2 with zephyr driver, I need to send recieved data or command from uart, data type is using with hex byte array to send, from example, the tx_buf and rx_buf are sending as string, which API we need to instead for this for sending and recieving as hex byte array data type?

Best Regards

    Tina 

Parents Reply
  • Hi

         Thanks for your reply, for your information, I already use this sample code(academy example) to change tx buffer for send hex byte array, it's can't work.

    As below tx transmit code, it's use for string to transmit, it's can't work for hex byte array.

    static uint8_t tx_buf[] =   {"nRF Connect SDK Fundamentals Course\n\r"
                                 "Press 1-3 on your keyboard to toggle LEDS 1-3 on your development kit\n\r"};
    
    ret = uart_tx(uart, tx_buf, sizeof(tx_buf), SYS_FOREVER_MS);
    	if (ret) {
    		return 1;
    	}
    Best Regards

        Tina

Children
Related