Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Medidor Class Reference

#include <medidor.h>

Collaboration diagram for Medidor:

Collaboration graph
[legend]

Detailed Description

Meter device class.

Contains all functions, parameters and data related to the meter device and its communication, such as the FSM and the function used to build the answer to the command received.


Public Member Functions

 Medidor (Communication *com)
 Sets the communication device and the initial communication state in the FSM.

void Fsm (void)
 Contains the states of the communication.

int montarResposta (unsigned char *buffer, unsigned char comando)
 Builds the answer to the command received.

void doCommunication (unsigned char *buffer_snd, int numBytes, unsigned char *buffer_rec, int bytes_rec, Communication *med)
 Called when the communication is established.

int getSerialNumber (void)
 Gets the serial number of the meter device being used.

void setSerialNumber (int serialNum)
 Sets the serial number of the meter device being used.


Constructor & Destructor Documentation

Medidor::Medidor Communication com  ) 
 

Sets the communication device and the initial communication state in the FSM.

Parameters:
com the communication file descriptor.


Member Function Documentation

void Medidor::doCommunication unsigned char *  buffer_snd,
int  numBytes,
unsigned char *  buffer_rec,
int  bytes_rec,
Communication med
 

Called when the communication is established.

Parameters:
buffer_snd the last data block transmitted.
numBytes the number of bytes transmitted.
buffer_rec the last data block received.
bytes_rec the number of bytes received.
med used to get the communication file descriptor for the meter device in use

int Medidor::getSerialNumber void   ) 
 

Gets the serial number of the meter device being used.

Returns:
the serial number of the meter device

int Medidor::montarResposta unsigned char *  buffer,
unsigned char  comando
 

Builds the answer to the command received.

Parameters:
buffer bytes that will be sent.
comando the command received.

void Medidor::setSerialNumber int  serialNum  ) 
 

Sets the serial number of the meter device being used.

Parameters:
serialNum the serial number of the meter device


The documentation for this class was generated from the following file:
Generated on Sun Aug 21 21:28:49 2005 for PLC Modem/ABNT-14522 Library by doxygen 1.3.7