The IrcBot class can connect to a channel on an IRC network. Users on the same network can send messages to the bot that are parsed by message handlers. The included handlers read digital/analog inputs and write digital outputs or echo messages back to the command sender/channel. Users can write their own message handlers inheriting from the MessageHandler class to perform different actions.
AnalogInHandler Class Reference
AnalogInHandler lets users read a DigitalIn using "READ <name>". More...
#include <IrcMessageHandlers.h>
Inherits MessageHandler.
Public Member Functions | |
AnalogInHandler (char *name, PinName pin) | |
Create an AnalogInHandler. | |
void | scale (float scale, char *unit) |
Define a scaling factor for the measured value [0.0 - 1.0]. | |
IrcMessage | handle (IrcMessage) |
Measure input, scale and reply "<name> = <value> <units>". |
Detailed Description
AnalogInHandler lets users read a DigitalIn using "READ <name>".
Definition at line 38 of file IrcMessageHandlers.h.
Constructor & Destructor Documentation
AnalogInHandler | ( | char * | name, |
PinName | pin | ||
) |
Create an AnalogInHandler.
- Parameters:
-
name Name of input used in command on IRC pin Pin the input is connected to.
Definition at line 69 of file IrcMessageHandlers.cpp.
Member Function Documentation
IrcMessage handle | ( | IrcMessage | msg ) | [virtual] |
Measure input, scale and reply "<name> = <value> <units>".
Reimplemented from MessageHandler.
Definition at line 81 of file IrcMessageHandlers.cpp.
void scale | ( | float | scale, |
char * | unit | ||
) |
Define a scaling factor for the measured value [0.0 - 1.0].
- Parameters:
-
scale The scaling factor unit The units used in the message to IRC
Definition at line 76 of file IrcMessageHandlers.cpp.
Generated on Tue Jul 12 2022 20:41:27 by 1.7.2