Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cosmos-multi_field_bit_conversion

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmos-multi_field_bit_conversion

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 20 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc