comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Bednikov" <Vladimir.Bednikov@ebor.com>
Subject: converting floats, ints byte arrays
Date: Thu, 12 Jul 2001 15:16:29 +0930
Date: 2001-07-12T05:54:12+00:00	[thread overview]
Message-ID: <9ije24$9kg$1@fang.dsto.defence.gov.au> (raw)

Hi all,

I have a bunch of values I want to send via tcp, instead of converting
each to a string and sending it out, I want to store all the values into
a byte array, ie:
type byte is mod 256;
type byte_array is array(integer range <>) of byte;

The values are for example,

sampleRate : C.C_Float;
scalingFactor : C.C_Float;
numSamples : C.Unsigned;
numSensors : C.Unsigned;
positionChanged : C.Unsigned_Char;
groupBySensors : C.Unsigned_Char;

What I want is an array where the first C.C_Float'size bytes is the sample
rate,
the next C.C_Float'size bytes is the scaling factor, the next
C.Unsigned'size bytes
is the number of samples etc and finally send the byte array out via tcp.

Does anybody out there know of a way to do this.

All help is appreciated,
Thanks in advance





             reply	other threads:[~2001-07-12  5:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-12  5:46 Vladimir Bednikov [this message]
2001-07-12  6:45 ` converting floats, ints byte arrays tmoran
2001-07-12 16:35 ` Jeffrey Carter
2001-07-13 11:34 ` David C. Hoos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox