Bluetooth custom Pairing using a windows service - service

We're working on an .net core 3.0 app under UWP win 10. The app runs as a BLE central, connecting to BLE peripherals. We use the Windows.Devices.Bluetooth namespace which defines a Windows Runtime API that allows UWP desktop apps to interact with Bluetooth devices.
When we run the app as is, we can pair without issues. However when we wrap the model within a windows service, everything works but the pairing process which returns a Failed DevicePairingResultStatus for the pairAsync(pin_number) request. The code which is run remains exactly the same in both cases.
Pairing is performed with DeviceInformation.Pairing.Custom.PairAsync(DevicePairingKinds.ProvidePin, DevicePairingProtectionLevel.Encryption) method.
We've tried running the service as logged on as Local System, Local Service, local user with admin privileges, Administrator and Network Service with the same results.
Windows 10 is updated as well as Bluetooth drivers, Bios etc.
Does anyone have any suggestions as to why the difference exists between running as a windows service and running as an app? And how to bypass this?
Thanks!

Related

Virtual (fake) primary monitor in Windows 10?

I have a bunch of automated UI tests that currently require a physical monitor to run. Can I somehow create a virtual monitor in Windows 10 that functions like a real monitor to the OS? I want to run the UI tests in a remote cloud environment without screens.
I think I heard sometime that VR-development (Virtual Reality) have had similar problems in that VR also need a physical monitor attached (except the VR-headset) and that this was perhaps solved by Nvidia/Intel? with a fake monitor driver or similar? Or was it virtual desktops in VR? I can't find the source for any of this anymore...
The easiest way is to use the Spacedesk utility:
https://spacedesk.net/
Spacedesk server part is installed on your PC.
The client part (viewer) will also be required - any device on Android/Windows in same LAN segment.
Small hack:
You can also install Windows Client on Spacedesk server PC and manually assign client IP from another subnet. As a result, you will assume real Windows fake display )...

Understanding PowerShell cmdlet for adding a trusted UCMA 4.0 application and a trusted UCMA 4.0 application endpoint

I am trying to create a UCMA 4.0 application for Lync 2010. In the development phase the application will be hosted in my laptop and the lync server (on which I have no jurisdiction) will connect to my laptop and run the application. The OS in my laptop is Windows 7 SP 1 and the .Net framework is 4.5.
I am fairly new to UCMA coding and though I have studied about it, there are still some grey areas that needs to be addressed. Below are some of the questions that I have failed to get a clear answer of. Also, it is more important for me to understand the nitty gritties because the Lync server admin is a new person on the job who has, like me, never worked on UCMA applications.
I need to create an application pool. For that, the PowerShell cmdlet to be used is
New-CsTrustedApplicationPool -Identity foo.example.com -Registrar [Registrar Id] -Site [Site id] –ComputerFqdn foo.example.com
I assume this cmdlet must be run on the lync server. Since my laptop will be the only computer in the application pool in the development phase so my -ComputerFQDN and -Identity of the application pool are the same. Is this correct? Also, where will I get the Registrar ID and the Site ID? What is the difference between a manually provisioned application and an auto provisioned application?
To add a trusted application:
New-CSTrustedApplication –ApplicationId $ApplicationId -TrustedApplicationPoolFqdn $ApplicationFqdn -Port $PortNo
What exactly is application id. Is it my computer FQDN/application_name? I have assumed that the TrustedApplicationPoolFqdn is the same as my computer FQDN since there is only a single computer in the application pool. Also, will any available port no. do or should it be the one listening to my application? Since, I have not completed coding my application, getting the exact port no. is not possible. They want to setup the server before the coding is done. That is the challenge.
To create the trusted application endpoint:
New-CSTrustedApplicationEndpoint –ApplicationId $ApplicationId -TrustedApplicationPoolFqdn $ApplicationFqdn -SipAddress $ApplicationSipAddress –DisplayName
What is -SipAddress here? Where and how will I get the SIP address?
I know I have crammed a lot of questions here. But I am running low on knowledge and available resources and I am in a desperate need of some direction, given the time constraints that I am facing. Apart from the questions if anybody can help me with any heads up, you are more than welcome and appreciated to do so. All I need right now is some perspective from the stackoverflow community.
I assume this cmdlet must be run on the lync server. Since my laptop will be the only computer in the application pool in the development phase so my -ComputerFQDN and -Identity of the application pool are the same.
Is this correct?
No. It can be run from any computer that has the Lync / SfB powershell commands installed and you have enough "rights" to run the powershell commands. I run these sorts of commands from my dev machine all the time.
I normally develop with UCMA v4 (not 5) and when you install ocscore.msi from the SDK/runtime install or copy it from the Lync 2013 install. You can get the SfB powershell to install but I've found it be more of a pain than the Lync 2013 version and mostly you don't need SfB version (i.e. the Lync 2013 powershell commands work fine on a SfB server install).
Also, where will I get the Registrar ID and the Site ID?
The Registrar ID is the front end pool (the sip proxy to register with). You can get it with the powershell command:
Get-CsService -Registrar
Look at the "Identity" field and should look like:
Registrar:name.lyncdomain e.g. Registrar:myserver.company.com
You can get the Site ID from the Get-CsSite command. It should look like: Site:ID e.g. Site:MY_SITE
What is the difference between a manually provisioned application and an auto provisioned application?
This is a very big difference.
A manually provisioned application requires more code to setup and run your UCMA trusted application. You have to know all the settings and all the trusted application endpoints yourself.
A auto provisioned application requires less code to setup and run. All you need is a id and with that id you can query the UCMA API to pull all that trusted application setup and all the trusted application endpoints. This sounds great but the downside of a auto provisioned application setup means that all the computers in the application pool has to be setup as a replication point for the Lync database. To setup the computer as a replication point is a BIG pain in the pass (it takes about 1/2 hour to setup if you know what you are doing).
I suggest setting your application pool / application as a manually provisioned application as it's actually a lot simpler to setup in the long run unless you require the ability to automatically "know" what trusted application endpoints are setup to your application.
What exactly is application id.
Anything you like. It just needs to be unique (kind of) within the Lync environment. You can use Get-CsTrustedApplication command to see what other
application id's are already in use. It basically is the unique ID for your application.
Is it my computer FQDN/application_name?
It is the FQDN (fully qualified domain name) of the application pool. If should match the application pool ComputerFqdn value. It's basically telling Lync what application pool that this trusted application runs on. Trusted applications can only run on a application pool computer only.
is the same as my computer FQDN since there is only a single computer in the application pool.
In a single computer application pool, yes. In a multi-computer application pool, no. It is the ComputerFqdn of the pool.
Also, will any available port no. do or should it be the one listening to my application?
The port number has to be a available port on the pool computer. It is used by the UCMA application to listen on and is used by the Lync server (FE) to connect to the UCMA application as per the SIP RFC.
For auto provisioned application, the UCMA application will auto-load this value and use it. For manual provisioned application, you can either hard code it or load it from your own config setup (e.g. from registry?). I would recommend that you load from your own config somewhere like the registry.
What is -SipAddress here? Where and how will I get the SIP address?
It's whatever you want it to be. It needs to be a unique SIP address within the whole Lync setup. It should be in the format of sip:name#lyncdomain e.g. sip:myendpoint#company.com
It will be the primary entry point for SIP messages into your application if your application even uses / wants a sip endpoint to:
make audio calls, receive audio calls, provide presence, send/receive IM messages, etc.
If you aren't going to use a trusted application endpoint (e.g. you only want to impersonate user endpoints) then you don't need any trusted application endpoints.

