Read and write Bluetooth communication byte format
Hi Community,
I'm studying about the android program and stm32f407vet based controller.
The question I asked before is almost clear by using DMA USART.
I'm Transmit and Receive like under code.
code(IN STM32)
uint8_t rxBuffer;
int SIZE_OF_RX_TX = 1;
if (huart->Instance == USART3)
{
HAL_UART_Transmit_DMA(&huart1, rxBuffer, SIZE_OF_RX_TX);
HAL_UART_Transmit_DMA(&huart3, rxBuffer, SIZE_OF_RX_TX);
HAL_UART_Receive_DMA(&huart1, rxBuffer, SIZE_OF_RX_TX);
HAL_UART_Receive_DMA(&huart3, rxBuffer, SIZE_OF_RX_TX);
}
it means that receive USART3(BLUETOOTH) and TRANSMIT USART1 and USART3
and make a interuupt USART1 and USART3.
but in Android bluetooth only send byte array
code(in ANDROID)
void sendData(String text)
{
outputStream.write(text.getBytes("UTF-8"));
}
when I debug android program, and when I send text "1",
byte result is '49'
but when I send it to bluetooth usart3, the value sometimes broken.
and wrong value is occured.
Q.
is there a way to convert byte data USART?
How can I? I really don't know... help...
