'form notification data in an enhanced format'

def _get_enhanced_notification(self, token_hex, payload, identifier, expiry):

    token = a2b_hex(token_hex)
    payload = payload.json()
    fmt = (ENHANCED_NOTIFICATION_FORMAT % len(payload))
    notification = pack(fmt, ENHANCED_NOTIFICATION_COMMAND, identifier, expiry, TOKEN_LENGTH, token, len(payload), payload)
    return notification
