Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NdefFormatableInterface.cs
1using Android.Nfc;
2using Android.Nfc.Tech;
5
7{
13 public class NdefFormatableInterface(Tag Tag, NdefFormatable Technology)
14 : NfcInterface(Tag, Technology), INdefFormatableInterface
15 {
16 private readonly NdefFormatable ndefFormatable = Technology;
17
24 public async Task<bool> Format(bool ReadOnly, params object[] Items)
25 {
26 try
27 {
28 NdefMessage Message = await NdefInterface.CreateMessage(Items);
29
30 if (ReadOnly)
31 await this.ndefFormatable.FormatReadOnlyAsync(Message);
32 else
33 await this.ndefFormatable.FormatAsync(Message);
34
35 return true;
36 }
37 catch (Exception ex)
38 {
39 ServiceRef.LogService.LogException(ex);
40 return false;
41 }
42 }
43
44 }
45}
Base class that references services in the app.
Definition: ServiceRef.cs:31
static ILogService LogService
Log service.
Definition: ServiceRef.cs:91
NDEF Formatable interface, for communication with an NFC Tag.