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

Latest commit

 

History

History
121 lines (85 loc) · 2.45 KB

README.md

File metadata and controls

121 lines (85 loc) · 2.45 KB

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!