Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 3.29 KB

README.md

File metadata and controls

101 lines (70 loc) · 3.29 KB

Bummer

A Gleam client library for controlling buttplug.io supported devices.

Package Version Hex Docs

Further documentation can be found at https://hexdocs.pm/bummer.

Installation

gleam add bummer@1

Usage

import bummer

case bummer.connect("ws://127.0.0.1:12345/") {
  Ok(socket) -> {
    io.println("Connected to intiface-engine websocket")
    io.println("Initiating a test sequence")

    bummer.scan(socket, 5000)
    bummer.vibrate(socket, 500)
    bummer.rotate(socket, 500)

    io.println("Test sequence finished")
  }
  Error(_) ->
    "Cannot connect to intiface-engine websocket. Is it running?"
    |> io.println_error

The ten-thousand-foot view

A toy communicates with your computer via Bluetooth LE. Some manufacturers require pairing before use, some don't. You don't use the system Bluetooth manager to connect to the device.

Clients like buttplug-py, buttplug-js, or this Gleam client, don't control the toy directly. They only communicate with a server like intiface-engine via websockets. The server then does the heavy lifting.

You can run the server like this:

cargo install intiface-engine
~/.cargo/bin/intiface-engine --websocket-port 12345 --use-bluetooth-le

Only then you can use your client.

This package is supposed to be used only as a library for your client tools but comes with a short executable to test your setup more easily.

gleam run

Run it twice to be sure.

Resources

Troubleshooting