Introduction
I use VisualGDB to program Raspberry from laptop.
I almost copied the 2 applications listed below and they worked well.
- http://codebase.eu/tutorial/linux-socket-programming-c/index.php#comments
- https://msdn.microsoft.com/en-us/library/windows/desktop/ms737591(v=vs.85).aspx
Then, I wanted to add some internationalization and here began the new part.
- http://stackoverflow.com/questions/215963/how-do-you-properly-use-widechartomultibyte/3999597#3999597
- http://man7.org/linux/man-pages/
You must prepare Raspberry with this: http://www.jaredwolff.com/blog/raspberry-pi-setting-your-locale/ where you need Russian and Italian.
- Download TcpIpServer4.rar
- Download TcpIpClient5.rar
- Download SomeRussian.rar
- Download SomeItalian.rar
Background
Setting up Raspberry.
Using the Code
As this is a tip, I don't show code here, but it is inside the folders I've uploaded. Put TcpIpServer
in one directory of Raspberry. Create from Raspberry root dir /MyDirect and put SomeRussian and SomeItalian inside.
Start server. Start client: in Tx write the server's ip, push Communicate. Then in Tx write some text, push Communicate. To end a correct communication, push OK. To quit at any moment, push x sys command.
To avoid program's block, OK and x sys command are sometimes disabled. In particular, I disable x sys command during connection. For a wrong ip format answer is immediate. For a wrong ip or for server not present, the waiting time is some tens of seconds: blocking socket mode.
For the intermediate messages, you can write in Italian or English or in Russian and the server will display correctly in PuTTY console.
My server and laptop communicate via wifi.
To create SomeRussian open in Windows text editor a new file, write in Russian with an adequate keyboard and save the file with UTF-8 encoding. For SomeItalian, it's the same (Italian keyboard). Copy these 2 files (without extension) in the dir chosen.
History
- 11th October, 2015: Initial version