summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/src/bin/ble_bas_peripheral.rs6
-rw-r--r--examples/src/bin/ble_peripheral_onoff.rs4
-rw-r--r--nrf-softdevice-macro/src/lib.rs12
-rw-r--r--nrf-softdevice/src/ble/gatt_server.rs4
4 files changed, 13 insertions, 13 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index 2f0328b..31a258e 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -15,7 +15,7 @@ use embassy::executor::Executor;
use embassy::util::Forever;
use nrf_softdevice::ble::{
- gatt_server::{self, Server},
+ gatt_server::{self, Service},
peripheral,
};
use nrf_softdevice::{raw, Softdevice};
@@ -27,13 +27,13 @@ async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[nrf_softdevice::gatt_server(uuid = "180f")]
+#[nrf_softdevice::gatt_service(uuid = "180f")]
struct BatteryService {
#[characteristic(uuid = "2a19", read, notify)]
battery_level: u8,
}
-#[nrf_softdevice::gatt_server(uuid = "9e7312e0-2354-11eb-9f10-fbc30a62cf38")]
+#[nrf_softdevice::gatt_service(uuid = "9e7312e0-2354-11eb-9f10-fbc30a62cf38")]
struct FooService {
#[characteristic(uuid = "9e7312e0-2354-11eb-9f10-fbc30a63cf38", read, write, notify)]
foo: u16,
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs
index 7670c44..3666055 100644
--- a/examples/src/bin/ble_peripheral_onoff.rs
+++ b/examples/src/bin/ble_peripheral_onoff.rs
@@ -19,7 +19,7 @@ use embassy_nrf::interrupt::Priority;
use futures::pin_mut;
use nrf_softdevice::ble::{
- gatt_server::{self, Server},
+ gatt_server::{self, Service},
peripheral,
};
use nrf_softdevice::{raw, Softdevice};
@@ -31,7 +31,7 @@ async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[nrf_softdevice::gatt_server(uuid = "9e7312e0-2354-11eb-9f10-fbc30a62cf38")]
+#[nrf_softdevice::gatt_service(uuid = "9e7312e0-2354-11eb-9f10-fbc30a62cf38")]
struct FooService {
#[characteristic(uuid = "9e7312e0-2354-11eb-9f10-fbc30a63cf38", read, write, notify)]
foo: u16,
diff --git a/nrf-softdevice-macro/src/lib.rs b/nrf-softdevice-macro/src/lib.rs
index 4fdc4c2..99ce3af 100644
--- a/nrf-softdevice-macro/src/lib.rs
+++ b/nrf-softdevice-macro/src/lib.rs
@@ -14,7 +14,7 @@ mod uuid;
use crate::uuid::Uuid;
#[derive(Debug, FromMeta)]
-struct ServerArgs {
+struct ServiceArgs {
uuid: Uuid,
}
#[derive(Debug, FromMeta)]
@@ -40,11 +40,11 @@ struct Characteristic {
}
#[proc_macro_attribute]
-pub fn gatt_server(args: TokenStream, item: TokenStream) -> TokenStream {
+pub fn gatt_service(args: TokenStream, item: TokenStream) -> TokenStream {
let args = syn::parse_macro_input!(args as syn::AttributeArgs);
let mut struc = syn::parse_macro_input!(item as syn::ItemStruct);
- let args = match ServerArgs::from_list(&args) {
+ let args = match ServiceArgs::from_list(&args) {
Ok(v) => v,
Err(e) => {
return e.write_errors().into();
@@ -60,7 +60,7 @@ pub fn gatt_server(args: TokenStream, item: TokenStream) -> TokenStream {
.ident
.span()
.unwrap()
- .error("gatt_server structs must have named fields, not tuples.")
+ .error("gatt_service structs must have named fields, not tuples.")
.emit();
return TokenStream::new();
}
@@ -243,7 +243,7 @@ pub fn gatt_server(args: TokenStream, item: TokenStream) -> TokenStream {
#code_impl
}
- impl #ble::gatt_server::Server for #struct_name {
+ impl #ble::gatt_server::Service for #struct_name {
type Event = #event_enum_name;
fn uuid() -> #ble::Uuid {
@@ -279,7 +279,7 @@ pub fn gatt_client(args: TokenStream, item: TokenStream) -> TokenStream {
let args = syn::parse_macro_input!(args as syn::AttributeArgs);
let mut struc = syn::parse_macro_input!(item as syn::ItemStruct);
- let args = match ServerArgs::from_list(&args) {
+ let args = match ServiceArgs::from_list(&args) {
Ok(v) => v,
Err(e) => {
return e.write_errors().into();
diff --git a/nrf-softdevice/src/ble/gatt_server.rs b/nrf-softdevice/src/ble/gatt_server.rs
index ba6bc9c..aa66324 100644
--- a/nrf-softdevice/src/ble/gatt_server.rs
+++ b/nrf-softdevice/src/ble/gatt_server.rs
@@ -34,7 +34,7 @@ pub struct GattEvent<'a> {
pub data: &'a [u8],
}
-pub trait Server: Sized {
+pub trait Service: Sized {
type Event;
fn uuid() -> Uuid;
@@ -58,7 +58,7 @@ impl From<RawError> for RegisterError {
}
}
-pub fn register<S: Server>(_sd: &Softdevice) -> Result<S, RegisterError> {
+pub fn register<S: Service>(_sd: &Softdevice) -> Result<S, RegisterError> {
let mut service_handle: u16 = 0;
let ret = unsafe {
raw::sd_ble_gatts_service_add(