{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/2508","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/2508/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/2508/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/2508/events","html_url":"https://github.com/esp8266/Arduino/issues/2508","id":176439550,"number":2508,"title":"SPIFFS + ESP8266 + ArduinoIDE + Circular Buffer ","user":{"login":"MrD2","id":5084445,"avatar_url":"https://avatars.githubusercontent.com/u/5084445?v=3","gravatar_id":"","url":"https://api.github.com/users/MrD2","html_url":"https://github.com/MrD2","followers_url":"https://api.github.com/users/MrD2/followers","following_url":"https://api.github.com/users/MrD2/following{/other_user}","gists_url":"https://api.github.com/users/MrD2/gists{/gist_id}","starred_url":"https://api.github.com/users/MrD2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrD2/subscriptions","organizations_url":"https://api.github.com/users/MrD2/orgs","repos_url":"https://api.github.com/users/MrD2/repos","events_url":"https://api.github.com/users/MrD2/events{/privacy}","received_events_url":"https://api.github.com/users/MrD2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-12T17:49:41Z","updated_at":"2016-09-27T20:38:08Z","closed_at":null,"body":"Hello,\r\n\r\nI'm using the SPIFFS File System and i would like to make a buffer to store data when my internet connection is down. I intended to make a circular buffer using for example 32KB of Flash memory...\r\n\r\nI made a class using the SPIFFS and taking advantage of the File Like usability of the SPIFFS when reading File type i would use the File.seek() method to point where i write to. The problem is that i can't  after this change where i start to read from (because seek points both the read and write pointers in the File Class)\r\n\r\n\r\nCan anyone help me? My file configuration is something like this\r\n```\r\n**********************             \r\n*     Header stuff   *            \r\n**********************              \r\n*                   *              \r\n*      Actual buffer *              \r\n*           is here  *              \r\n*                     *\r\n**********************\r\n```\r\nAt the beginning of the file is the header where the information of BUFFER_TAIL, BUFFER_HEAD, BUFFER_SIZE and FREE_POSITIONS are stored.\r\nI would like to know how i can use the File class READ and WRITE pointers to my advantaging using them to refresh BUFFER_TAIL and BUFFER_HEAD eveytime i reset the node for example... power goes down and what not.\r\n\r\nThank you for your time"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/249990912","html_url":"https://github.com/esp8266/Arduino/issues/2508#issuecomment-249990912","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/2508","id":249990912,"user":{"login":"stickbreaker","id":2858309,"avatar_url":"https://avatars.githubusercontent.com/u/2858309?v=3","gravatar_id":"","url":"https://api.github.com/users/stickbreaker","html_url":"https://github.com/stickbreaker","followers_url":"https://api.github.com/users/stickbreaker/followers","following_url":"https://api.github.com/users/stickbreaker/following{/other_user}","gists_url":"https://api.github.com/users/stickbreaker/gists{/gist_id}","starred_url":"https://api.github.com/users/stickbreaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickbreaker/subscriptions","organizations_url":"https://api.github.com/users/stickbreaker/orgs","repos_url":"https://api.github.com/users/stickbreaker/repos","events_url":"https://api.github.com/users/stickbreaker/events{/privacy}","received_events_url":"https://api.github.com/users/stickbreaker/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T20:38:08Z","updated_at":"2016-09-27T20:38:08Z","body":"I agree, you will have to eject an entire message to keep the ring usable. \r\n\r\nMy simple example has a hard time with multi-byte blocks or random length strings.  Your examples of fixed length records or self contained packets are more real World.  \r\n\r\nYou might consider a callback in your object class, who's purpose is to detect the item boundaries.\r\nThis user supplied function would be used by the __recall()__ function to identify where the next element ends.  The helper functions would walk through the ring building the return value until they have matched the count returned by the callback.\r\n\r\nThis sound like it could be useful addition to the ESP project.\r\n\r\nGood luck, the devil is in the details ;)\r\n\r\nChuck."}}
{"actor":{"display_login":"stickbreaker"}}