[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] pakke/udpakke data på bit niveau



[snip]
> Vil det sige at den er den *eksakt* samme data-struktur du anvender i 
> begge ender og arkitekturen er den samme?
> Hvis du kan svare ja til begge, så har du ingen problemer med din 
> 'proprietære protokol'.

Det er eksakt samme struktur (det er samme headerfil den er kreeret ud
fra) og arkitekturen er intel all the way. 


 
> Og lige for en god ordens skyld spurgte jeg ikke om der var padding,
> men hvor!

> Jeg vil antage at du arbejder med little-endian (Intel family) og at
> du har 29 padding bits efter dine første tre bit.
> 
> Hvis du nu skal bruge bit-værdierne som bolske værdier, så ville jeg
> nok anvende en struktur ala:
> 
> #include <stdbool.h>
> struct type 1{
>    _Bool bit1:1;
>    _Bool bit2:1;
>    _Bool bit3:1;
>    /* Her kommer 32 - 3 = 29 padding bits ;-) */
>    int ordrenr;
>    ...etc...
>    }
> 
> Hvis du skal overføre data mellem heterogene systemer, så kræver det
> som nævnt en hel del mere!


jeg tror måske at løsningen bliver at jeg bruger en integer i stedet for
3 bit som første element. Det var blot for at spare lidt der. 


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:10 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *