This is a question about raw mode sample code.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
kiyu_2154206
Level 1
Level 1
5 replies posted First reply posted Welcome!

I saw you answered the following questions(https://community.cypress.com/thread/31902 ).

I have a similar problem.

Can I get a sample of your supplied fully raw mode sample code?

Thank you.

And one more thing: why did hci_raw_spp sample disappear from wiced studio 5.0 recently?

--------------------------------------------------------------------------------------------------------

https://community.cypress.com/thread/31902

-------------------------------------------------------------------------------------------------------

"For others viewing this thread, yes raw mode is supported by the usual transport APIs, but the RX handler must behave differently than the WICED_HCI RX handler (return bytes read instead of SUCCESS, and do not try to free transport buffer). A sample app will be included in future releases to demonstrate the steps necessary.

lye_2922526, We have already addressed your issue internally: I wrote a sample application that fully implements raw mode that was provided to you over email by your FAE. We plan to release this sample app into the SDK in future releases.

To answer (3): a watermark level triggers the callback."

0 Likes
1 Solution
Anonymous
Not applicable

I will try to give a skeleton of the code required to get raw HCI UART running.

1) Configure the wiced transport in RAW mode:

const wiced_transport_cfg_t transport_cfg =

{

    WICED_TRANSPORT_UART,

    {  WICED_TRANSPORT_UART_RAW_MODE, desired_baudrate},

    {  buffer_size, num_buffers},

    NULL,

    rx_callback,

    NULL

};

2) Initialize the wiced transport:

wiced_transport_init( &transport_cfg );

3) The callback:

uint32_t rx_callback( uint8_t *p_buffer, uint32_t length )

{

/* read the p_buffer or the rx data

   and perform necessary processing

   on the data.

   Length signifies the length of the

   data received.*/

  

   return length; // or the length of data you were able to process

}

4) In order to send data back to the host, use wiced_transport_send_data() or wiced_transport_send_buffer() APIs.

View solution in original post

0 Likes
4 Replies
kiyu_2154206
Level 1
Level 1
5 replies posted First reply posted Welcome!

Please, I want answers.

0 Likes
Anonymous
Not applicable

Kim,

What issues are you facing?

As stated, this example will be included in the SDK in future releases.

0 Likes

I am currently using hci raw spp mode.

But there are some problems.

So I want to check the sample code.

Can I check the sample code now?

0 Likes
Anonymous
Not applicable

I will try to give a skeleton of the code required to get raw HCI UART running.

1) Configure the wiced transport in RAW mode:

const wiced_transport_cfg_t transport_cfg =

{

    WICED_TRANSPORT_UART,

    {  WICED_TRANSPORT_UART_RAW_MODE, desired_baudrate},

    {  buffer_size, num_buffers},

    NULL,

    rx_callback,

    NULL

};

2) Initialize the wiced transport:

wiced_transport_init( &transport_cfg );

3) The callback:

uint32_t rx_callback( uint8_t *p_buffer, uint32_t length )

{

/* read the p_buffer or the rx data

   and perform necessary processing

   on the data.

   Length signifies the length of the

   data received.*/

  

   return length; // or the length of data you were able to process

}

4) In order to send data back to the host, use wiced_transport_send_data() or wiced_transport_send_buffer() APIs.

0 Likes