{"action":"created","issue":{"url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/324","labels_url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/324/comments","events_url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/324/events","html_url":"https://github.com/mikaelpatel/Cosa/issues/324","id":57235518,"number":324,"title":"Add support for ICMP and ping messages using the W5100 and ethernet shield","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-10T20:57:53Z","updated_at":"2015-02-10T21:41:08Z","closed_at":null,"body":"Add support for the ICMP allowing to send e.g. ping messages using the W5100 and ethernet shield.\r\n\r\nA implementation of the protocol is available for ordinary Arduino boards by the use of the ICMPPing library (http://playground.arduino.cc/Code/ICMPPing).\r\n\r\nI will gladly contribute to the Cosa project given I get some guidance about where to start in the library. My guess is that the following is needed to be done at least:\r\n* ICMP needs to be added to the `enum Protocol` of the Socket.hh file. \r\n* The function `W5100::Driver::open(Protocol proto, uint16_t port, uint8_t flag)` needs modification:\r\n    * Setup for the the ICMP protocol using an `if`-statement\r\n    * Status validation of the ICMP protocol\r\n* The header file W5100.hh needs the addition of the Socket Mode Register bitfield for ICMP\r\n* The function `W5100::Driver::recv(void* buf, size_t len, uint8_t src[4], uint16_t& port)` needs modification:\r\n    * Add `case MR_PROTO_ICMP `"},"comment":{"url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/comments/73789812","html_url":"https://github.com/mikaelpatel/Cosa/issues/324#issuecomment-73789812","issue_url":"https://api.github.com/repos/mikaelpatel/Cosa/issues/324","id":73789812,"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},"created_at":"2015-02-10T21:41:08Z","updated_at":"2015-02-10T21:41:08Z","body":"@mikaelpatel \r\nThe motivation for this is to be able to ping e.g. a phone connected to the home LAN. By dedicating an IP to the MAC of the phone, you always know what adress to ping. If the phone responds to the ping, one can assume that the owner of the phone is at home. Then the Arduino can make actions based on the presence of the phone, e.g. turn on all the lights when the phone comes home or turn of the coffee machine when the phone no longer is available.\r\n\r\nI'll start by sketching a PING interface.\r\n\r\nAnd yes, I saw that the ICMPPing library sent the ping messages using the RAW message when looking deeper into the code."}}