Base class for LV-board communications.
More...
#include <LinxListener.h>
|
virtual int | Start () |
|
virtual int | Listen () |
|
virtual int | Available () |
|
virtual int | Accept () |
|
virtual int | Connected () |
|
virtual int | Close () |
|
virtual int | Exit () |
|
void | AttachCustomCommand (unsigned short commandNumber, int(*function)(unsigned char, unsigned char *, unsigned char *, unsigned char *)) |
|
void | AttachPeriodicTask (int(*function)(unsigned char *, unsigned char *)) |
|
virtual int | CheckForCommands () |
| Runs listener state machine; to be called in sketch loop() More...
|
|
int | ProcessCommand (unsigned char *recBuffer, unsigned char *sendBuffer) |
| Handles command packets. More...
|
|
void | PacketizeAndSend (unsigned char *commandPacketBuffer, unsigned char *responsePacketBuffer, unsigned int dataSize, int status) |
| Sends response packet. More...
|
|
void | StatusResponse (unsigned char *commandPacketBuffer, unsigned char *responsePacketBuffer, int status) |
| Sends status only as response (no data) More...
|
|
void | DataBufferResponse (unsigned char *commandPacketBuffer, unsigned char *responsePacketBuffer, const unsigned char *dataBuffer, unsigned char dataSize, int status) |
| Format byte array and send as LINX packet. Does not include data length byte. More...
|
|
unsigned char | ComputeChecksum (unsigned char *packetBuffer) |
|
bool | ChecksumPassed (unsigned char *packetBuffer) |
|
|
LinxDevice * | LinxDev |
|
LinxListenerState | State |
|
LinxListenerInterface | Interface |
|
unsigned char | ListenerChan |
|
unsigned char * | recBuffer |
|
unsigned char * | sendBuffer |
|
unsigned int | PrevPacket =0 |
|
int(* | customCommands [16])(unsigned char, unsigned char *, unsigned char *, unsigned char *) |
|
int(* | periodicTasks [1])(unsigned char *, unsigned char *) |
|
Base class for LV-board communications.
ProcessCommand handles the commands and responses; see here for specifics
◆ Accept()
int LinxListener::Accept |
( |
| ) |
|
|
virtual |
◆ Available()
int LinxListener::Available |
( |
| ) |
|
|
virtual |
◆ CheckForCommands()
int LinxListener::CheckForCommands |
( |
| ) |
|
|
virtual |
◆ Close()
int LinxListener::Close |
( |
| ) |
|
|
virtual |
◆ Connected()
int LinxListener::Connected |
( |
| ) |
|
|
virtual |
◆ DataBufferResponse()
void LinxListener::DataBufferResponse |
( |
unsigned char * |
commandPacketBuffer, |
|
|
unsigned char * |
responsePacketBuffer, |
|
|
const unsigned char * |
dataBuffer, |
|
|
unsigned char |
dataSize, |
|
|
int |
status |
|
) |
| |
Format byte array and send as LINX packet. Does not include data length byte.
- Parameters
-
commandPacketBuffer | |
responsePacketBuffer | |
dataBuffer | |
dataSize | |
status | |
◆ Exit()
int LinxListener::Exit |
( |
| ) |
|
|
virtual |
◆ Listen()
int LinxListener::Listen |
( |
| ) |
|
|
virtual |
◆ PacketizeAndSend()
void LinxListener::PacketizeAndSend |
( |
unsigned char * |
commandPacketBuffer, |
|
|
unsigned char * |
responsePacketBuffer, |
|
|
unsigned int |
dataSize, |
|
|
int |
status |
|
) |
| |
Sends response packet.
- Parameters
-
commandPacketBuffer | |
responsePacketBuffer | |
dataSize | |
status | |
◆ ProcessCommand()
int LinxListener::ProcessCommand |
( |
unsigned char * |
recBuffer, |
|
|
unsigned char * |
sendBuffer |
|
) |
| |
Handles command packets.
- Parameters
-
commandPacketBuffer | |
responsePacketBuffer | |
- Returns
- int status
See here for table of commands
- Todo:
- Flush Linx Connection Buffer
- Todo:
- Set pin mode
- Todo:
- Set AI resolution
- Todo:
- Set AO ref voltage
- Todo:
- Set AO resolution
- Todo:
- PWM Open, Set Mode, Set Freq, Close
- Todo:
- Buffer functions (CircularBuffer library)
- Todo:
- Task functions (TaskScheduler library)
◆ StatusResponse()
void LinxListener::StatusResponse |
( |
unsigned char * |
commandPacketBuffer, |
|
|
unsigned char * |
responsePacketBuffer, |
|
|
int |
status |
|
) |
| |
Sends status only as response (no data)
- Parameters
-
commandPacketBuffer | |
responsePacketBuffer | |
status | |
The documentation for this class was generated from the following files: