David Gay wrote: > On 8/20/07, Ákos Maróy <[EMAIL PROTECTED]> wrote: >> I wonder if it would be better to have specificy types defined for these >> different purposes. that way, API usage would be more straightforward, >> as one would know right away what is contained in what type.. > > While I understand your concern, this scheme with multiple embedded > types follows the standard(*) scheme for a layered network stack: each > layer has a packet layout (aka type) which is embedded in the "data" > field of the packet layout of the layer below.
but, in such circumstances, all the layers have an aptly (and differently!) named structure. it's not like all OSI layers use the same data structure, packed one into another... > *: "standard" here does really mean "essentially the whole world does > it this way" (e.g., TCP/IP, but I can't think of a counterexample at > this point ;-)). well, TCP/IP does not define the whole stack. for example, ethernet packets transport TCP, UDP, etc. packets inside. but, all these structure have their corresponding names. no one assumes that an ethernet message structure would contain another strucutre of the same type... and also there's a reason for defining types in the first place, instead of just working with void pointers - type safety... Akos _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
