Navigation

    • Login
    • Search
    • [[global:header.recent]]
    • [[global:header.tags]]
    • [[global:header.popular]]
    • [[global:header.groups]]
    • [[global:header.search]]

    [Project] An extensible (plugin based) windows service that performs actions for NFC events

    Ideas for using NFC Rings
    5
    38
    41247
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      maz_net_au last edited by

      So I've just made a C# .Net project using MEF that runs as a windows service, checks a USB nfc reader and triggers events "NFCTagDown" and "NFCTagUp" respectively, passing the ID of the ring across to the set of plugins. It is possible to run multiple plugins / actions for each event (you'd probably want to have some way to register an NFC tag to a plugin).

      The first attempt I made was to lock the PC with a swipe of the NFC ring (to go with my credentialprovider unlock project) but it seems that the new Session 0 isolation security measure blocks the service from performing this action. Even when I have marked the service as "Allow service to interact with desktop".

      Call to action:

      1. Does anyone have any ideas for how to lock a windows 8 / 10 pc from a service in C#? I've tried
        [DllImport("user32.dll")]
        public static extern bool LockWorkStation();
        and
        Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation");

      2. What other plugins / actions would people want to perform?

      3. What events are developers interested in for their own plugins?

      Apparently I can't upload files here so I've shared it off my website in case people wanted the code. When I have a plugin that works I'll push it to github. The code is under an MIT license. Go nuts with it.
      http://maz.net.au/Files/Public/NFCRingServiceCore.zip

      Note: this is for developers only at the moment. You need to use installutil.exe to install the service.

      1 Reply Last reply Reply Quote 2
      • M
        maz_net_au last edited by

        Got the lock workstation working. It's a bit more complicated than i had hoped but thats the advantage of a plugin framework. You put an 8kb dll into the plugins folder and it just works.

        1 Reply Last reply Reply Quote 0
        • M
          maz_net_au last edited by

          Code at the link above has been updated. New video showing it working is..

          What's next?

          J 1 Reply Last reply Reply Quote 1
          • johnyma22
            johnyma22 NFC Ring Team last edited by

            Wow, that's looking excellent!

            So the next step would be providing an easy to use interface for getting started.

            The basic startup interface should just handle registering of cards to accounts (so they can be used to unlock the current logged in user).

            Did we check to see if this works with accounts linked to Microsoft online accounts?

            1 Reply Last reply Reply Quote 0
            • J
              jasok2 @maz_net_au last edited by

              @maz_net_au Looking great :) cant wait to get the finished product

              1 Reply Last reply Reply Quote 0
              • M
                maz_net_au last edited by

                I don't know how much time I'm going to have in the short term. I am getting ready to move countries. I was hoping that the kickstarter would be run and that could be used for polishing / making installers / making it user friendly.
                I'll still try and work on this in my evenings and I'm definitely available to help other people get up to speed on what I've done.
                Maz

                1 Reply Last reply Reply Quote 2
                • johnyma22
                  johnyma22 NFC Ring Team last edited by

                  Yea that's the plan @maz_net_au

                  We didn't launch the KS yet as I'm waiting on Reader supplier confirmation from Lokki / our suppliers

                  1 Reply Last reply Reply Quote 0
                  • Lokki
                    Lokki Community Helper last edited by

                    One to go, I believe...

                    1 Reply Last reply Reply Quote 0
                    • M
                      maz_net_au last edited by

                      I found a memory leak in the service (in the sense that I noticed it was consuming 18gb of ram after 8 days. Hopefully that is now fixed but I'll have to keep an eye on it for a while to make sure.
                      Maz

                      johnyma22 1 Reply Last reply Reply Quote 4
                      • johnyma22
                        johnyma22 NFC Ring Team @maz_net_au last edited by

                        @maz_net_au Good spot!

                        1 Reply Last reply Reply Quote 0
                        • M
                          maz_net_au last edited by

                          It doesn't leak on the polling for NFC data (I need to remember to upload that code too) but it still uses about 300k - 500k for each lock / unlock cycle. On the upside, that is probably in the C# side of things so should be much easier to find.

                          Next time I get a chance, I'll look at linking the service and the credential provider (I have to extend the plugin framework to add events for PluginAdded, RegisterRing (to a particular plugin), DeregisterRing. I'm hoping to (or that someone else does) make a plugin that uses the data section of the ring to perform various tasks, almost like encoding a set of preferences into a tiny data structure.

                          As I get closer to moving overseas, I might actually have a few days to work on my own projects (once I've packed up my house and cancelled internet and stuff I'm limited as to how much work I can do before I fly out). Maybe I'll get to those features then if no one else has.

                          I've also looked at making an installer package and it shouldn't be too hard when it only has to support windows. 7, 8, 8.1 and 10 should be achievable (Vista may or may not work but in theory I've not used any features introduced since then) but I'll need help testing.

                          1 Reply Last reply Reply Quote 0
                          • M
                            maz_net_au last edited by

                            Code updated at that same link (fixing the memory leak which was in the WinAPIWrapper.dll). It's now 5mb and includes my WinAPIWrapper c++ project that I'm using to talk to the nfc reader.
                            Anyone who has installed the service, I'd at least recommend that you copy the latest x64 release WinAPIWrapper.dll into your service directory.

                            1 Reply Last reply Reply Quote 1
                            • M
                              maz_net_au last edited by

                              In the interest of supporting more devices. Could people post what USB NFC readers they have? I'm using an ACS ACR122U and i've been told about the HID-OMNIKEY 6321 having issues. If people can tell me what devices they're using then I can buy them to test with. Thanks
                              Maz

                              1 Reply Last reply Reply Quote 0
                              • L
                                Laszlo last edited by

                                Maybe try to add ACR1252U, ACR122T, SCM SCL3711 devices to the compatibility list

                                1 Reply Last reply Reply Quote 0
                                • johnyma22
                                  johnyma22 NFC Ring Team last edited by

                                  The problem w/ the 6321 is that it shows up as two smart card readers. You could replicate this problem by having 2x ACR122Us plugged in :)

                                  1 Reply Last reply Reply Quote 1
                                  • M
                                    maz_net_au last edited by

                                    I am temporarily unable to buy any hardware due to relocating across the world in a week and a bit. My plan is to order all of the readers listed once i get there. Until then, my involvement in this project is basically on hold although I'll do bug fixes for anything I can replicate with my current hardware.
                                    Maz

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      maz_net_au last edited by

                                      Just after I wrote that I went back through the code and found what might be causing the 6321 and multiple reader failure. So... expect an update tomorrow (about 12 hours from now).
                                      Maz

                                      1 Reply Last reply Reply Quote 2
                                      • johnyma22
                                        johnyma22 NFC Ring Team last edited by

                                        Awesome! I'm using the software now and it's working a treat w/ ACR122

                                        1 Reply Last reply Reply Quote 1
                                        • Lokki
                                          Lokki Community Helper last edited by Lokki

                                          Also working well w/OMNIKEY 5021 CL (Win10 x64)

                                          1 Reply Last reply Reply Quote 1
                                          • J
                                            jasok2 last edited by

                                            I'm really excited about this software. I cannot wait until there is an installer for it. Also how is the kick starter going ? is that still happening ? @johnyma22 since it seems so close already have you considered to just sell it in the NFC ring store any bypass the kick starter ? This may save time in getting it to all the punters.

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post