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y42MTY0NjQ3OTM2NTkxMTIsIi0yMCJdLCJpY29uIjoiaW1hZ2VzL21vb24ucG5nIn1dLCJfY2FsbGJhY2siOiJvblJldHVybkZyb21BdWdtZW50ZWRSZWFsaXR5IiwiX3ZlcnNpb24iOiIxLjAuMyIsIl9wb3N0VVJMIjoiaHR0cDovL2FwaS5icmlkZ2VpdC5tb2JpL2VjaG8vYmxvYiIsIl9jb21tYW5kIjoiYXVnIiwiX2lkIjoiX3NvbGFyIiwiX3NlcSI6MTM5MDg0NzA2NTk0OSwiX3JldHVyblVSTCI6Imh0dHA6Ly9vcmQubG9jYWw6NDAwMC9zb2xhcjY0Lmh0bWwjYnJpZGdlaXQiLCJfcmVzdG9yZUhhc2giOiIifQ~~
contains the command:
{"locations":[
{"name":"Mercury","eqcoords":[21.81676478958142,"-13.9"],"icon":"images/mercury.png"}
,
{"name":"Venus","eqcoords":[18.886250809589388,"-15.9"],"icon":"images/venus.png"}
,
{"name":"Mars","eqcoords":[13.396049663604014,"-06.1"],"icon":"images/mars.png"}
,
{"name":"Jupiter","eqcoords":[6.914992400377073,"+23"],"icon":"images/jupiter.png"}
,
{"name":"Saturn","eqcoords":[15.349099981342727,"-16.1"],"icon":"images/saturn.png"}
,
{"name":"Uranus","eqcoords":[0.5708696982118745,"+03"],"icon":"images/uranus.png"}
,
{"name":"Neptune","eqcoords":[22.39657917027757,"-10.7"],"icon":"images/neptune.png"}
,
{"name":"Pluto","eqcoords":[18.848781311645723,"-20.2"],"icon":"images/pluto.png"}
,
{"name":"Sun","eqcoords":[20.648210815618395,"-18.4"],"icon":"images/sun.png"}
,
{"name":"Moon","eqcoords":[17.616464793659112,"-20"],"icon":"images/moon.png"}
],"_callback":"onReturnFromAugmentedReality","_version":"1.0.3","_postURL":"http://api.bridgeit.mobi/echo/blob","_command":"aug","_id":"_solar","_seq":1390847065949,"_returnURL":"http://ord.local:4000/solar64.html#bridgeit","_restoreHash":""}
These are 1448 and 1084 bytes respectively.
A simple name/value binary format will allow strings and images to be included directly in the payload via a sequence of:
[name][null][int32 length][value]
Nested values would not be directly supported (although a given value could be XML or JSON with no escaping) but the name would support a path /-separated structure that could be mapped directly onto a JavaScript object. A marker value would indicate that the associated value should be, say, encoded as base64 with a mime-type prefix.
name = <binary data>
name/_fix = "png64"
Where a collection of named "fix" rules would be supported by BridgeIt. "png64" would encode the binary data as base64 and prepend with "data:image/png;base64,". Various rules could be defined for other data types.