Part Number: BOOSTXL-CC3135
Other Parts Discussed in Thread: CC3135
Hi,
I am trying to evaluate the MQTT example that I found under this link:
simplelink_sdk_wifi_plugin_2_40_00_22\examples\rtos\MSP_EXP432E401Y\demos\mqtt_client,
In this example, I modified the mqtt_client_app source file in order to publish an MQTT message with different size.
I tried with size more than 1024 bytes, and then I understood that I must define a CFG_SL_CL_BUF_LEN user value,
so, I created a new definition of CFG_SL_CL_BUF_LEN with a value equal to 29000 and it seems that my change is correct, i.e.: I am able to publish buffer of 29KB.
Next, I have to enlarge this size more and more, and this to publish a message with a maximum size 40KB.
so I modified the CFG_SL_CL_BUF_LEN to 40000 , and then, when I try to publish my MQTT message, it returns a failure equal to SLNETERR_BSD_SOC_ERROR.
and when I debug the MQTT procedure, I found that this error appears in the sl_Send function, in this case : if(Len < 1) { /* ignore */ return(0); } ( sl_socket.c file, ligne 673).
Let me explain more, the Len variable is declared as _i16 and for sizes more than 0x7FFF, it becomes negative value.
I tried to cast this variable ( to _u16) before this check (if((_u16)Len < 1) ), and in this case, the function returns the sent size, declared also as _i16, and all of the MQTT procedure checks if it is negative.
So as long as I sent this "negative size" ( higher than 0x7FFF), the Mqtt publish function returns failure and it closes the MQTT communication.
So How Can I Publish MQTT messages with size more than 0x7FFF ?
In the SlNetIfWifi_send function defined in the slnetiwifi.c file, len variable is declared as uint32_t, in this case how can I send a message with size declared as uint32_t, knowing that sl_Send supports only _i16 ?
What is the maximum size supported in TCP socket layer ?
What is the maximum size supported in the MQTT client library ?
Best Regards.
Ghada