summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Collins <ccollins@apache.org>2016-08-10 14:13:31 -0700
committerChristopher Collins <ccollins@apache.org>2016-08-10 14:13:31 -0700
commite291e12d37c24f3124553dea454b303d561a7cb2 (patch)
tree52491d98aeaa0425edcc200c76e34792df2a59a8
parent8ec1b8d9aa8b33a1a26e0d47841331870e97cd88 (diff)
parentddba2ab6bacd04aa16151e09b93568b42b4b117e (diff)
This closes #88.
Merge remote-tracking branch 'bgiori/refactor-services' into develop * bgiori/refactor-services: Refactored file structure for premade services.
-rw-r--r--apps/blecent/pkg.yml3
-rwxr-xr-xapps/blecent/src/main.c4
-rw-r--r--apps/bleprph/pkg.yml3
-rwxr-xr-xapps/bleprph/src/main.c4
-rw-r--r--apps/bletiny/pkg.yml3
-rwxr-xr-xapps/bletiny/src/main.c4
-rw-r--r--apps/bleuart/pkg.yml3
-rwxr-xr-xapps/bleuart/src/main.c4
-rw-r--r--net/nimble/host/services/gap/include/services/gap/ble_svc_gap.h (renamed from net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gap.h)0
-rw-r--r--net/nimble/host/services/gap/pkg.yml31
-rw-r--r--net/nimble/host/services/gap/src/ble_svc_gap.c (renamed from net/nimble/host/services/mandatory/src/ble_svc_gap.c)2
-rw-r--r--net/nimble/host/services/gatt/include/services/gatt/ble_svc_gatt.h29
-rw-r--r--net/nimble/host/services/gatt/pkg.yml (renamed from net/nimble/host/services/mandatory/pkg.yml)5
-rw-r--r--net/nimble/host/services/gatt/src/ble_svc_gatt.c (renamed from net/nimble/host/services/mandatory/src/ble_svc_gatt.c)2
-rw-r--r--net/nimble/host/services/lls/include/services/lls/ble_svc_lls.h (renamed from net/nimble/host/profiles/lls/include/profiles/lls/ble_svc_lls.h)0
-rw-r--r--net/nimble/host/services/lls/pkg.yml (renamed from net/nimble/host/profiles/lls/pkg.yml)4
-rw-r--r--net/nimble/host/services/lls/src/ble_svc_lls.c (renamed from net/nimble/host/profiles/lls/src/ble_svc_lls.c)2
-rw-r--r--net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gatt.h10
18 files changed, 83 insertions, 30 deletions
diff --git a/apps/blecent/pkg.yml b/apps/blecent/pkg.yml
index 3798fee1..b413fad1 100644
--- a/apps/blecent/pkg.yml
+++ b/apps/blecent/pkg.yml
@@ -27,7 +27,8 @@ pkg.deps:
- sys/log
- net/nimble/controller
- net/nimble/host
- - net/nimble/host/services/mandatory
+ - net/nimble/host/services/gap
+ - net/nimble/host/services/gatt
- net/nimble/host/store/ram
- net/nimble/transport/ram
- libs/console/full
diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c
index 2b89a11c..d5f47e6b 100755
--- a/apps/blecent/src/main.c
+++ b/apps/blecent/src/main.c
@@ -36,8 +36,8 @@
#include "store/ram/ble_store_ram.h"
/* Mandatory services. */
-#include "services/mandatory/ble_svc_gap.h"
-#include "services/mandatory/ble_svc_gatt.h"
+#include "services/gap/ble_svc_gap.h"
+#include "services/gatt/ble_svc_gatt.h"
/* Application-specified header. */
#include "blecent.h"
diff --git a/apps/bleprph/pkg.yml b/apps/bleprph/pkg.yml
index 7c45ee28..cfc8e3ba 100644
--- a/apps/bleprph/pkg.yml
+++ b/apps/bleprph/pkg.yml
@@ -27,7 +27,8 @@ pkg.deps:
- sys/log
- net/nimble/controller
- net/nimble/host
- - net/nimble/host/services/mandatory
+ - net/nimble/host/services/gap
+ - net/nimble/host/services/gatt
- net/nimble/host/store/ram
- net/nimble/transport/ram
- libs/console/full
diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c
index 961ed4b2..b08b0772 100755
--- a/apps/bleprph/src/main.c
+++ b/apps/bleprph/src/main.c
@@ -48,8 +48,8 @@
#include "store/ram/ble_store_ram.h"
/* Mandatory services. */
-#include "services/mandatory/ble_svc_gap.h"
-#include "services/mandatory/ble_svc_gatt.h"
+#include "services/gap/ble_svc_gap.h"
+#include "services/gatt/ble_svc_gatt.h"
/* Newtmgr include */
#include "newtmgr/newtmgr.h"
diff --git a/apps/bletiny/pkg.yml b/apps/bletiny/pkg.yml
index 625adc64..9a8b08f5 100644
--- a/apps/bletiny/pkg.yml
+++ b/apps/bletiny/pkg.yml
@@ -27,7 +27,8 @@ pkg.deps:
- sys/log
- net/nimble/controller
- net/nimble/host
- - net/nimble/host/services/mandatory
+ - net/nimble/host/services/gap
+ - net/nimble/host/services/gatt
- net/nimble/host/store/ram
- net/nimble/transport/ram
- libs/console/full
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index f2941e71..469944cf 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -53,8 +53,8 @@
#include "store/ram/ble_store_ram.h"
/* Mandatory services. */
-#include "services/mandatory/ble_svc_gap.h"
-#include "services/mandatory/ble_svc_gatt.h"
+#include "services/gap/ble_svc_gap.h"
+#include "services/gatt/ble_svc_gatt.h"
/* XXX: An app should not include private headers from a library. The bletiny
* app uses some of nimble's internal details for logging.
diff --git a/apps/bleuart/pkg.yml b/apps/bleuart/pkg.yml
index c93011b9..7a7d20e3 100644
--- a/apps/bleuart/pkg.yml
+++ b/apps/bleuart/pkg.yml
@@ -27,7 +27,8 @@ pkg.deps:
- sys/log
- net/nimble/controller
- net/nimble/host
- - net/nimble/host/services/mandatory
+ - net/nimble/host/services/gap
+ - net/nimble/host/services/gatt
- net/nimble/host/store/ram
- net/nimble/transport/ram
- libs/console/full
diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c
index 061ab3b9..264be923 100755
--- a/apps/bleuart/src/main.c
+++ b/apps/bleuart/src/main.c
@@ -47,8 +47,8 @@
#include "store/ram/ble_store_ram.h"
/* Mandatory services. */
-#include "services/mandatory/ble_svc_gap.h"
-#include "services/mandatory/ble_svc_gatt.h"
+#include "services/gap/ble_svc_gap.h"
+#include "services/gatt/ble_svc_gatt.h"
/* Newtmgr include */
#include "newtmgr/newtmgr.h"
diff --git a/net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gap.h b/net/nimble/host/services/gap/include/services/gap/ble_svc_gap.h
index 95d4226c..95d4226c 100644
--- a/net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gap.h
+++ b/net/nimble/host/services/gap/include/services/gap/ble_svc_gap.h
diff --git a/net/nimble/host/services/gap/pkg.yml b/net/nimble/host/services/gap/pkg.yml
new file mode 100644
index 00000000..b84e8161
--- /dev/null
+++ b/net/nimble/host/services/gap/pkg.yml
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+pkg.name: net/nimble/host/services/gap
+pkg.description: Implements the GAP Service.
+pkg.author: "Apache Mynewt <dev@mynewt.incubator.apache.org>"
+pkg.homepage: "http://mynewt.apache.org/"
+pkg.keywords:
+ - ble
+ - bluetooth
+ - nimble
+ - gap
+
+pkg.deps:
+ - net/nimble/host
diff --git a/net/nimble/host/services/mandatory/src/ble_svc_gap.c b/net/nimble/host/services/gap/src/ble_svc_gap.c
index d49396d8..1a2e8a48 100644
--- a/net/nimble/host/services/mandatory/src/ble_svc_gap.c
+++ b/net/nimble/host/services/gap/src/ble_svc_gap.c
@@ -20,7 +20,7 @@
#include <assert.h>
#include <string.h>
#include "host/ble_hs.h"
-#include "services/mandatory/ble_svc_gap.h"
+#include "services/gap/ble_svc_gap.h"
/* XXX: This should be configurable. */
#define BLE_SVC_GAP_NAME_MAX_LEN 31
diff --git a/net/nimble/host/services/gatt/include/services/gatt/ble_svc_gatt.h b/net/nimble/host/services/gatt/include/services/gatt/ble_svc_gatt.h
new file mode 100644
index 00000000..320a3ff1
--- /dev/null
+++ b/net/nimble/host/services/gatt/include/services/gatt/ble_svc_gatt.h
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_SVC_GATT_
+#define H_BLE_SVC_GATT_
+
+struct ble_hs_cfg;
+
+#define BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16 0x2a05
+
+int ble_svc_gatt_init(struct ble_hs_cfg *cfg);
+
+#endif
diff --git a/net/nimble/host/services/mandatory/pkg.yml b/net/nimble/host/services/gatt/pkg.yml
index b63c6342..b8fdabe1 100644
--- a/net/nimble/host/services/mandatory/pkg.yml
+++ b/net/nimble/host/services/gatt/pkg.yml
@@ -17,8 +17,8 @@
# under the License.
#
-pkg.name: net/nimble/host/services/mandatory
-pkg.description: Implements the two mandatory GATT services (GAP and GATT).
+pkg.name: net/nimble/host/services/gatt
+pkg.description: Implements the GATT service.
pkg.author: "Apache Mynewt <dev@mynewt.incubator.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
@@ -26,7 +26,6 @@ pkg.keywords:
- bluetooth
- nimble
- gatt
- - gap
pkg.deps:
- net/nimble/host
diff --git a/net/nimble/host/services/mandatory/src/ble_svc_gatt.c b/net/nimble/host/services/gatt/src/ble_svc_gatt.c
index 0e8a139e..74d3ac97 100644
--- a/net/nimble/host/services/mandatory/src/ble_svc_gatt.c
+++ b/net/nimble/host/services/gatt/src/ble_svc_gatt.c
@@ -20,7 +20,7 @@
#include <assert.h>
#include "host/ble_hs.h"
-#include "services/mandatory/ble_svc_gatt.h"
+#include "services/gatt/ble_svc_gatt.h"
static int
ble_svc_gatt_access(uint16_t conn_handle, uint16_t attr_handle,
diff --git a/net/nimble/host/profiles/lls/include/profiles/lls/ble_svc_lls.h b/net/nimble/host/services/lls/include/services/lls/ble_svc_lls.h
index 8dee7796..8dee7796 100644
--- a/net/nimble/host/profiles/lls/include/profiles/lls/ble_svc_lls.h
+++ b/net/nimble/host/services/lls/include/services/lls/ble_svc_lls.h
diff --git a/net/nimble/host/profiles/lls/pkg.yml b/net/nimble/host/services/lls/pkg.yml
index 5d951b64..d45c49bb 100644
--- a/net/nimble/host/profiles/lls/pkg.yml
+++ b/net/nimble/host/services/lls/pkg.yml
@@ -17,8 +17,8 @@
# under the License.
#
-pkg.name: net/nimble/host/profiles/lls
-pkg.description: Link Loss Service adopted specification.
+pkg.name: net/nimble/host/services/lls
+pkg.description: Link Loss Service Implementation.
pkg.author: "Apache Mynewt <dev@mynewt.incubator.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
diff --git a/net/nimble/host/profiles/lls/src/ble_svc_lls.c b/net/nimble/host/services/lls/src/ble_svc_lls.c
index a0688281..3371fda8 100644
--- a/net/nimble/host/profiles/lls/src/ble_svc_lls.c
+++ b/net/nimble/host/services/lls/src/ble_svc_lls.c
@@ -20,7 +20,7 @@
#include <assert.h>
#include <string.h>
#include "host/ble_hs.h"
-#include "profiles/lls/ble_svc_lls.h"
+#include "services/lls/ble_svc_lls.h"
/* Callback function */
static ble_svc_lls_event_fn *cb_fn;
diff --git a/net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gatt.h b/net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gatt.h
deleted file mode 100644
index d2438c22..00000000
--- a/net/nimble/host/services/mandatory/include/services/mandatory/ble_svc_gatt.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef H_BLE_SVC_GATT_
-#define H_BLE_SVC_GATT_
-
-struct ble_hs_cfg;
-
-#define BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16 0x2a05
-
-int ble_svc_gatt_init(struct ble_hs_cfg *cfg);
-
-#endif