Skip to content

Commit

Permalink
Merge pull request #245 from alexmoon/gatt-client-macro
Browse files Browse the repository at this point in the history
Fix a couple of gatt_client macro bugs
  • Loading branch information
Dirbaio authored Mar 19, 2024
2 parents 3ef927b + 73ce069 commit e769274
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nrf-softdevice-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ pub fn gatt_client(args: TokenStream, item: TokenStream) -> TokenStream {
#cccd_handle: 0,
));
code_disc_done.extend(quote_spanned!(ch.span=>
if self.#value_handle == 0 {
if self.#cccd_handle == 0 {
return Err(#ble::gatt_client::DiscoverError::ServiceIncomplete);
}
));
Expand Down Expand Up @@ -746,6 +746,7 @@ pub fn gatt_client(args: TokenStream, item: TokenStream) -> TokenStream {
let uuid = args.uuid;
struct_fields.named = syn::punctuated::Punctuated::from_iter(fields);

let vis = struc.vis.clone();
let result = quote! {
#struc

Expand Down Expand Up @@ -789,7 +790,7 @@ pub fn gatt_client(args: TokenStream, item: TokenStream) -> TokenStream {
}
}

enum #event_enum_name {
#vis enum #event_enum_name {
#code_event_enum
}
};
Expand Down

0 comments on commit e769274

Please sign in to comment.