-
Hi There, Something that connects to the Board and updates a PIN and\or receives an entry\exit access. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 23 replies
-
Hi, Not to the best of my knowledge - I'm on a Mac so mostly just use mono and command line builds for C#. I could look into using Visual Studio for Mac to put together a command line app if that would help at all? |
Beta Was this translation helpful? Give feedback.
-
Hi, There is a C# command line application in the examples - it isn't Visual Studio project but does have an example for every API function. I'll see if I can get a Visual Studio project up and running though (am a bit swamped at the moment I'm afraid, so it will probably only happen either later this week or early next week). re. IN/OUT. Not as far as I'm aware - have just been through the SDK with a fine-tooth comb and there doesn't seem to be any function in the public API that gets/sets a users location. There may be a manufacturer-only function but TBH I would expect the in/out state of a user to be managed by the application because most installations have multiple controllers and e.g. a user could swipe into an area via one door and then swipe out via a door managed by a different controller. |
Beta Was this translation helpful? Give feedback.
-
Hi, Just a quick note - I started looking into this and it seems like on Visual Studio for Windows can't import the DLL compiled by Go. No idea why (possibly something to do with the gcc compiler) - I'll have to do some more digging to figure out why and how to fix it. Tracking issue: Example C# Project: Visual Studio for Windows cannot load DLL |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this :) Just for some background - I have another system that can grant users access (IN\OUT) but need PIN codes as a backup. I am looking to do something relatively straight forward as below:
It doesn't have to be in C# - but I figured its just a good way to package something up for a Windows machine. Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi, Ok, so the good news is that I've managed to get a (very extremely) basic C# console app working under both Visual Studio for Mac and Visual Studio for Windows - the project files are in the examples/csharp-vs folder. Be warned though - at this stage it is nothing more than some very scrappy proof-of-concept code - I'll put some time into polishing it up a bit and adding some functionality over the next week or two but hopefully the underlying stuff shouldn't change. The critical bits turned out to be:
Other than that it's straightforward - if you wanted to start a solution from scratch all y 10000 ou would need to do is:
In terms of what you want to do it mostly looks pretty doable - the only thing you might run into is that the board doesn't store the IN/OUT state of users so that's something you're going to have to manage yourself. Should be fun .. let me know how you go :-). |
Beta Was this translation helpful? Give feedback.
-
Hi, Just let you know that there are now complete working examples for a Visual Studio (both Mac and Windows) C# console app under the examples/csharp folder. The examples don't include the DLL because that more or less has to be built locally to link in the system specific libraries, but it's straightforward - it does require Go to be installed and under Windows absolutely requires the mingw compiler:
Copy the uhppoted.dll file from the lib folder to your project folder and you should be good to go. |
Beta Was this translation helpful? Give feedback.
-
Hi, Great! I've got a TODO item to look into building the DLL on github but it will be a while before a I get to it so glad you got it working. I've only ever built this on .NET7 (mono) and .NET8 (VS Windows/Mac) - the C# foreign function interface has probably changed significantly since .NET 4.8 so not too surprised it doesn't work. re. GetDevices. Hmm, that's weird - are they by any chance the test/simulation controllers (405419896, 303986753 and 201020304 )? However, the most likely reason is that
There are a couple of other things you can try:
|
Beta Was this translation helpful? Give feedback.
-
re. VB.NET. Huh! Good to know it's possible! Any particular reason you converted to VB rather than just stick with the C#? But, ok, that helps - assuming your Makefile still looks more or less like the example Makefile, when it runs a command it first sets the PATH environment variable to the lib folder and then runs the command. So the actual command it is running is something like:
The PATH bit allows Windows to find uhppoted.dll in the lib folder. To get the same behaviour inside VS you need to edit the launch configuration and set the PATH environment variable to So if uhppoted.dll is located in the original lib folder, it would look something like this:
or if you've copied the the DLL to your project folder:
|
Beta Was this translation helpful? Give feedback.
-
Ah! Great! I was about to suggest either printing out the re. 22 out of 50 controllers. That is most likely something to do with the network configuration:
You could also try increasing the timeout from 2500ms to 5000ms - don't think that's the issue but it's worth eliminating:
|
Beta Was this translation helpful? Give feedback.
-
That suggests it's something to do with the network configuration - possibly the controllers don't have the correct gateway or subnet masks configured. Can you run the You could also try binding to
The controllers will definitely have IP addresses but they may be being auto-assigned - if the controllers are visible in the manufacturer application the IP addresses should be displayed there somewhere. Or if you have access to the router they may also be in the ARP table. |
Beta Was this translation helpful? Give feedback.
Hi,
Just let you know that there are now complete working examples for a Visual Studio (both Mac and Windows) C# console app under the examples/csharp folder.
The examples don't include the DLL because that more or less has to be built locally to link in the system specific libraries, but it's straightforward - it does require Go to be installed and under Windows absolutely requires the mingw compiler:
Copy the uhppoted.dll file from the lib folder to your project folder and you should be good to go.