Skip to content
This repository has been archived by the owner on Oct 9, 2022. It is now read-only.

jesse-c/Arduino-DDP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino DDP library

A simple implementation of DDP (version 1) for Arduinos.

Primarily created for use in my thesis project for CEIT at The University of Queensland. At the moment it's specific to my project though that will change.

Quick start

    DDP ddp = DDP();

    void setup() {
      if (ddp.setup("192.168.0.1", 3000)) {
        if (ddp.connect()) {
        }
      }
    }

    void loop() {
      ddp.sub();
      ddp.listen();
    }

Being used in my thesis project

Documentation

Connecting

bool setup(String host, String path ="/", int port = 80)

Partialyl implemented. host params not currently used.

bool connect()

Im

Listening

void listen()

After a connection has successfully been made, listen() checks for any data on the line and if any is found, what type of message it was. It then calls the appropriate function.

Heartbeats

void ping(String id = "")

Partially implemented—doesn't yet response with ID if one was included.

void pong(String id = "")

Partially implemented—doesn't yet response with ID if one was included.

Managing data

Client → Server

void sub()

Partiually implemented

void unsub()

Not yet implemeneted

Server → Client

void nosub()

Not yet implemeneted

void added()

Partially implemented.

void changed()

Partially implemented.

void removed()

Not yet implemeneted

void ready()

Partially implemented.

void addedBefore()

Not yet implemeneted

void movedBefore()

Not yet implemeneted

Remote procedure calls

Client → Server

void method()

Partially implemented.

Server → Client

void result()

Partially implemented.

void updated()

Partially implemented.

Dependencies

ArduinoJson

Arduino-Websocket

At the moment these work by using absolute paths for them which is not ideal.

You'll need to download them locally. You can attempt to use them included as submodules. Run git submodule update --recursive.

Notes

n/a

Compatability

Tested on:

  • Arduino Mega 2560

TODO

  • Add tests

Contributing

Contributions are welcome!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages