On Sep 15, 2016 3:42 PM, "Thiago Macieira" <thiago.macieira at intel.com>
wrote:
>
> On quinta-feira, 15 de setembro de 2016 12:04:20 PDT Gregg Reynolds wrote:
> > Hi list,
> >
> > I just spent about two days discovering that my code wasn't working
because
> > of this code in octypes.h, defn of OCDevAddr struct:
> >
> > #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
> >     char                    routeData[MAX_ADDR_STR_SIZE]; //destination
> > GatewayID:ClientId
> > #endif
> >
> > #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP) occurs in other
> > places but this one affects client code.
> >
> > 1.  Is it the case that one or the other of these macros must be
defined?
>
> Yes.
>
> > 2.  Since the build system defaults to ROUTING_EP, this kind of code
looks
> > like a bug.  Is it?
>
> Not sure what you mean. Why do you think it is a bug?

The problem I hit was that I did not define a ROUTING_X macro in my app
build (using makefiles).  (fwiw, why should I? bad doc!)  So my client code
and the stack code had different ideas about the size of OCDevAddr.

Since one of EP or GW must be defined, "#ifdef EP || GW" is an error, in my
view.  It should be sth like "#ifdef GW ... non-default  ... #else
...default ... ", no?

And actually if at least one must be defined why not just default to EP and
*allow* GW?  Is it legal to be both?
>
> All nodes must be routable, so disabling the functionality doesn't make
sense.

#ifdef EP || GW already disables by default.
>
> > 3.  It looks to me like client build code should not need to specify a
> > routing mode.  True?
>
> Yes and no. It shouldn't have to choose: it's an EP.
>

thanks,

gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160915/94f04649/attachment.html>

Reply via email to