Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Markdown isn't playing nice.

  • Loading branch information...
commit e5a5da88ecec0069ecf5b4a25407e3dac06861e6 1 parent df24930
brandon authored
Showing with 11 additions and 10 deletions.
  1. +11 −10 Readme.md
View
21 Readme.md
@@ -51,17 +51,17 @@
Calling new api(host,user,pass) returns a connection object.
- * conn.connect(callback)
+ * conn.connect(callback)
> Connect to the target device. The callback function is called after successful login with the current connection object as its parameter.
- * conn.openChannel(id)
+ * conn.openChannel(id)
> Open and return a new channel object. Each channel is a unique command line to the mikrotik, allowing simultaneous execution of commands. The ID parameter is optional.
- * conn.isConnected()
+ * conn.isConnected()
> Returns true is currently connected to a mikrotik device.
- * conn.closeChannel(id)
+ * conn.closeChannel(id)
> Closes an open channel. This will call the close method of the channel object.
- * conn closeOnDone(b)
+ * conn closeOnDone(b)
> If b == true, when a done event occurs, close the connection after all channels have been closed.
- * conn.close(force)
+ * conn.close(force)
> Close the connection. If force is true, force close of any open channels then close this connection.
### Channel
@@ -69,16 +69,17 @@
The following methods are available for channels:
* channel.closeOnDone(b)
- * channel.setSaveBuffer(b)
+ > If b == true, when a done event occurs, close the channel after all commands queued have been executed.
+ * channel.setSaveBuffer(b)
> If b is true, then save each line received in a buffer and pass the entire buffer to the done event. Otherwise the done event will not get all the lines, only the last line.
> This is handy when following trailing output from a listen command, where the data could be endless.
* channel.getConnection()
* channel.getId()
- * channel.write(lines,writeCallback)
+ * channel.write(lines,writeCallback)
> Lines can be a string, or an array of strings. If it is a string, then it is split on the EOL character and each resulting line is sent as a separate word (in API speak)
If lines is an array, then each element is sent unaltered.
- * channel.close(force)
- > Close the channel. If there are any commands still waiting to be executed, they will be completed before closing the channel.
+ * channel.close(force)
+ > Close the channel. If there are any commands still waiting to be executed, they will be completed before closing the channel.
If force is TRUE, then the channel is immediately closed. If the channel is running, the cancel command is sent to stop any running listen commands, or potentially long running output.
## Examples
Please sign in to comment.
Something went wrong with that request. Please try again.