Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/FirmwareUpdate/FirmwareUpdate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ uint8_t updateFirmware(){
Serial.print('.');
Serial.flush();
delay(2000);
if((sakuraio.getConnectionStatus() & 0x80) != 0x00){
if((sakuraio.getConnectionStatus() & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00){
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/GY-521/GY-521.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This code based on arduino playground and URL below (http://cranberrytree.blogspot.jp/2014/06/gy-521mpu-6050.html)
/**
* Channel definitions in Sakura IoT Platform
*
*
* Channel 0: Temperature in celsius
* Channel 1: Accelerometer X (G)
* Channel 2: Accelerometer Y
Expand Down Expand Up @@ -86,7 +86,7 @@ void setup() {

Serial.print("Waiting to come online");
for (;;) {
if ((sakuraio.getConnectionStatus() & 0x80) == 0x80) {
if ((sakuraio.getConnectionStatus() & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00) {
Serial.println(" connected");
break;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/HDC1000/HDC1000.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void setup() {
Serial.begin(9600);
Serial.print("Waiting to come online");
for(;;){
if( (sakuraio.getConnectionStatus() & 0x80) == 0x80 ) break;
if( (sakuraio.getConnectionStatus() & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00 ) break;
Serial.print(".");
delay(1000);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/SB412A/SB412A.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void setup()
Serial.print("Waiting to come online");
Serial.begin(9600);
for (;;) {
if ( (sakuraio.getConnectionStatus() & 0x80) == 0x80 ) break;
if ( (sakuraio.getConnectionStatus() & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00 ) break;
Serial.print(".");
delay(100);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Shell/commands.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void cmd_serial(int argc, char **argv){
void cmd_status(int argc, char **argv){
uint8_t ret = sakuraio.getConnectionStatus();

if((ret & 0x80) == 0x80){
if((ret & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00){
Serial.println("Online");
}else{
Serial.println("Offline");
Expand Down
2 changes: 1 addition & 1 deletion examples/Standard/Standard.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void setup() {
Serial.begin(9600);
Serial.print("Waiting to come online");
for(;;){
if( (sakuraio.getConnectionStatus() & 0x80) == 0x80 ) break;
if( (sakuraio.getConnectionStatus() & SAKURAIO_CONNECTION_STATUS_MASK) != 0x00 ) break;
Serial.print(".");
delay(1000);
}
Expand Down
2 changes: 2 additions & 0 deletions src/SakuraIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <SakuraIO/commands.h>

#define SAKURAIO_CONNECTION_STATUS_MASK (0x80)

class SakuraIO
{
protected:
Expand Down