Skip to content

janleskovec/multicom_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiCom Flutter

Client library implementation for MultiCom

Features

  • discover nearby compatible devices
  • ping
  • get
  • send
  • post

Getting started

BLE notes: link

Android permissions issues: link

TODO: List prerequisites and provide or point to information on how to start using the package.

Usage

Following is some ecample usage of this library. For more detail spin up the example

// create a new client object with selected backends
Client client = Client(
    channels: [
        UdpChannel(targetPort: 5021),
        BleChannel(),
    ]);

// initiate device discovery
client.sendDiscover();

//... after some devices are found

// obtain a list of discovered devices
devices = client.getDeviceList();

// open a new connection session
session = widget.client.open(devices[0].ddata.devId);

// test ping
Stopwatch stopwatch = Stopwatch()..start();
bool? res = await session.ping();
if (res != null && res) {
    log('pong (${stopwatch.elapsed.inMilliseconds}ms)');
} else {
    log('ping failed!');
}
stopwatch.stop();

About

Flutter package that implements MultiCom communication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published