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.

Quick question on SPP - Send all or send none

I'm trying to set up my application to communicate with iAP or PandoraLink via SPP. For these transports to work reliably, I need to be able to buffer either all of a packet or none of a packet (i.e. don't try to send any of it if there isn't room for all of it in the buffer). Is there a way I can check how much space is remaining in the outgoing buffer for sending SPP data, or cause it to discard data submitted to SPP_Data_Write if there is not enough space in the buffer for all of the requested bytes?

  • Hi,

    Please check SPP_Set_Queuing_Parameters() & SPP_Get_Queuing_Parameters() in the documentation.

    Regards,
    Gigi Joseph.
  • So if I do SPP_Set_Queuing_Parameters(id, 1, 0), will this mean that if I try to send another packet to a channel while a packet is already outstanding, the SPP_Data_Write will fail with result 0 (none of the packet will be buffered)?

    That's not a global queue limit, correct, it's per channel?

    It says it's for lower level data packets, I don't know how many lower level data packets I would typically end up splitting into (is that based on MTU?). Most of my messages being sent over the SPP are going to be in the dozens of bytes range, maybe a couple hundred bytes occasionally upon the initial connection. Most of the traffic is request/response where the following request waits for the response to the previous one, but sometimes there's some asynchronous request from the other side that I also have to respond to while sending my own requests.
  • Hi,

    Yes, it is per channel. Please see the documentation for more details:

    ***
    Specifically, these parameters are used to control aspects of the number of data packets that can be queued into the lower level (per individual channel).
    ***

    The fragmentation of the packets will be based on the MTU.

    Regards,
    Gigi Joseph.