Skip to content

Commit

Permalink
Changed the implementation of open_fence and open_fence_within me…
Browse files Browse the repository at this point in the history
…thods.

Updated README
  • Loading branch information
younisshah committed Aug 5, 2017
1 parent e34bd5c commit 4f1a4f1
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ Then use `n` to open a geofence like this:
3) Open a static `FENCE` using `open_fence`:

```rust
use self::nazar::t38::Types::{String};
let work = |msg| {
println!("FENCE updates {:?}", msg);
};
n.open_fence("ws://127.0.0.1:9851", "my_fleet", "12.12", "33.22", "6000", work);
fn action (out: &nazar::t38::NazarSender, msg: String) {
out.send("OK").unwrap();
println!("{}", msg);
}

//.....

n.open_fence("ws://127.0.0.1:9851", "my_fleet", "12.12", "33.22", "6000", action);
```

4) New API to execute T38 command - `cmd`, `arg` and `execute_with_args`.
Expand All @@ -84,11 +87,14 @@ match n.execute_with_args() {
5) New API to open a static geofence with GeoJSON object type. `open_fence_within`

```rust
let n = nazar::t38::Client::new();
let work = |msg| {
println!("FENCE updates {:?}", msg);
};
n.open_fence_within("ws://localhost:9851", "my_fleet", "qwerty123", vec![vec![12.32, 23.4], vec![22.32, 33.4], vec![42.32, 23.5], vec![12.32, 23.4]], work)
fn action (out: &nazar::t38::NazarSender, msg: String) {
out.send("OK").unwrap();
println!("{}", msg);
}

//.....

n.open_fence_within("ws://localhost:9851", "my_fleet", "qwerty123", vec![vec![12.32, 23.4], vec![22.32, 33.4], vec![42.32, 23.5], vec![12.32, 23.4]], action);
```


Expand Down

0 comments on commit 4f1a4f1

Please sign in to comment.