Coder Social home page Coder Social logo

4D: VCU Simulation Mode about vcu-fw HOT 2 CLOSED

kkramer215 avatar kkramer215 commented on September 13, 2024
4D: VCU Simulation Mode

from vcu-fw.

Comments (2)

rafguevara14 avatar rafguevara14 commented on September 13, 2024

Need to test the final code, but it depends on @kevinl03's scripts so not a priority until they are finalized.

from vcu-fw.

rafguevara14 avatar rafguevara14 commented on September 13, 2024

Created a simple encoding scheme instead of using utf-8 to make it easier for the firmware to manage incoming messages. More details here:

VCU Firmware Simulation

This is what the pseudocode would look like from both sides:

# Python code 
def throttle_encode(a1: int, a2: int) -> bytes:
	value = (a1-1268) | (a2-410)<< 13
	return value.to_bytes(3, byteorder='little')

apps1, apps2 = 1062, 538
print(apps1, apps2)

message = phantom_encode(apps1, apps2)

print(f'Sending {len(message)=} packets')

# VCU Firmware code
msg = int.from_bytes(message, 'little') 
apps1_val = (msg & 0b111111111111) + 1268
apps2_val = ((msg & 0b1111111111 << 13) >> 13) + 410

print(apps1_val, apps2_val)

from vcu-fw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.