code: func (af biotFormatter) Format(event *contract.Event) []byte {
  	bm, err := newBIoTMessage()
  	if err != nil {
  		LoggingClient.Error(fmt.Sprintf("error creating a new BIoT message: %s", err))
  		return []byte{}
  	}
  	bm.TpId = event.Device
  	bm.TId = string(event.Origin)
  	rawdata, err := json.Marshal(event)
  	if err != nil {
  		LoggingClient.Error(fmt.Sprintf("error parsing Event data to BIoTMessage : %s", err))
  		return []byte{}
  	}
  	bm.Data = rawdata
  	msg, err := json.Marshal(bm)
  	if err != nil {
  		LoggingClient.Error(fmt.Sprintf("error parsing BIoTMessage to data: %s", err))
  		return []byte{}
  	}
  	return msg
  }
docs: // Format method does all foramtting job.