codde_protocol_derive

Crates.iocodde_protocol_derive
lib.rscodde_protocol_derive
version0.1.0
sourcesrc
created_at2024-02-23 21:44:37.278944
updated_at2024-02-23 21:44:37.278944
descriptionMulti Communication protocol in heart of the C.O.D.D.E. Pi framework
homepagehttps://github.com/codde-pi/codde_protocol
repository
max_upload_size
id1151015
size5,122
Matt (mat-his)

documentation

README

CODDE Protocol

Multi Communication protocol in heart of the C.O.D.D.E. Pi framework.

This Project is written in Rust, enabling fast serializing/deserializing and data processing. Client side is ported for Dart/Flutter applications, and server side has been translated in python.

Buy Me A Coffee

CODDE Protocol integrates data generated by CODDE Pi App widgets, and received by embedded systems. See https://codde-pi.com to stay tuned about new widgets integration.

Show me the code

With one code structure and a dozen of lines, you can receive data from socket, bluetooth of UART com. Just need a port address and registered actions on data is received :


import codde_pi_protocol as cp
import time

server = cp.CoddePiServer.use_socket('localhost:12345')

def action(*args):
    widget: cp.ToggleButton = args[0]
    print("value received : ", widget.value)
    server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True))

if __name__ == "__main__":
    print('open server...')
    server.open()
    server.on(1, "ToggleButton", action)
    # server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True))
    server.serve()
    time.sleep(2)
    server.close()

Roadmap

Protocols:

  • Socket
  • Bluetooth
  • UART
  • HTTP
Commit count: 0

cargo fmt