On sexta-feira, 16 de setembro de 2016 08:36:46 PDT Abhishek Sharma wrote: > > If I recall correctly, the Scons files always set one or the other. > > Yes scripts will always default to ROUTING_EP. > One problem that Greg faced could still occur when application will have its > own makefile / sconscript and choose not to define ROUTING_X. Since > octypes.h will be included in application source, it will result in > different definition of OCDevAddr in stack and application. I can make a > static assert in octypes.h to check that either of two should be available.
Ah, I understand now. Yes, indeed, this is a bug and should be fixed. The code should have: #if !defined(OC_ROUTING_EP) && !defined(OC_ROUTING_GW) # error One of OC_ROUTING_EP and OC_ROUTING_GW should be defined #endif Alternatively, we should drop the need for the EP #define and just assume everything is an endpoint, unless OC_ROUTING_GW is set. > This will enable any vendor to still try stand alone-mode (No EP and GW) > for debugging or local setup with a single SConscript change. If we choose > to modify code everywhere for ex: to check only GW and assume EP is there, > the flexibility mentioned above will be lost. As I argued when the feature came in: either it works for everyone without changes in their clients, or the feature is misdesigned. There's no such thing as "stand alone-mode". The latest Bridging spec does this by operating with virtual hosts. It's done by either opening multiple UDP ports on the server or by having the Uri-Host CoAP header indicate which host was intended. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
