Station API

Dependents:   GMCStation

Embed: (wiki syntax)

« Back to documentation index

Station Class Reference

Station Class Reference

A simple command/response network interface for mbed. More...

#include <Station.h>

Public Member Functions

 Station (int port)
 creates a Station object
void addHandler (string command, void(*handler)(void))
 adds a command handler
template<typename T >
void addHandler (string command, T *tptr, void(T::*handler)(void))
 adds a command handler
void setBuffer (char *buf, int length)
 sets the buffer for communication between caller and callee
void handleClient ()
 Check for any client and handle its request.

Detailed Description

A simple command/response network interface for mbed.

Definition at line 33 of file Station.h.


Constructor & Destructor Documentation

Station ( int  port )

creates a Station object

Parameters:
portport number

Definition at line 40 of file Station.h.


Member Function Documentation

void addHandler ( string  command,
void(*)(void)  handler 
)

adds a command handler

Parameters:
commandname of the command
handlerpointer to the handler of the command

Definition at line 50 of file Station.h.

void addHandler ( string  command,
T *  tptr,
void(T::*)(void)  handler 
)

adds a command handler

Parameters:
commandname of the command
tptrpointer to the object to call the handler on
handlerpointer to the handler of the command

Definition at line 61 of file Station.h.

void handleClient (  )

Check for any client and handle its request.

This function is expected to be called repeatedly in main loop.

Definition at line 79 of file Station.h.

void setBuffer ( char *  buf,
int  length 
)

sets the buffer for communication between caller and callee

Parameters:
bufpointer to the communication buffer
lengthlength of the buffer

Definition at line 71 of file Station.h.