{"action":"created","comment":{"url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/comments/36301791","id":36301791,"diff_hunk":"@@ -0,0 +1,225 @@\n+/**\n+ * @file CosaMQTTsecureclient.ino\n+ * @version 1.0\n+ *\n+ * @section License\n+ * Copyright (C) 2015,      Alexander Sehlström (CosaMQTTsecureclient example)\n+ * Copyright (C) 2014-2015, Mikael Patel (Cosa core and related libraries)\n+ *\n+ * This library is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU Lesser General Public\n+ * License as published by the Free Software Foundation; either\n+ * version 2.1 of the License, or (at your option) any later version.\n+ *\n+ * This library is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+ * Lesser General Public License for more details.\n+ *\n+ * @section Description\n+ * W5100 Ethernet Controller device drive example code; MQTT client\n+ * switching imaginary NEXA switches on and off.\n+ * The MQTT client connects to the MQTT broker using username/password.\n+ * It also specifies a last will.\n+ * \n+ * @section Circuit\n+ * This sketch is designed for the Ethernet Shield.\n+ * @code\n+ *                       W5100/ethernet\n+ *                       +------------+\n+ * (D10)--------------29-|CSN         |\n+ * (D11)--------------28-|MOSI        |\n+ * (D12)--------------27-|MISO        |\n+ * (D13)--------------30-|SCK         |\n+ * (D2)-----[ ]-------56-|IRQ         |\n+ *                       +------------+\n+ *\n+ * @endcode\n+ * \n+ * @section Reference\n+ * 1. Cosa\n+ *    Copyright (c) 2012-2015, Mikael Patel\n+ *    https://github.com/mikaelpatel/Cosa\n+ *    \n+ * 2. Cosa-MQTT\n+ *    Copyright (c) 2014-2015, Mikael Patel\n+ *    https://github.com/mikaelpatel/Cosa-MQTT\n+ *    \n+ * This file is part of the Arduino Che Cosa project\n+ */\n+\n+#include <DHCP.h>\n+#include <DNS.h>\n+#include <MQTT.h>\n+#include <W5100.h>\n+\n+#include \"Cosa/Watchdog.hh\"\n+#include \"Cosa/Trace.hh\"\n+#include \"Cosa/IOStream/Driver/UART.hh\"\n+#include \"Cosa/String.hh\"\n+\n+#define DEVMODE\n+\n+// W5100 Ethernet Controller with MAC-address\n+static const uint8_t mac[6] __PROGMEM = { 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed };\n+W5100 ethernet(mac);\n+\n+// MQTT broker configuration\n+#define LOCALBROKER \"10.0.1.191\"\n+#define BROKER LOCALBROKER\n+\n+// MQTT client configurations\n+static const char CLIENT[] __PROGMEM = \"Cosa-MQTT secure client\";       // Client name\n+static const char WILL_TOPIC[] __PROGMEM = \"node/gone-offline\";         // Last will topic\n+static const char WILL_MSG[] __PROGMEM = \"Cosa-MQTT secure client\";     // Last will message\n+static const uint16_t will_qos = 0;                                     // Last will QoS","path":"examples/CosaMQTTsecureclient/CosaMQTTsecureclient.ino","position":75,"original_position":75,"commit_id":"af256c411d2d73f2774c9cfbe34b0441446e6fc6","original_commit_id":"af256c411d2d73f2774c9cfbe34b0441446e6fc6","user":{"login":"mikaelpatel","id":2774083,"avatar_url":"https://avatars.githubusercontent.com/u/2774083?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaelpatel","html_url":"https://github.com/mikaelpatel","followers_url":"https://api.github.com/users/mikaelpatel/followers","following_url":"https://api.github.com/users/mikaelpatel/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpatel/subscriptions","organizations_url":"https://api.github.com/users/mikaelpatel/orgs","repos_url":"https://api.github.com/users/mikaelpatel/repos","events_url":"https://api.github.com/users/mikaelpatel/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpatel/received_events","type":"User","site_admin":false},"body":"Why not follow the naming standard? WILL_QOS.","created_at":"2015-08-05T13:39:13Z","updated_at":"2015-08-05T13:39:13Z","html_url":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3#discussion_r36301791","pull_request_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/comments/36301791"},"html":{"href":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3#discussion_r36301791"},"pull_request":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3","id":41659161,"html_url":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3","diff_url":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3.diff","patch_url":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3.patch","issue_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/3","number":3,"state":"open","locked":false,"title":"Create CosaMQTTsecureclient.ino","user":{"login":"sehlstrom","id":3474084,"avatar_url":"https://avatars.githubusercontent.com/u/3474084?v=3","gravatar_id":"","url":"https://api.github.com/users/sehlstrom","html_url":"https://github.com/sehlstrom","followers_url":"https://api.github.com/users/sehlstrom/followers","following_url":"https://api.github.com/users/sehlstrom/following{/other_user}","gists_url":"https://api.github.com/users/sehlstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sehlstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sehlstrom/subscriptions","organizations_url":"https://api.github.com/users/sehlstrom/orgs","repos_url":"https://api.github.com/users/sehlstrom/repos","events_url":"https://api.github.com/users/sehlstrom/events{/privacy}","received_events_url":"https://api.github.com/users/sehlstrom/received_events","type":"User","site_admin":false},"body":"W5100 Ethernet Controller device drive example code; MQTT client switching imaginary NEXA switches on and off.\r\nThe MQTT client connects to the MQTT broker using username/password. It also specifies a last will.","created_at":"2015-08-05T09:26:40Z","updated_at":"2015-08-05T13:39:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07c1ea517c674e994bdce58653c8011db7c644fe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3/commits","review_comments_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3/comments","review_comment_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/3/comments","statuses_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/statuses/af256c411d2d73f2774c9cfbe34b0441446e6fc6","head":{"label":"sehlstrom:patch-2","ref":"patch-2","sha":"af256c411d2d73f2774c9cfbe34b0441446e6fc6","user":{"login":"sehlstrom","id":3474084,"avatar_url":"https://avatars.githubusercontent.com/u/3474084?v=3","gravatar_id":"","url":"https://api.github.com/users/sehlstrom","html_url":"https://github.com/sehlstrom","followers_url":"https://api.github.com/users/sehlstrom/followers","following_url":"https://api.github.com/users/sehlstrom/following{/other_user}","gists_url":"https://api.github.com/users/sehlstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sehlstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sehlstrom/subscriptions","organizations_url":"https://api.github.com/users/sehlstrom/orgs","repos_url":"https://api.github.com/users/sehlstrom/repos","events_url":"https://api.github.com/users/sehlstrom/events{/privacy}","received_events_url":"https://api.github.com/users/sehlstrom/received_events","type":"User","site_admin":false},"repo":{"id":40234900,"name":"Cosa-MQTT","full_name":"sehlstrom/Cosa-MQTT","owner":{"login":"sehlstrom","id":3474084,"avatar_url":"https://avatars.githubusercontent.com/u/3474084?v=3","gravatar_id":"","url":"https://api.github.com/users/sehlstrom","html_url":"https://github.com/sehlstrom","followers_url":"https://api.github.com/users/sehlstrom/followers","following_url":"https://api.github.com/users/sehlstrom/following{/other_user}","gists_url":"https://api.github.com/users/sehlstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/sehlstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sehlstrom/subscriptions","organizations_url":"https://api.github.com/users/sehlstrom/orgs","repos_url":"https://api.github.com/users/sehlstrom/repos","events_url":"https://api.github.com/users/sehlstrom/events{/privacy}","received_events_url":"https://api.github.com/users/sehlstrom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sehlstrom/Cosa-MQTT","description":"MQTT for Cosa Arduino OOP Framework","fork":true,"url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT","forks_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/forks","keys_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/teams","hooks_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/hooks","issue_events_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/issues/events{/number}","events_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/events","assignees_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/assignees{/user}","branches_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/branches{/branch}","tags_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/tags","blobs_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/git/refs{/sha}","trees_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/statuses/{sha}","languages_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/languages","stargazers_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/stargazers","contributors_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/contributors","subscribers_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/subscribers","subscription_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/subscription","commits_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/commits{/sha}","git_commits_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/git/commits{/sha}","comments_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/comments{/number}","issue_comment_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/issues/comments{/number}","contents_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/contents/{+path}","compare_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/merges","archive_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/downloads","issues_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/issues{/number}","pulls_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/pulls{/number}","milestones_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/milestones{/number}","notifications_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/labels{/name}","releases_url":"https://api.github.com/repos/sehlstrom/Cosa-MQTT/releases{/id}","created_at":"2015-08-05T08:48:52Z","updated_at":"2015-08-05T08:48:52Z","pushed_at":"2015-08-05T09:25:52Z","git_url":"git://github.com/sehlstrom/Cosa-MQTT.git","ssh_url":"git@github.com:sehlstrom/Cosa-MQTT.git","clone_url":"https://github.com/sehlstrom/Cosa-MQTT.git","svn_url":"https://github.com/sehlstrom/Cosa-MQTT","homepage":null,"size":148,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mikaelpatel:master","ref":"master","sha":"5f4526dd18997fddcdb9a8261ae61512a8adfe2d","user":{"login":"mikaelpatel","id":2774083,"avatar_url":"https://avatars.githubusercontent.com/u/2774083?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaelpatel","html_url":"https://github.com/mikaelpatel","followers_url":"https://api.github.com/users/mikaelpatel/followers","following_url":"https://api.github.com/users/mikaelpatel/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpatel/subscriptions","organizations_url":"https://api.github.com/users/mikaelpatel/orgs","repos_url":"https://api.github.com/users/mikaelpatel/repos","events_url":"https://api.github.com/users/mikaelpatel/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpatel/received_events","type":"User","site_admin":false},"repo":{"id":36196464,"name":"Cosa-MQTT","full_name":"mikaelpatel/Cosa-MQTT","owner":{"login":"mikaelpatel","id":2774083,"avatar_url":"https://avatars.githubusercontent.com/u/2774083?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaelpatel","html_url":"https://github.com/mikaelpatel","followers_url":"https://api.github.com/users/mikaelpatel/followers","following_url":"https://api.github.com/users/mikaelpatel/following{/other_user}","gists_url":"https://api.github.com/users/mikaelpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaelpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaelpatel/subscriptions","organizations_url":"https://api.github.com/users/mikaelpatel/orgs","repos_url":"https://api.github.com/users/mikaelpatel/repos","events_url":"https://api.github.com/users/mikaelpatel/events{/privacy}","received_events_url":"https://api.github.com/users/mikaelpatel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikaelpatel/Cosa-MQTT","description":"MQTT for Cosa Arduino OOP Framework","fork":false,"url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT","forks_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/forks","keys_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/teams","hooks_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/hooks","issue_events_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/events{/number}","events_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/events","assignees_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/assignees{/user}","branches_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/branches{/branch}","tags_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/tags","blobs_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/statuses/{sha}","languages_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/languages","stargazers_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/stargazers","contributors_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/contributors","subscribers_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/subscribers","subscription_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/subscription","commits_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/contents/{+path}","compare_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/merges","archive_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/downloads","issues_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues{/number}","pulls_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls{/number}","milestones_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/milestones{/number}","notifications_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/labels{/name}","releases_url":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/releases{/id}","created_at":"2015-05-24T22:15:28Z","updated_at":"2015-08-04T17:22:44Z","pushed_at":"2015-08-05T09:26:40Z","git_url":"git://github.com/mikaelpatel/Cosa-MQTT.git","ssh_url":"git@github.com:mikaelpatel/Cosa-MQTT.git","clone_url":"https://github.com/mikaelpatel/Cosa-MQTT.git","svn_url":"https://github.com/mikaelpatel/Cosa-MQTT","homepage":null,"size":148,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3"},"html":{"href":"https://github.com/mikaelpatel/Cosa-MQTT/pull/3"},"issue":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/3"},"comments":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/mikaelpatel/Cosa-MQTT/statuses/af256c411d2d73f2774c9cfbe34b0441446e6fc6"}}}}