This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1352P: BLE simple serial socket uart timeout

Part Number: CC1352P

I am using the simple serial socket examples available at:

I cannot find where the Uart receive timeout has been set. Seems to be set to an endless wait but (luckily) that's not the case.

Any hints?

  • Hi Giovanni, 

    Assigning an expert to comment. 

    Thanks, 
    Elin

  • Hi Giovanni,

    The uart read timeout is part of the UART_Params set in the init function of the simple serial socket examples. As you can see the read timeout is not explicitely set, so the default value is used. The default value is UART_WAIT_FOREVER. (You can set it to something else if you wish.)

    /*!
     *  @brief    UART Parameters
     *
     *  UART parameters are used with the UART_open() call. Default values for
     *  these parameters are set using UART_Params_init().
     *
     *  @sa       UART_Params_init()
     */
    typedef struct {
        UART_Mode       readMode;        /*!< Mode for all read calls */
        UART_Mode       writeMode;       /*!< Mode for all write calls */
        uint32_t        readTimeout;     /*!< Timeout for read calls in blocking mode. */
        uint32_t        writeTimeout;    /*!< Timeout for write calls in blocking mode. */
        UART_Callback   readCallback;    /*!< Pointer to read callback function for callback mode. */
        UART_Callback   writeCallback;   /*!< Pointer to write callback function for callback mode. */
        UART_ReturnMode readReturnMode;  /*!< Receive return mode */
        UART_DataMode   readDataMode;    /*!< Type of data being read */
        UART_DataMode   writeDataMode;   /*!< Type of data being written */
        UART_Echo       readEcho;        /*!< Echo received data back */
        uint32_t        baudRate;        /*!< Baud rate for UART */
        UART_LEN        dataLength;      /*!< Data length for UART */
        UART_STOP       stopBits;        /*!< Stop bits for UART */
        UART_PAR        parityType;      /*!< Parity bit type for UART */
        void           *custom;          /*!< Custom argument used by driver implementation */
    } UART_Params;

    For more info please see the UART driver documentation:

     

  • Hello Marie,

    that was also my understanding.

    What I was wondering about is "how" the application detects the end of an arbitrary, non-delimited UART transmission if the driver is set to WAIT_FOREVER

  • Hi Giovanni,

    It wont detect an end, it will just wait forever.

    As I said you can go ahead and change this if it's not suitable for your usecase.