In 'peripheral_uart', where does the BLE Tx data go?

I am confused about where the data sen to the output of the 'peripheral_uart' (Tx) goes when one uses the Serial Terminal to type in text.  Eventually, I want to be able to send advertising data that my device receives to my iPhone and I thought that what was being sent could be seen in the Logger on my iPhone (in nRF Toolbox, UART Rx/Tx).  When I type something into the serial terminal I see that it makes it to my iPhone (it is in green text) followed by a "received" message.  But this, now I think, is just what is coming in (what the Rx would see).  Where is the Bluetooth Tx output?  In the end I want to send my advertising matches to the iPhone but for now I would be very pleased if I could do something simple like just repeating all data the Bluetooth receives three times for each character on the Tx that comes in the Rx (proving I have control of what is sent out based on what is coming in yet modified).  This software test seems like it ought to ne simple enough to write.  I was hoping the Logger tool on the iPhone would only show the output but that doesn't seem to be the case (it appears to show the input).

I apologize for my ignorance ahead of time but I seem to be misunderstanding something that should be simple.

Parents
  • There's nothing like answering your own question...

    I think I have it figured out.  The output goes to the Terminal (on the computer).  If I send text using a 'preset' value in the UART (from the nRF Toolbox on my iPhone) and scramble it up (just for a test) I can see the result on the Terminal on my computer.  When I type something on the Terminal, however, it doesn't get to the Bluetooth chip (not that I can tell).  It prints the unaltered value in green on the display.  I don't understand why things I enter on the terminal don't go the Bluetooth Rx input (or at least I never see them coming out on the terminal in 'non-green' form.

    Sheldon

  • Hello Sheldon,

    Thank you for the update. Yes, the Peripheral UART sample is configured to relay any data it receives on its UART RX input to the connected BLE device (your iPhone in this case). Similarly, it will output any data receives from the connected Bluetooth central to the UART TX output and the terminal.

    When I type something into the serial terminal I see that it makes it to my iPhone (it is in green text) followed by a "received" message.  But this, now I think, is just what is coming in (what the Rx would see).  Where is the Bluetooth Tx output?

    To send the data in the other direction (i..e, from the phone), you can create Create a preset in the nRF Toolbox app for the command you want to send as I have tried to show below.

    When pressing the '1' button in the above example, the text string "Hello" should be sent from the iPhone to the peripheral and then printed out on the serial terminal.

    Sheldon01 said:

    I enter on the terminal don't go the Bluetooth Rx input (or at least I never see them coming out on the terminal in 'non-green' form.

    Sheldon

    Are you referring to the log in the phone app?

    Best regards,

    Vidar

  • On my computer (using the Serial Terminal (v1.20)), when I type in something in the "Type and press enter to send" box and then hit return it only prints what I sent (in green on the terminal).  I don't think it ever makes it to my Bluetooth Rx input.  The only way I can see anything from the output of the Bluetooth (on the terminal in Windows) is to send a preset on my iPhone (like you described).  I would have thought a command I send from the Serial Terminal on my computer would do the same thing that I see when I send a Command (like your "Hello" from the iPhone) but it doesn't.

    At least have the one part working so and I can continue.  Now I just need to figure out how to send my data instead of a scrambled (done on purpose on the nRF chip) test message.

    Best regards,

    Sheldon

Reply
  • On my computer (using the Serial Terminal (v1.20)), when I type in something in the "Type and press enter to send" box and then hit return it only prints what I sent (in green on the terminal).  I don't think it ever makes it to my Bluetooth Rx input.  The only way I can see anything from the output of the Bluetooth (on the terminal in Windows) is to send a preset on my iPhone (like you described).  I would have thought a command I send from the Serial Terminal on my computer would do the same thing that I see when I send a Command (like your "Hello" from the iPhone) but it doesn't.

    At least have the one part working so and I can continue.  Now I just need to figure out how to send my data instead of a scrambled (done on purpose on the nRF chip) test message.

    Best regards,

    Sheldon

Children
Related