Abstraction for the glider class
Diff: Glider.cpp
- Revision:
- 4:ff59603d9fb6
- Parent:
- 3:d8932a3036a8
- Child:
- 5:460412fc4a17
diff -r d8932a3036a8 -r ff59603d9fb6 Glider.cpp --- a/Glider.cpp Thu Apr 13 01:58:17 2017 +0000 +++ b/Glider.cpp Thu Apr 13 05:44:14 2017 +0000 @@ -9,7 +9,9 @@ pressure = 0.0; temp = 0.0; alt = 0.0; + packetCount = 0; comm = false; + transmitFlag = false; hmc = new HMC5883L(sda, scl); bmp = new BMP180(sda, scl); bmp->Initialize(1013.25, BMP180_OSS_ULTRA_LOW_POWER); @@ -29,6 +31,10 @@ this->missionTime = time(NULL) - this->startTime; } +void Glider::setTransmitFlag() { + this->transmitFlag = true; +} + void Glider::saveTelem() { FILE *fp = fopen("/telem/telem.txt", "w"); fprintf(fp, "hello,"); @@ -64,7 +70,9 @@ void Glider::transmitPacket() { //TODO: transmit mission time, packet count, alt, pressure, speed //temp, voltage, state - xbee->printf("3387, GLIDER, %f, %d\r\n", this->heading, this->missionTime); + this->packetCount++; + + this->xbee->printf("3387, GLIDER, %f, %d, %d\r\n", this->heading, this->missionTime, this->packetCount); } void Glider::setCommandFlag() {