How to read line data send to COM from PC - nanoframework

I was going through planty of nf samples (many thanks for that), but couldn't find any, where I can read data sent by USB cable (serial port).
In arduino I would simply write: Serial.readString() to get data sent through COM. How that could be acomplished in nanoframework?

You should use the System.IO.Ports API. Windows.Devices.SerialCommunication is the UWP API that we're discontinuing and replacing with the IoT Core API.
Please check the sample pack here and look at Scenario3 Read. After properly setting up the SerialPort device, you can call
serialDevice.Read(buffer, 0, buffer.Length).

Related

USB packet and data buffer capture

I need a software or application with API support to capture USB packet and data buffer. I would like to analyse the captured data using LabVIEW.
Suggest applications for usb packet and data capture with API support, so that I can access them using LabVIEW.
Or
Alternate methods to capture and analyse usb data using LabVIEW
I had tried a approach using logman.exe . But that doesn't log all the USB packets. Has anyone tried logman to capture the usb packets?
you can consider using VISA functions.
A few examples are shipped with Labview (open example finder and look for USB).
Here is a starting point giving instructions about how to give VISA access to the device.
You need find out some windows dll's and use it in labview. the examples provided for NI USB devices.

Code for RS232 not working for RS485 Communication

I'm using VBA for Excel to communicate with hardware via serial communication. The code uses API calls similar to this here: http://dev.emcelettronica.com/serial-port-communication-in-excel-vba.
I've been successful with rs232 but it isn't working with rs485. After sending data and reading back the response, the read times out and it reads the same data that was sent.
I have access to software that someone else developed and their software works, so I know that the hardware is ok. I used a serial port sniffer and their code seems to have a lot of redundancy but it looks like its using the same configuration and sending the same data as my code. But their code gets a valid response while mine doesn't.
Could someone share some basic troubleshooting tips for this type of problem?
A major difference between rs232 and rs485 is that rs485 has an additional configuration setting for wire mode. The rs485 can support 2-wire or 4-wire configurations, with 3 different 2-wire configurations. Once I selected the correct configuration, the same code that I used for rs232 worked for rs485.

create a program that communicate with the arduino using VB.net

I have to create a program that send comand to the arduino;
The program must be the client and the arduino the server.
So the question is: what is the code to start the communication?
P.S. the arduino obviously have an ethernet shield on it.
I have searched on google, i found this :
For Arduino :
https://www.arduino.cc/en/Reference/Ethernet
For Windows :
http://www.nullskull.com/articles/20020323.asp
I've not used Arduino myself but a have a look at Arduino Playground:
CmdMessenger is a messaging library for the Arduino Platform (and .NET/Mono platform). It uses the serial port as transport layer. To use CmdMessenger, we define a list of command identifiers, then attach callback / handler functions for received messages.
The message format is: Cmd Id, param 1, [...] , param N;
The library gives the following functionality:
Sending and receiving commands
Calling of associated functions on received commands
Sending and receiving zero to many arguments per command
Sending and receiving of all primary types. This includes bytes, longs, ints, floats and doubles.
Sending and receiving in plain text form (human readable, robust) or in binary form (efficient)
The library can be downloaded through the Arduino or PlatformIO library manager, or downloaded as a stand-alone package, see the read-me page.

How to do serial communication using vb.net language

I'm making project of automated polling system using SMS. How can i read the text message in the cellphone and display it in textbox?
Have a look at the classes in the System.IO.Ports namespace, namely SerialPort.
There is even an (albeit brief) example available in the Microsoft KB that illustrates how to send AT commands to a connected modem:
http://msdn.microsoft.com/en-us/library/7x7cdt5c.aspx

How to Read SMS/MMS in UIQ

How to Read SMS/MMS in UIQ ?
I am going to assume that you want information about how to write some C++ source code that will allow an application to receive SMS/MMS and read the content of the messages it receives.
On Symbian OS, the message store can store SMS, MMS, EMAIL...
The API of the message store is generic.
In order to write and read data to/from the message store, you'll need to familiarise yourself with the following classes : TMsvId, CMsvSession, CClientMtmRegistry, TMsvEntry and CMsvEntry.
I am obviously biased but I would advise reading the messaging chapter of http://www.quickrecipesonsymbianos.com in order to get an explanation of how the messaging store works and the sample code to use it easily.
Receiving messages, on the other hand, is more complicated.
Listening for and receiving SMS is done using the generic networking API. That's RSocketServ and RSocket. Mostly, you need to use to the right IOCTL parameters on the socket.
You can specify a specific port in order to only receive SMS that are intended for your application. Trying to receive all SMS could be an issue as the native message viewer engine and the embedded Java virtual machine PushRegistry module could both be listening for all SMS already.
You will find useful classes and constants in the following header files in your SDK:
gsmuset.h smsuaddr.h smsustrm.h gsmubuf.h gsmumsg.h.
TSmsAddr, KSMSDatagramProtocol, KSMSAddrFamily, TSmsUserDataSettings, CSmsBufferBase, CSmsPDU, RSmsSocketReadStream, RSmsSocketWriteStream and CSmsMessage are of particular interest. Asynchronously receiving an SMS is actually done using RSocket.Ioctl().
There are SMS-specific error codes whose names start with "KSmsErr"
Receiving MMS on UIQ is done through a UQI-specific API. One that you won't find on Series60 phones. This is the reason why you won't find much talk of a Symbian-generic MMS API in the litterature. You are better off going directly to the UIQ or Sony-Ericsson development communities when you have more detailled questions.
Your application shouldn't have to use RSocket to receive MMS.
Careful, once again, both the Embedded Java virtual machine PushRegistry module and the native message viewer application engine are probably already listening for all incoming MMS messages.
The interesting header files are mmsclient.h, MmsSettingsStore.h, mmsentry.h, MmsApiExtensions.h
Of particular interest are CMmsClientMtm, MmsApiExtensions, MMsvSessionObserver and MMMSMessageHandler.
Good luck.