Which Transport to Use

The V2 SDK introduces a new UDP transport, but that's not to say you should stop using USSD.  The choice comes down to the types of network that your Thing needs to operate on, and in some cases the size of your payloads.

The diagram below explains the decision process:


The SDK includes a modem driver (implemented as a ThingstreamTransport instance) that supports both USSD and UDP communication.  This driver is used with a hardware specific modem configuration.

Each SDK includes examples which demonstrate how this can be easily incorporated into a sample application.

One such approach might be:

define a gsm buffer...

#define GSM_BUFFER_LENGTH 2000

static uint8_t gsmBuffer[GSM_BUFFER_LENGTH];

creating a ring or line buffer for callbacks as appropriate...


transport = Thingstream_createRingBufferTransport(transport,

                                                  gsmBuffer, GSM_BUFFER_LENGTH);


transport = Thingstream_createLineBufferTransport(transport,

                                                      gsmBuffer, GSM_BUFFER_LENGTH);

create the appropriate modem transport....


Define the modem buffer

 #define MODEM2_BUFFER_LENGTH 1100

 static uint8_t modemBuf[MODEM2_BUFFER_LENGTH];

When creating the transport remember to specify the initialisation routine for a particular UDP modem  in this case it's the U-blox Lara-R211 modem.

The full list of supported modem initialisers can be found within the API Documentation provided in the download bundle.

transport = Thingstream_createModem2Transport(transport, 0,  modemBuf, sizeof(modemBuf),  Thingstream_uBloxLaraR2Init, Platform_debug_printf);


transport = Thingstream_createModemUssdTransport(transport, 0);

Still need help?

If you need more help or have any questions, please send an email to services-support@u-blox.com.