Skip to content

Commit

Permalink
Add travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinroger committed Aug 28, 2016
1 parent 597ea14 commit 5932e85
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
@@ -0,0 +1,19 @@
language: python
python:
- "2.7"

cache:
directories:
- "~/.platformio"

env:
- PLATFORMIO_CI_SRC=examples/FullyFeatured
- CPPLINT=true

install:
- pip install -U platformio
- pip install cpplint
- platformio lib install 305 # ESPAsyncTCP

script:
- if [[ "$CPPLINT" ]]; then make cpplint; else platformio ci --lib="." --board=esp01 --board=nodemcuv2; fi
3 changes: 3 additions & 0 deletions Makefile
@@ -0,0 +1,3 @@
cpplint:
cpplint --repository=. --recursive --filter=-whitespace/line_length,-legal/copyright,-runtime/printf,-build/include,-build/namespace ./src
.PHONY: cpplint
14 changes: 7 additions & 7 deletions src/AsyncMqttClient.cpp
Expand Up @@ -363,7 +363,7 @@ void AsyncMqttClient::_onMessage(char* topic, char* payload, uint8_t qos, bool d
bool notifyPublish = true;

if (qos == 2) {
for (AsyncMqttClientInternals::PendingPubRel pendingPubRel :_pendingPubRels) {
for (AsyncMqttClientInternals::PendingPubRel pendingPubRel : _pendingPubRels) {
if (pendingPubRel.packetId == packetId) {
notifyPublish = false;
break;
Expand Down Expand Up @@ -413,7 +413,7 @@ void AsyncMqttClient::_onPublish(uint16_t packetId, uint8_t qos) {
_lastActivity = millis();

bool pubRelAwaiting = false;
for (AsyncMqttClientInternals::PendingPubRel pendingPubRel :_pendingPubRels) {
for (AsyncMqttClientInternals::PendingPubRel pendingPubRel : _pendingPubRels) {
if (pendingPubRel.packetId == packetId) {
pubRelAwaiting = true;
break;
Expand Down Expand Up @@ -512,7 +512,7 @@ bool AsyncMqttClient::connected() const {
}

void AsyncMqttClient::connect() {
if(_connected) return;
if (_connected) return;

if (_useIp) {
_client.connect(_ip, _port);
Expand All @@ -522,7 +522,7 @@ void AsyncMqttClient::connect() {
}

void AsyncMqttClient::disconnect() {
if(!_connected) return;
if (!_connected) return;

char fixedHeader[2];
fixedHeader[0] = AsyncMqttClientInternals::PacketType.DISCONNECT;
Expand All @@ -536,7 +536,7 @@ void AsyncMqttClient::disconnect() {
}

uint16_t AsyncMqttClient::subscribe(const char* topic, uint8_t qos) {
if(!_connected) return 0;
if (!_connected) return 0;

char fixedHeader[5];
fixedHeader[0] = AsyncMqttClientInternals::PacketType.SUBSCRIBE;
Expand Down Expand Up @@ -569,7 +569,7 @@ uint16_t AsyncMqttClient::subscribe(const char* topic, uint8_t qos) {
}

uint16_t AsyncMqttClient::unsubscribe(const char* topic) {
if(!_connected) return 0;
if (!_connected) return 0;

char fixedHeader[5];
fixedHeader[0] = AsyncMqttClientInternals::PacketType.UNSUBSCRIBE;
Expand Down Expand Up @@ -598,7 +598,7 @@ uint16_t AsyncMqttClient::unsubscribe(const char* topic) {
}

uint16_t AsyncMqttClient::publish(const char* topic, uint8_t qos, bool retain, const char* payload, size_t length) {
if(!_connected) return 0;
if (!_connected) return 0;

char fixedHeader[5];
fixedHeader[0] = AsyncMqttClientInternals::PacketType.PUBLISH;
Expand Down
6 changes: 3 additions & 3 deletions src/AsyncMqttClient.h
@@ -1,6 +1,6 @@
#ifndef ASYNCMQTTCLIENT_SRC_ASYNCMQTTCLIENT_H_
#define ASYNCMQTTCLIENT_SRC_ASYNCMQTTCLIENT_H_
#ifndef SRC_ASYNCMQTTCLIENT_H_
#define SRC_ASYNCMQTTCLIENT_H_

#include "AsyncMqttClient.hpp"

#endif // ASYNCMQTTCLIENT_SRC_ASYNCMQTTCLIENT_H_
#endif // SRC_ASYNCMQTTCLIENT_H_
2 changes: 2 additions & 0 deletions src/AsyncMqttClient/Helpers.hpp
@@ -1,3 +1,5 @@
#pragma once

namespace AsyncMqttClientInternals {
class Helpers {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/AsyncMqttClient/Packets/UnsubAckPacket.cpp
Expand Up @@ -24,7 +24,7 @@ void UnsubAckPacket::parseVariableHeader(char* data, size_t len, size_t* current
}
}

void UnsubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) {
(void)data;
void UnsubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) {
(void)data;
(void)currentBytePosition;
}

0 comments on commit 5932e85

Please sign in to comment.