How to send SMS through 'Dongle' using C++ - c++

I have a USB dongle connected to my laptop which is used to get the internet connection. No need to say it has a sim card and it is possible to send/receive SMS as well. I want to know how can I get the SMS and send SMS using my own C++ windows program, through this SIM card. Is there a way to access the SIM card and do these? Any libraries? I haven't done any USB programming anyway.
Edit
I just found it is possible with something called "AT Commands" - How to Auto send SMS via Broadband USB dongle?
But the link in the answer is dead. Even though it is AT Command, which lib should I install in order to use it?

At (Attention) commands can be used to interact with the USB dongle. Each manufacturer has their own At-commands, so you will have to find out one which suits your model (mine was Huawei e173-u). Some of the common ones can be found in the Hayes command set :
Hayes Command Set (Wikipedia)
Introduction to At commands
You will need to find out which COM port your dongle uses from the Device Manager, then use a serial-port terminal like Putty to test out whether the commands are supported by your dongle. As the libraries developed for sending SMS's are mostly for .Net, you may need to use an SMS gateway instead.

Related

Google Local Home SDK UDP commands to BrighSign player

For a research, I want to try controlling a BrightSign player with a Google Nest Hub.
The BrightSign player support UDP commands with ASCII/HEX on default the receiving port 5000.
Because the player is not a smart device, can I use the Google Local Home SDK, to send UDP commands with the HEX only to non-smart devices?
If so, does someone have an example of TypeScript of JavaScript how to set this up?
I'm new to both languages and just want to implement this simple feature.
Thanks.
I already tried this tutorial: https://developers.home.google.com/local-home/overview.
But I did not got it to work with my device.

How to manage the received SMS's in a gsm modem connected to a pc?

i am working on a project that a computer should manage the data receiving as sms text in standard predefined coding from multiple senders. the senders are some embedded sytems that send error situations of a machine via sms messages.
i am an electronic engineer not software and i made the senders circuits those send the information (errors) to a central monitoring site.
therefore in the site should be a gsm modem connected to a pc which receives the messages and the pc should have a software to be able to read the messages from gsm modem and sort them and log them and give the operator some reports based on for example which kind of errors has been occurred more and etc.
my question is about developing this software to be able to read data from usb port and then manage them.
This will hardly define by the specification of your GSM modem.
Maybe this OP will help you :
How to communicate with GSM modem from c++ code
Many GSM modem use the AT command, see also GSM section on this page :
https://en.wikipedia.org/wiki/Hayes_command_set#GSM
and this :
output of AT command c++ code
and look at the at-command tag also

Windows form application for USB port

Previously I have work with Windows Form application to establish some RS232 connection. I used the already provided serial port component (SerialPort), and I was able to establish RS232 communication relatively easy.
Now, I was wondering if there will be something similar in Winodows Form application to establish a USB communication ?
It seems there is this WinUSB API that provides a very low level interfacing with the device.
However, I am not sure how easy will that be? Also, not sure how easy will it be to integrate into Windows Form application ?!
Will there be a simpler version of such USB interface API?
I don't have to stick to Visual Studio. Is there other c++ USB API, besides WinUSB, that is more standard that people use? I would like to develop a GUI API that does some communication over USB. If need be, I can use Python or some other tools if it facilitates the process?
Thanks in advance.
Although USB is a serial protocol, you can't treat USB like a serial port:
It's dependant on what the actual device is. For example a mobile phone, may provide several "endpoints" for USB, one being a serial port to use the phone as a modem, one as a storage device allowing you to transfer photos and music files to/from the phones storage, and as a camera device that you can take photos with. All of these have different behaviour and need a USB driver-plugin to make it behave correctly - these are typically shipped with Windows, and your phone will appear as COM5:, the E: or "Samsung Galaxy S3 Mini" drives and as a camera under the "cameras and scanners".
Of course, you can programmatically open all these devices, but it is done as the device-type that they present as on the inside of windows (so you use serial port functions or file functions or camera functions).
You CAN also write a device driver for a device, if you have sufficient details of how it works.
But there's no real way to "open the port". The USB API is a driver API, not a user-mode API. Here's a page to start from to understand USB drivers:
http://msdn.microsoft.com/en-gb/library/windows/hardware/ff540215%28v=vs.85%29.aspx
There is a WinUSB driver, which allows a single application to access a single device, assuming you know how to operate that device.

how to read certificate from USB device and send it to browser like firefox

I want to write a c++ dll that read certificate from my USB device and send that to browsers like Firefox.And I should mention that i have built my USB device with an ATMega32A which have 2K EEPROM and i stored a sample certificate on that.
I have read some about PKCS#11 standard but i cant figure out where to start. Could anyone help me on this?
It sounds like you're creating a PKI hardware device. I think your biggest hurdle will be accessing the ATMega32. It'll be up to you to implement an interface on the ATMega side, be that a RS232-usb bridge, USB Mass Storage, or proprietary with a custom driver.
A simple solution might be to use a USB Mass Storage interface to present a certificate as file on a pseudo disk.
Taking the custom driver route, Firefox (and other Mozilla products) use libraries that have interfaces for PKI hardware. See NSS and OpenSC.
At a guess it's possible that there's a PKI / PKCS11 driver API for Windows that you can implement.
You can not "add to Firefox" but you can expose your data to firefox and make them available for use. To do this you need to implement PKCS#11 API and create so-called PKCS#11 driver (the user-mode DLL which implements those 70 or so functions defined in PKCS#11 API). Those functions would talk to the hardware device in order to perform certain operations. Then you plug this PKCS#11 DLL to Firefox and Firefox can use certificates on your device.
Step 1: write a dll that can read data from the USB device. You could use Winusb. This will require the firmware to support it.
Step 2: write a dll that can add a certificate to Firefox
Step 3: combine previous steps into one dll
If you get stuck on something specific, write a new question and show us what you have done so far.

best method to find the COM port to which my embeded device got connected in my vc++ program

I want to find the COM port my device got connected in my vc++ program.
upto now i used to scan all the ports from 0 to 15 and send some command if the reply is suitable to me i can confirm that it is the port i am finding.
But this is Taking a lot of time.
anyother solution???
The serial API does not provide for any of the sort of identification that you seem to desire so the only choice that you have is to poll he various ports. If the device is a USB device, you may be able to garnish clues from the friendly name associated with that device (see How do I get the friendly name of a COM port in Windows?).