Skip to content

Commit

Permalink
Spelling fix for clarity: 'continuesRead' -> 'continuousRead'
Browse files Browse the repository at this point in the history
  • Loading branch information
solon committed May 4, 2013
1 parent 31cf8e9 commit 8508dfa
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions example_readingMultipleVars/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void testApp::setup()
ofBackground(0, 0, 0);

serial.setup("/dev/tty.usbserial-A70060V8", 9600);
serial.startContinuesRead();
serial.startContinuousRead();
ofAddListener(serial.NEW_MESSAGE,this,&testApp::onNewMessage);

message = "";
Expand Down Expand Up @@ -61,4 +61,4 @@ void testApp::draw()
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
requestRead = true;
}
}
4 changes: 2 additions & 2 deletions example_readingSingleVars/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void testApp::setup()
ofBackground(0, 0, 0);

serial.setup("/dev/tty.usbserial-A70060V8", 9600);
serial.startContinuesRead();
serial.startContinuousRead();
ofAddListener(serial.NEW_MESSAGE,this,&testApp::onNewMessage);

message = "";
Expand Down Expand Up @@ -46,4 +46,4 @@ void testApp::draw()
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
requestRead = true;
}
}
4 changes: 2 additions & 2 deletions example_writingVars/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void testApp::setup()
ofBackground(0, 0, 0);

serial.setup("/dev/tty.usbserial-A70060V8", 9600);
serial.startContinuesRead(false);
serial.startContinuousRead(false);
ofAddListener(serial.NEW_MESSAGE,this,&testApp::onNewMessage);

message = "";
Expand Down Expand Up @@ -66,4 +66,4 @@ void testApp::keyReleased(int key)
remember = false;
break;
}
}
}
4 changes: 2 additions & 2 deletions example_writingVarsSimultaneously/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void testApp::setup()
ofBackground(0, 0, 0);

serial.setup("/dev/tty.usbserial-A70060V8", 9600);
serial.startContinuesRead(false);
serial.startContinuousRead(false);
ofAddListener(serial.NEW_MESSAGE,this,&testApp::onNewMessage);

key1Down = false;
Expand Down Expand Up @@ -78,4 +78,4 @@ void testApp::keyReleased(int key)
// sendMessage = true;
// break;
}
}
}
20 changes: 10 additions & 10 deletions src/ofxSimpleSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ ofxSimpleSerial::ofxSimpleSerial()
{
message = "";
messageBuffer = "";
continuesRead = false;
continuousRead = false;
bWriteByte = true;
}

/*
* Make ofxSimpleSerial listenen continuesly for new messages.
* Make ofxSimpleSerial listen continuously for new messages.
* @param writeByte Should I do a writeByte('r') to request new messages? (true is default).
* Disable this when you want to send your own messages.
*/
void ofxSimpleSerial::startContinuesRead(bool writeByte)
void ofxSimpleSerial::startContinuousRead(bool writeByte)
{
continuesRead = true;
continuousRead = true;
bWriteByte = writeByte;
sendRequest();
}
void ofxSimpleSerial::stopContinuesRead()
void ofxSimpleSerial::stopContinuousRead()
{
continuesRead = false;
continuousRead = false;
ofRemoveListener(ofEvents().update, this, &ofxSimpleSerial::update);
}
/*
* Request new data from the device your connected to.
* Request new data from the device you're connected to.
*/
void ofxSimpleSerial::sendRequest()
{
Expand All @@ -36,7 +36,7 @@ void ofxSimpleSerial::sendRequest()
void ofxSimpleSerial::update(ofEventArgs & args)
{
read();
if(continuesRead)
if(continuousRead)
sendRequest();
}

Expand All @@ -45,7 +45,7 @@ void ofxSimpleSerial::read()
// if we've got new bytes
if(available() > 0)
{
// we wil keep reading until nothing is left
// we will keep reading until nothing is left
while (available() > 0)
{
// we'll put the incoming bytes into bytesReturned
Expand Down Expand Up @@ -81,4 +81,4 @@ void ofxSimpleSerial::writeString(string message)
unsigned char* chars = (unsigned char*) message.c_str(); // cast from string to unsigned char*
int length = message.length();
writeBytes(chars,length);
}
}
6 changes: 3 additions & 3 deletions src/ofxSimpleSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ofxSimpleSerial : public ofSerial{

ofxSimpleSerial();
void sendRequest();
void startContinuesRead(bool writeByte = true);
void stopContinuesRead();
void startContinuousRead(bool writeByte = true);
void stopContinuousRead();
void writeString(string message);

ofEvent< string > NEW_MESSAGE;
Expand All @@ -26,7 +26,7 @@ class ofxSimpleSerial : public ofSerial{

string messageBuffer;
unsigned char bytesReturned[NUM_BYTES];
bool continuesRead;
bool continuousRead;
bool bWriteByte;
void initSetup();
void update(ofEventArgs & args);
Expand Down

0 comments on commit 8508dfa

Please sign in to comment.