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.

Sending data in quick order causes disconnect

Other Parts Discussed in Thread: MSP430F5438A

Hi All,

We are using the MSP430F5438A and the PAN1326 chip on our product, when we are sending data using the SPP mode to a other bluetooth device (nexus smartphone) in quick order then we get a disconnect.

In the SPP callback (using the call back from the spp demo) we get a disconnect event (etPort_Close_Port_Indication). We call the SPP_Close_Port function to close the connection but the device is not discoverble antmore, when we remove the SPP_Close_Port function call then the device is discoverble but no connection to the RFCOMM server can be made anymore.

Also can anybody tell us what might happen when both partys are sending data at the same time? At the exact same time?

We use 9600 as HCI baudrate, and we set this after the initalisation (opening of stack and setting the device) This worked good so far, but could this be a problem?

Any suggestions and tips are welcome!

  • Hi,

    Moving it to SSO team for precise answer

  • Hi,

    We will try to reproduce this from our side, but can you tell us about how your mechanism for sending data? For sending data we advise, 

    If SPP_Data_Write returns a value less than what you are trying to write, that means the outgoing path is full and the application should wait to write until more buffers are available. The stack will indicate that more space is available using the etPort_Buffer_Empty_Indication event in the SPP callback. Once you receive this event, you can send more data. The user will have to take care to send any unsent bytes in the previous call by using the return code of SPP_Data_Write. For reference the look at the CBSend command on the SPPLE Demo (Send on the SPP Demo).

    Also, if both devices are sending data at the same time there should not be any issues. You should get and receive data on both sides.

    Thanks,

    Stonestreet One.