C# Class Mycroft.App.Client

The client abstract class. Any application made will inherit from this class.
Afficher le fichier Open project: rit-sse-mycroft/app-text-to-speech Class Usage Examples

Méthodes publiques

Свойство Type Description
InstanceId string

Protected Properties

Свойство Type Description
handler MessageEventHandler

Méthodes publiques

Méthode Description
Broadcast ( dynamic content ) : System.Threading.Tasks.Task

Sends MSG_BROADCAST to Mycroft

Client ( string manifestPath ) : System

Constructor for a client

CloseConnection ( ) : void

Close the connection from the Mycroft server

Connect ( string hostname, string port ) : void

Connects to Mycroft

Down ( ) : System.Threading.Tasks.Task

Sends APP_DOWN to Mycroft

InUse ( int priority ) : System.Threading.Tasks.Task

Sends APP_IN_USE to Mycroft

Query ( string capability, string action, dynamic data, string instanceId = null, int priority = 30 ) : System.Threading.Tasks.Task

Sends MSG_QUERY to Mycroft

QueryFail ( string id, string message ) : System.Threading.Tasks.Task

Sends MSG_QUERY_FAIL to Mycroft

QuerySuccess ( string id, dynamic ret ) : System.Threading.Tasks.Task

Sends MSG_QUERY_SUCCESS to Mycroft

SendManifest ( ) : System.Threading.Tasks.Task

Sends APP_MANIFEST to Mycroft

StartListening ( ) : System.Threading.Tasks.Task

Start recieving messages from Mycroft

Up ( ) : System.Threading.Tasks.Task

Sends APP_UP to Mycroft

Private Methods

Méthode Description
ReadJson ( ) : Task

Reads in json from the Mycroft server.

SendData ( string type, string data = "" ) : System.Threading.Tasks.Task

Send a message to Mycroft where data is a string. Used for sending Messages with no body (and app manifest because it's already a string)

SendJson ( string type, Object data ) : System.Threading.Tasks.Task

Sends a message to Mycroft where data is an object. Used for sending messages that actually have a body

Method Details

Broadcast() public méthode

Sends MSG_BROADCAST to Mycroft
public Broadcast ( dynamic content ) : System.Threading.Tasks.Task
content dynamic The content object of the message
Résultat System.Threading.Tasks.Task

Client() public méthode

Constructor for a client
public Client ( string manifestPath ) : System
manifestPath string
Résultat System

CloseConnection() public méthode

Close the connection from the Mycroft server
public CloseConnection ( ) : void
Résultat void

Connect() public méthode

Connects to Mycroft
public Connect ( string hostname, string port ) : void
hostname string The hostname to connect to
port string The port to connect to
Résultat void

Down() public méthode

Sends APP_DOWN to Mycroft
public Down ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

InUse() public méthode

Sends APP_IN_USE to Mycroft
public InUse ( int priority ) : System.Threading.Tasks.Task
priority int the priority of the app
Résultat System.Threading.Tasks.Task

Query() public méthode

Sends MSG_QUERY to Mycroft
public Query ( string capability, string action, dynamic data, string instanceId = null, int priority = 30 ) : System.Threading.Tasks.Task
capability string The capability
action string The action
data dynamic The data of the message
instanceId string An array of instance ids. Defaults to null
priority int the priority. Defaults to 30
Résultat System.Threading.Tasks.Task

QueryFail() public méthode

Sends MSG_QUERY_FAIL to Mycroft
public QueryFail ( string id, string message ) : System.Threading.Tasks.Task
id string The id of the message being responded to
message string The error message
Résultat System.Threading.Tasks.Task

QuerySuccess() public méthode

Sends MSG_QUERY_SUCCESS to Mycroft
public QuerySuccess ( string id, dynamic ret ) : System.Threading.Tasks.Task
id string The id of the message being responded to
ret dynamic The content of the message
Résultat System.Threading.Tasks.Task

SendManifest() public méthode

Sends APP_MANIFEST to Mycroft
public SendManifest ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

StartListening() public méthode

Start recieving messages from Mycroft
public StartListening ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

Up() public méthode

Sends APP_UP to Mycroft
public Up ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

Property Details

InstanceId public_oe property

public string InstanceId
Résultat string

handler protected_oe property

protected MessageEventHandler,Mycroft.App handler
Résultat MessageEventHandler