5. Data structures dump function

The function smpp34_dumpPdu( ... ) takes four parameters and returns an integer value that describes the operation result. A value distinct of 0 (zero) means an error in the operation. There is a description in text mode of the error in the global variable smpp34_strerror.

extern int smpp34_errno;
extern char smpp34_strerror[2048];

int smpp34_dumpPdu( uint32_t type,      /* in  */
                    uint8_t *dest,      /* out */
                    int      size_dest, /* in  */
                    void    *tt         /* in  */ )
    
Where:

type: Is the PDU command_id that identifies the data structure. This value is directally related with a specific data structure.

dest: Is a buffer reference, where we will store the PDU dump. The memory must be reserved externally, it would be dynamic or static memory, but the function is not responsible of freeing it.

size_dest: This integer describes the lenght of the destination buffer (the previous parameter).

tt: This reference is a pointer to data structures listed in the introduction. This structure is identified by the first parameter.

5.1. An example

The Example 2 describes the use of this function.