Data transfer Windows Embedded Compact 7 & Computer VIA USB connection

I made an app using the barcoding for inventory management, now i need to transfer that data to the computer. For this purpose i used TCP/IP Host client sample applications given in windows mobile 6.5.3 SDK samples.
When i run the application its' fine no errors, shows connected to the Host IP but no data is transferred, When i debugged there is no exception code just works fine but there is no functionality performed. My connection is USB connection. IP shown in host application is correct, my device is also having IP (check through ipconfig). Now when i ping my host computer from device, it is giving error
PING: transmit failed, error code 11010
Is my approach right towards this situation using this data transfer over this socket ? If yes then how can i make this connection successful ? If not what is the other solution for this data transfer from device to computer. (software on device is using SQL CE and application on computer is ASP.NET application using SQL Server database.)
I saw various similar questions about this problem but unable to find any suitable solution. PS i am new this platform of windows mobile/embedded
If not what is the other solution for this data transfer from device
to computer. (software on device is using SQL CE and application on
computer is ASP.NET application using SQL Server database.)
These are some common solutions for client/server communications on Windows Mobile:
Use RAPI or RAPI2 to communicate with the mobile device and host PC using the USB ActiveSync/Windows Mobile Device Center connection. You could use this option to export a CSV file from the mobile device to the host PC. Then you can import the CSV file into the host database. Requires physical access to host PC via USB.
Call a web service to transmit the data to the server. You can write a simple RESTful web service using ASP.NET Web API. If you're using C++ you can use WinInet API, but it's kind of painful. If you're using C# then you have built-in support and it's not an issue.
Use SQL CE Replication.

how to access IIS on VMware using PC name not IP

I have a mac running Lion OS, and Windows 7 Ultimate installed on VMware Fusion
on my Windows machine, I have IIS running and I can access it from my mac browser using the IP address such as:
http://192.168.0.10
I am developing an iPhone app on xcode and connecting to IIS as a server to access MS Server DB for testing.
my problem is that I use my mac on many networks such as Work, Home, MiFi and others
every time I change the network the IP changes and every time I need to access IIS I need to update my server IP in my app.
even on my home netwrok or MiFi the IP is the same every time I connect (Dynamic)
I am thinking to access the IIS using the PC name on my windows 7 machine like this:
http://mypcname
to make easier to test without editing the IP every time.
Can anyone guide me how to do that? I did search around many sites and forums to figure it out with no success, maybe I am missing something.
Thanks in advance.

iOS communicating with OS X

I'm looking for a pointer in the right direction to get started with writing an iPhone app that sends commands to OS X, for example telling OS X to sleep. I can't seem to find the relevant part of the documentation?
AFAIK, most apps have been performing this kind of communication with a client/server design, where a "server" app runs on the host OS X machine, and a "client" app on the iOS device connecting using some sort of protocol (HTTP? Bonjour?).
You won't find this in the documentation because this is a niche design pattern that few apps need (especially since documents can now be shared more easily with the new version of iOS and iTunes).
iOS doesn't support ObjC remote objects, which would be the easiest way to communicate between two OS X machines.
An alternative to the HTTP client/server approach could be making your iPhone app connect in via a remote Unix shell to the OS X machine (via ssh) and then issuing Unix or AppleScript commands to perform your system actions.
You could also set up a socket connection. I have done a app for Android, that does exactly the same for Windows computers. The app is in use in a computer store :)
For Mac, you have to use sudo command, so you need the user to type in password, on first use.
Then the server application on the Mac can send "sudo shutdown -h now" to the terminal when the server application gets a predefined byte stream on the socket input.