Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] MQTT-SN and MQTT embedded C client updates

Hi Roger,

there are two sorts of buffer. That supplied by the developer like payload, and those which are meant to be written to, or read from the network (typically parameters to socket read/write for MQTT). Void is probably the right type for the first - I'm not so sure about the second.

Ian

On 08/05/2014 04:20 PM, Roger Light wrote:
Hi Ian,

My view is that at the point the user (developer) provides it, the
payload is anonymous bytes of a particular length. We can then treat
is at as an array of chars. Easy for us and doesn't force unnecessary
casting on the developer.

Cheers,

Roger

On Mon, Aug 4, 2014 at 12:01 PM, Ian Craggs
<icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi Roger,

I used unsigned char* rather than void* for the payload/buffers as I thought
of them as byte arrays or similar, and to aid pointer arithmetic.  I'll
consider that one.


Ian

On 08/02/2014 08:05 PM, Roger Light wrote:
Hi Ian,

Packet ids have been changed to "unsigned short", and data buffers to
"unsigned char".  Now the data types are also consistent between the MQTT
and MQTT-SN libraries, which was another motivation.

I'm not expecting any further data type changes unless a good reason
appears.  I started using size_t for buffer sizes, but have stuck with
ints
to reduce dependencies on any headers - just in case some esoteric/old
embedded compiler didn't like size_t.
I'm inclined to agree with Frank - do it "properly" (use size_t) and
then fix the odd case where size_t isn't defined if it crops up.

I'm also of the opinion that "void *" is a better data type for the
data buffers - less hassle for the end developer - but that's probably
less important.

Cheers,

Roger
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

--
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Committer on Paho, Mosquitto

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

--
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Committer on Paho, Mosquitto



Back to the top