GithubHelp home page GithubHelp logo

mcaravati / chremion Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 57 KB

A web API written in Rust with an integrated designer for the CHEMION glasses.

License: Other

Rust 54.21% CSS 6.65% HTML 7.67% JavaScript 31.48%

chremion's Introduction

Chremion

A basic API written in Rust for the CHEMION glasses.
This program is entirely based on the research conducted in the ChemionHacking repository.
This program is a WIP.

Build

Build the program using

$ cargo build

Endpoints

Endpoint : /discover

Method : GET
Returns the BLE devices without a name.
Example :
OUTPUT :

[{"device_name":"Glasses-0E:1B","device_address":"F7:E6:B5:7B:0E:1B"}]

Endpoint : /connect

Method : POST
Connects to the given BLE device.
Example :
INPUT :

device_name=Glasses-0E%3A1B&device_address=F7%3AE6%3AB5%3A7B%3A0E%3A1B

THIS WILL BE CHANGED TO A JSON ENDPOINT

Endpoint : /disconnect

Method : GET
Disconnects from the current device.

Endpoint : /encode

Method : POST
Encodes a model to an UART command
Example :
INPUT :

{"glasses_frame":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}

OUPUT :

{"glasses_frame":[[250,3,0,57,1,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,7,85,169]]}

Endpoint : /display

Method : POST
Displays the given frame to the glasses
Example :
INPUT :

{"glasses_frame":[[250,3,0,57,1,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,7,85,169]]}

Error handling

On error, the server returns an HTTP error 500.
All the error messages are following this template :

{"message":"Error message"}

TODO

  • Create a web-based matrix designer
  • Write endpoints' documentation
  • Add configuration file
  • Make a good UI
  • Create tests
  • Hover display
  • Add error fields on all pages
  • Disconnect on Ctrl+C

Contributors

  • mcaravati

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.