{"action":"created","issue":{"url":"https://api.github.com/repos/firmata/arduino/issues/213","labels_url":"https://api.github.com/repos/firmata/arduino/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/firmata/arduino/issues/213/comments","events_url":"https://api.github.com/repos/firmata/arduino/issues/213/events","html_url":"https://github.com/firmata/arduino/pull/213","id":102129502,"number":213,"title":"Moving Firmata constants into separate file to allow direct linking in C projects","user":{"login":"evanlooij","id":477507,"avatar_url":"https://avatars.githubusercontent.com/u/477507?v=3","gravatar_id":"","url":"https://api.github.com/users/evanlooij","html_url":"https://github.com/evanlooij","followers_url":"https://api.github.com/users/evanlooij/followers","following_url":"https://api.github.com/users/evanlooij/following{/other_user}","gists_url":"https://api.github.com/users/evanlooij/gists{/gist_id}","starred_url":"https://api.github.com/users/evanlooij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanlooij/subscriptions","organizations_url":"https://api.github.com/users/evanlooij/orgs","repos_url":"https://api.github.com/users/evanlooij/repos","events_url":"https://api.github.com/users/evanlooij/events{/privacy}","received_events_url":"https://api.github.com/users/evanlooij/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T12:41:39Z","updated_at":"2015-08-25T09:27:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/firmata/arduino/pulls/213","html_url":"https://github.com/firmata/arduino/pull/213","diff_url":"https://github.com/firmata/arduino/pull/213.diff","patch_url":"https://github.com/firmata/arduino/pull/213.patch"},"body":"I'm working with ADArduino and iFirmata client libraries and found that each used its own (version of) the Firmata constants. Including Firmata.h doesn't work because of its dependencies on other arduino classes which have no place in a client library. The easiest solution is to move the constants into their own header file. To facilitate modular checking out and inclusion by way of Subversion externals, the Firmata_Constants header should be in its own folder.\r\nTo clarify, the structure that I'm proposing is:\r\n\r\narduino\r\n* constants\r\n   *  Firmata_Constants.h\r\n* Firmata.h        (#import \"Firmata_Constants.h\")\r\n* Firmata.cpp   (no changes)\r\n*   ...\r\n  "},"comment":{"url":"https://api.github.com/repos/firmata/arduino/issues/comments/134538429","html_url":"https://github.com/firmata/arduino/pull/213#issuecomment-134538429","issue_url":"https://api.github.com/repos/firmata/arduino/issues/213","id":134538429,"user":{"login":"evanlooij","id":477507,"avatar_url":"https://avatars.githubusercontent.com/u/477507?v=3","gravatar_id":"","url":"https://api.github.com/users/evanlooij","html_url":"https://github.com/evanlooij","followers_url":"https://api.github.com/users/evanlooij/followers","following_url":"https://api.github.com/users/evanlooij/following{/other_user}","gists_url":"https://api.github.com/users/evanlooij/gists{/gist_id}","starred_url":"https://api.github.com/users/evanlooij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanlooij/subscriptions","organizations_url":"https://api.github.com/users/evanlooij/orgs","repos_url":"https://api.github.com/users/evanlooij/repos","events_url":"https://api.github.com/users/evanlooij/events{/privacy}","received_events_url":"https://api.github.com/users/evanlooij/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T09:27:41Z","updated_at":"2015-08-25T09:27:41Z","body":"My client library makes extensive use of the Firmata constants: every request is build with them, every response is parsed with their help. However, I cannot just checkout or clone these constants from GitHub to include them in my library, confident that I have the correct constants, for whatever branch or tag I'm working on. \r\nIn the present setup, client libraries have to make their own copies and versions of those constants, with all the room for error that entails. By moving the constants into their own file, everybody can be singing from the same sheet, as it were. Client libraries can then, of course, redefine constants or make enums as they wish, but the source would be clear.\r\n<img width=\"960\" alt=\"firmata_constants\" src=\"https://cloud.githubusercontent.com/assets/477507/9463319/43e3b14c-4b1c-11e5-985b-53581446f98a.png\">\r\n\r\n"}}