{"_id":"576d42354bcd290e00428963","category":{"_id":"576d42354bcd290e00428945","__v":0,"version":"576d42354bcd290e00428941","project":"56a526d4e7a1622b0024fae4","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-15T12:30:41.336Z","from_sync":false,"order":2,"slug":"components","title":"Concepts"},"__v":6,"project":"56a526d4e7a1622b0024fae4","user":"56bc6af27c91881900089bac","version":{"_id":"576d42354bcd290e00428941","project":"56a526d4e7a1622b0024fae4","__v":1,"createdAt":"2016-06-24T14:22:45.076Z","releaseDate":"2016-06-24T14:22:45.076Z","categories":["576d42354bcd290e00428942","576d42354bcd290e00428943","576d42354bcd290e00428944","576d42354bcd290e00428945","576d42354bcd290e00428946","576d42354bcd290e00428947"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"parentDoc":null,"updates":["57a1eb3bf724ae1900df48dc"],"next":{"pages":[],"description":""},"createdAt":"2016-02-11T16:49:54.415Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Data sizes\n\nWhen devices communicate over the air they are restricted to sending a small amount of data (50 bits). We refer to these chirps as offline as they do not rely on a network connection at any point either to send or receive.\n\nEach device needs to only be online at the moment it wants to create or retrieve a chirp and its associated data. This means that the sending device need only be online to create the chirp and upload its data - after which it can chirp without being online using only that chirp's identifier. \n\nSimilarly the receiving device is able to hear shortcode identifier whilst being offline but must be online to retrieve any associated data.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**create**\\n\\nAssociate data with a identifier\",\n    \"h-0\": \"action\",\n    \"h-1\": \"online\",\n    \"h-2\": \"offline\",\n    \"0-1\": \"YES\",\n    \"0-2\": \"NO\",\n    \"1-0\": \"**send**\\n\\nPlay a chirp over the loudspeaker\",\n    \"1-1\": \"YES\",\n    \"1-2\": \"YES\",\n    \"2-0\": \"**receive**\\n\\nHear a chirp through the microphone\",\n    \"2-1\": \"YES\",\n    \"2-2\": \"YES\",\n    \"3-0\": \"**get**\\n\\nRetrieve data associated with a identifier.\",\n    \"3-1\": \"YES\",\n    \"3-2\": \"NO\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\nAs outlined above, the data associated with chirps may only be added with a network connection at the time it is created. However, the actual sending and detection of any particular identifier may happen completely offline.\n\n\n## Online\n\nIf data is created 'live' on the sending device and its size is above the standard 50 bit limit then a network connection will need to be present on both the sender and receiver in order to facilitate the transmission of the data associated with the chirp identifier.\n\n## Online / Offline\n\nYou are able to create and associate data ahead of time such that only the receiving device need to be online when a chirp is heard. If your use-case allows, the device may even be able to acknowledge hearing a identifier while offline and later retrieve the data associated with that identifier when network connectivity is restored.\n\n## Offline\n\nAlternatively, if your data fits within the 50 bit limit of the identifier, you can encode it in the identifier which is broadcast over the air, meaning neither sender nor receiver need be online to exchange information.","excerpt":"","slug":"online-and-offline-operation","type":"basic","title":"Online vs offline chirps"}

Online vs offline chirps


## Data sizes When devices communicate over the air they are restricted to sending a small amount of data (50 bits). We refer to these chirps as offline as they do not rely on a network connection at any point either to send or receive. Each device needs to only be online at the moment it wants to create or retrieve a chirp and its associated data. This means that the sending device need only be online to create the chirp and upload its data - after which it can chirp without being online using only that chirp's identifier. Similarly the receiving device is able to hear shortcode identifier whilst being offline but must be online to retrieve any associated data. [block:parameters] { "data": { "0-0": "**create**\n\nAssociate data with a identifier", "h-0": "action", "h-1": "online", "h-2": "offline", "0-1": "YES", "0-2": "NO", "1-0": "**send**\n\nPlay a chirp over the loudspeaker", "1-1": "YES", "1-2": "YES", "2-0": "**receive**\n\nHear a chirp through the microphone", "2-1": "YES", "2-2": "YES", "3-0": "**get**\n\nRetrieve data associated with a identifier.", "3-1": "YES", "3-2": "NO" }, "cols": 3, "rows": 4 } [/block] As outlined above, the data associated with chirps may only be added with a network connection at the time it is created. However, the actual sending and detection of any particular identifier may happen completely offline. ## Online If data is created 'live' on the sending device and its size is above the standard 50 bit limit then a network connection will need to be present on both the sender and receiver in order to facilitate the transmission of the data associated with the chirp identifier. ## Online / Offline You are able to create and associate data ahead of time such that only the receiving device need to be online when a chirp is heard. If your use-case allows, the device may even be able to acknowledge hearing a identifier while offline and later retrieve the data associated with that identifier when network connectivity is restored. ## Offline Alternatively, if your data fits within the 50 bit limit of the identifier, you can encode it in the identifier which is broadcast over the air, meaning neither sender nor receiver need be online to exchange information.