br.org.fito.j8051.micro
Class MicroFarejadorSender

java.lang.Object
  extended by java.lang.Thread
      extended by br.org.fito.j8051.micro.MicroFarejadorSender
All Implemented Interfaces:
java.lang.Runnable

public abstract class MicroFarejadorSender
extends java.lang.Thread

Class thats represents a process in the microcontroler. This class have the objective to provide for the classes that will henriret it, some functions for the treatement of the processo in the microcontroler. Theses functions are: * Automatic post of messages for the microcontroler. * Treatement for microcontroler`s message response referencing a given process. Classe que representa um processo no microcontrolador. Esta classe tem a funçào de prover as classes que vão herda-las, uma série de funcionalidades para o tratamento do processo do microcontrolador. Estas funcionalidades são: * Envio automático de mensagens para o microcontrolador; * Tratamento do recebimento das mensagens de resposta do microcontrolador referente ao processo indicado.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MicroFarejadorSender()
          Creates a new instance of MicroFarejadorSender Cria uma nova instância de MicroFarejadorSender
MicroFarejadorSender(int processo, long tempoEspera, int prioridade, java.lang.String mensagem)
          Creates a new instance of MicroFarejadorSender given a process, wait time, priority and parameter message.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getMensagem()
           
 int getPrioridade()
           
 int getProcesso()
           
 long getTempoEspera()
           
abstract  void receberMensagem(java.lang.String msg)
           
 void run()
          Override Thread`s method that, given a time frequency, send a message for the microcontroler connected.
 void setBluetoothConnection(BluetoothConnection bluetoothConnection)
          set a BluetoothConnection object for the communication between the Sender(this class) and the microcontroler.
 void setContinuaEnviando(boolean continuaEnviando)
          Inform if the Sender(this class) have continue to send messages or not for the microcontroler.
 void setMensagem(java.lang.String mensagem)
           
 void setPrioridade(int prioridade)
           
 void setProcesso(int processo)
           
 void setTempoEspera(long tempoEspera)
           
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getPriority, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MicroFarejadorSender

public MicroFarejadorSender()
Creates a new instance of MicroFarejadorSender Cria uma nova instância de MicroFarejadorSender


MicroFarejadorSender

public MicroFarejadorSender(int processo,
                            long tempoEspera,
                            int prioridade,
                            java.lang.String mensagem)
Creates a new instance of MicroFarejadorSender given a process, wait time, priority and parameter message. Cria uma nova instância de MicroFarejadorSender dado um processo, tempo de espera, prioridade e mensagem de parametro.

Method Detail

receberMensagem

public abstract void receberMensagem(java.lang.String msg)
                              throws J8051Exception
Throws:
J8051Exception

setBluetoothConnection

public void setBluetoothConnection(BluetoothConnection bluetoothConnection)
set a BluetoothConnection object for the communication between the Sender(this class) and the microcontroler. seta um ibjeto BluetoothConnection para a comunicação entre um Sender(esta classe) e o microcontrolador.

Parameters:
bluetoothConnection -

run

public void run()
Override Thread`s method that, given a time frequency, send a message for the microcontroler connected.
Metodo sobrescerito de Thread que, dado um tempo de frequência, envia uma mensagem para o microcontrolador conectado.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

setContinuaEnviando

public void setContinuaEnviando(boolean continuaEnviando)
Inform if the Sender(this class) have continue to send messages or not for the microcontroler.
informa se o Sender(esta classe) deve continuar enviando ou não mensagens para o microcontrolador

Parameters:
continuaEnviando -

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getTempoEspera

public long getTempoEspera()

setTempoEspera

public void setTempoEspera(long tempoEspera)

getMensagem

public java.lang.String getMensagem()

setMensagem

public void setMensagem(java.lang.String mensagem)

getProcesso

public int getProcesso()

setProcesso

public void setProcesso(int processo)

getPrioridade

public int getPrioridade()

setPrioridade

public void setPrioridade(int prioridade)