No commit activity in last 3 years
No release in over 3 years
A cosmos read conversion designed to combine the bits of several uint fields.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

= 4.3
 Project Readme

Cosmos::MultiFieldBitConversion

A cosmos read conversion designed to combine the bits of several uint fields. Where values on the left are more significant, and values on the right are less significant. This conversaion will work with any number of uint fields, of any size.

Installation

Add this line to your application's Gemfile:

gem 'cosmos-multi_field_bit_conversion'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cosmos-multi_field_bit_conversion

Usage

In your telemetry definition file: config/targets/my-target/cmd_tlm/test.txt

TELEMETRY PI TEST LITTLE_ENDIAN "Test Aggregate Packet"
    APPEND_ID_ITEM TST_PK_ID 16 UINT 149 "Packet ID which must be 149"
    APPEND_ITEM    VALUE_A    8   UINT
    APPEND_ITEM    VALUE_B    8   UINT

    ITEM  HEAD_LENGTH  32  16  UINT

    APPEND_ITEM    VALUE_C    8   UINT
    APPEND_ITEM    VALUE_D    8   UINT
    ITEM BOTH_FIELDS 0 0 DERIVED "Description"
      READ_CONVERSION cosmos/multi_field_bit_conversion.rb VALUE_C VALUE_D 

    ## Both fields is essentially (VALUE_C << 8 | VALUE_D) 


In your target definition file config/targets/my-target/target.txt

REQUIRE cosmos/multi_field_bit_conversion.rb

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request