Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9742357ybi; Wed, 10 Jul 2019 16:10:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF+slTFiDQXT5/uTeBf+PcgVAzE/YSdYSfz9URlhXcd7HXCQ4F5lKJjPm7F08AR7UvkT5K X-Received: by 2002:a17:90a:3ae8:: with SMTP id b95mr973834pjc.68.1562800244511; Wed, 10 Jul 2019 16:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562800244; cv=none; d=google.com; s=arc-20160816; b=SlvTxSGOwGDy2F0NHcFBZrWn4twK2CZhLbkMPTp7iY9Cdw/oYIqkVXNk1/BaZemkk+ L971zwHB9DeMyGvxK3MaoxTaJVX72RlvkXj35+5PP1ZHAHvnJGSzkXeAIdamCOzIxMRz SYKIWVNcc20Uzp4+4/YR9eq5DYi45jng31/tXNeUZFWPDDVrUH98PxNQu+xtg9UkRXvr 1XrJRFl13qUqGiK/oRWFUa7P//6QjWuM4LyHsp1QlqZvnFyXOQWNzFwyjAoW+8boDW3W Xt/KmjY0bA9/do61ecWsFaaeICOwTnrM154zqBqDP8OLRoeerNtVFEXXiarKD0xZ0m4+ f+Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Mw1Q+0sM+KVxvd9e93DSEhYOn4RfOuAAcIJ7RC9dFVs=; b=UcMLt9M1BdxeM8e8PF+zYMQJ2h+MUDmAf3rIt5Fzzg8TDiN6ueFo2uEPRK7jm8gCN2 RbpH8nxy3nIwD4rYRdqYec10INlwdvUBTqhKVgbIqyhhlhAE2cFu4keFbbFEhDltfAWm iAQSmuXqeFQ2Nv4YESQzAyhN8YbglvcUJcpItQ7dBwyVIQRR48LRkd/VeqmN58QxeTkw ja0mFCHt6mEEdSkA16uj4DE7x+ut4ztoAYnVctMp7H+pkv1fD1prm7h0MGvJq3WEYo0a o0xPgLLzF3JThUx+0eC5MtEbYi79331MJForyxF7G88kSumXBnO/nZRihvseGmOO3wnW 9TUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si3322802plx.200.2019.07.10.16.10.29; Wed, 10 Jul 2019 16:10:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727401AbfGJXIY (ORCPT + 99 others); Wed, 10 Jul 2019 19:08:24 -0400 Received: from mga14.intel.com ([192.55.52.115]:52368 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbfGJXIY (ORCPT ); Wed, 10 Jul 2019 19:08:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 16:08:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,476,1557212400"; d="scan'208";a="186250405" Received: from bgix-dell-lap.sea.intel.com ([10.255.80.129]) by fmsmga001.fm.intel.com with ESMTP; 10 Jul 2019 16:08:24 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: inga.stotland@intel.com, michal.lowas-rzechonek@silvair.com, brian.gix@intel.com Subject: [PATCH BlueZ 4/8] mesh: Expose mapping function for D-Bus errors Date: Wed, 10 Jul 2019 16:07:53 -0700 Message-Id: <20190710230757.8425-5-brian.gix@intel.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20190710230757.8425-1-brian.gix@intel.com> References: <20190710230757.8425-1-brian.gix@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- mesh/mesh.c | 8 ++++---- mesh/mesh.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mesh/mesh.c b/mesh/mesh.c index 26acfd4dc..62c80c0f3 100644 --- a/mesh/mesh.c +++ b/mesh/mesh.c @@ -266,7 +266,7 @@ static void prov_disc_cb(struct l_dbus *bus, void *user_data) free_pending_join_call(true); } -static const char *prov_status_str(uint8_t status) +const char *mesh_prov_status_str(uint8_t status) { switch (status) { case PROV_ERR_SUCCESS: @@ -301,7 +301,7 @@ static void send_join_failed(const char *owner, const char *path, MESH_APPLICATION_INTERFACE, "JoinFailed"); - l_dbus_message_set_arguments(msg, "s", prov_status_str(status)); + l_dbus_message_set_arguments(msg, "s", mesh_prov_status_str(status)); l_dbus_send(dbus_get_bus(), msg); free_pending_join_call(true); @@ -316,7 +316,7 @@ static bool prov_complete_cb(void *user_data, uint8_t status, const char *path; const uint8_t *token; - l_debug("Provisioning complete %s", prov_status_str(status)); + l_debug("Provisioning complete %s", mesh_prov_status_str(status)); if (!join_pending) return false; @@ -342,7 +342,7 @@ static bool prov_complete_cb(void *user_data, uint8_t status, l_dbus_message_set_arguments(msg, "t", l_get_be64(token)); - l_dbus_send(dbus_get_bus(), msg); + l_dbus_send(dbus, msg); free_pending_join_call(false); diff --git a/mesh/mesh.h b/mesh/mesh.h index 14b1fb517..2ef77b57d 100644 --- a/mesh/mesh.h +++ b/mesh/mesh.h @@ -42,3 +42,4 @@ bool mesh_send_pkt(uint8_t count, uint16_t interval, uint8_t *data, bool mesh_send_cancel(const uint8_t *filter, uint8_t len); bool mesh_reg_prov_rx(prov_rx_cb_t cb, void *user_data); void mesh_unreg_prov_rx(prov_rx_cb_t cb); +const char *mesh_prov_status_str(uint8_t status); -- 2.14.5