import json


def parsePostData(data):
 """Parses the data submitted by the camera to the portal url

 Returns:
  {
   'accountinfo': {
    'signinid': 'appstore email address',
    'accountid': 'appstore portal id',
    'registered': '1',
   },
   'applications': [{
    'name': 'application name',
    'version': 'application version',
   }, ...],
   'deviceinfo': {
    'deviceid': 'device id',
    'fwversion': 'firmware version',
    'productcode': 'product code',
    'name': 'camera name',
    'battery': 'battery level',
    'freespace': 'free space',
    'storagetotalsize': 'total space',
   },
   'session': {
    'correlationid': 'correlation id',
   },
   'profileversion': {
    'version': '1',
   },
  }
 """
 return json.loads(data.decode('latin1'))