diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-23 13:39:52 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2020-01-09 15:55:03 +0100 |
commit | 78e8a778786bf3f9050e55d99dd2b4338e8f4a8e (patch) | |
tree | 8dde7b0f50ea497f7a79ba60909570305328cb26 /libs/bitfield-c/src/canutil/write.h | |
parent | d76433ade0b75c8cc2b45fdae52a21d7fb28f526 (diff) |
bitfield-c: use unsigned int instead of uint8_t
Use unsigned int instead of uint8_t upon destination and source array length.
This is needed to handle gathered multi-frames message data which could
be greater than 1 simple messages.
Bug-AGL: SPEC-2988
Change-Id: I107bff383c2d0771dbc2a30770ec5c195b1c22ac
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'libs/bitfield-c/src/canutil/write.h')
-rw-r--r-- | libs/bitfield-c/src/canutil/write.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/bitfield-c/src/canutil/write.h b/libs/bitfield-c/src/canutil/write.h index c2bef20e..7f653b98 100644 --- a/libs/bitfield-c/src/canutil/write.h +++ b/libs/bitfield-c/src/canutil/write.h @@ -23,15 +23,15 @@ extern "C" { * * Returns a big-endian uint64_t with the value encoded as a bitfield. */ -uint64_t eightbyte_encode_float(float value, uint8_t bit_offset, - uint8_t bit_size, float factor, float offset); +uint64_t eightbyte_encode_float(float value, unsigned int bit_offset, + unsigned int bit_size, float factor, float offset); uint64_t float_to_fixed_point(const float value, const float factor, const float offset); -bool bitfield_encode_float(const float value, const uint8_t bit_offset, - const uint8_t bit_size, const float factor, const float offset, - uint8_t destination[], const uint8_t destination_length); +bool bitfield_encode_float(const float value, const unsigned int bit_offset, + const unsigned int bit_size, const float factor, const float offset, + uint8_t destination[], const unsigned int destination_length); /* Public: Encode a boolean into fixed bit width field in a bit array. * @@ -43,12 +43,12 @@ bool bitfield_encode_float(const float value, const uint8_t bit_offset, * * Returns a big-endian uint64_t with the value encoded as a bitfield. */ -uint64_t eightbyte_encode_bool(const bool value, const uint8_t bit_offset, - const uint8_t bit_size); +uint64_t eightbyte_encode_bool(const bool value, const unsigned int bit_offset, + const unsigned int bit_size); -bool bitfield_encode_bool(const bool value, const uint8_t bit_offset, const - uint8_t bit_size, uint8_t destination[], - const uint16_t destination_length); +bool bitfield_encode_bool(const bool value, const unsigned int bit_offset, const + unsigned int bit_size, uint8_t destination[], + const unsigned int destination_length); #ifdef __cplusplus } |