I want to use Ethernet port to send data with create socket.
How can I open the Ethernet port and set IP, NETMASK and GateWay? I can use these functions but I don't know how to open the Ethernet port or how to configure these functions.
ceSETNWParamValue();
ceGetNWParamValue();
ceSetDDParamValue();
Well, The "Verix eVo Volume II OS and Communication Programmers Guide" (esp. chapter 5) can help you out a bit, but before we get into that, there is one important thing to consider--if you are using this program that you are writing on a vx520, you will likely want it on another terminal type at some point in the future. To that end, you may consider using CommServer. CommServer is a program that helps abstract the various types of hardware out of your code so you can send the same commands to any terminal type and let it determine how to fulfill your requests based on what hardware it is using. It has been around for a while and has been ported to most of the VerFone terminal types. It is provided (and supported) by VeriFone for free. There are a few downsides to it:
However, once you get it working, it's really nice:
There is a good chance that at some point, you'll need to share your terminal with another 3rd party. If that's the case, you'll need to have your program running on top of VMAC, anyway, AND there is a good chance they'll be using CommServer, too. If this is ever the case, 2 of the "CON"s just disappeared and one of the "PRO"s was just emphasized.
So now you have to choose--CommServer, or no CommServer.
If you choose CommServer, you'll need to get very familiar with how FlexiRecords work so as a prerequisite, I suggest you read Chapter 7 of the "Verix eVo Multi-App Conductor Programmers Guide". Next, the program flow will go something like this:
1) Initialize the event buffer with
2) Connect
3) Verify you are connected
4) Send
5) Receive
5) Disconnect
There's going to be more to it than that, but that's the gist of it.
At this point, you are likely thinking to yourself, "That looks complicated--how can I do it WITHOUT CommServer?" Well, now we are venturing into a realm that I am less familiar with and I probably won't be that helpful, but I do have a code sample that makes the following calls (note that my code sample is over 1500 lines long, so I can't include it all here):
Where FillNWIF is defined as
The actual connect and send is, in a nutshell, as follows:
Other APIs you may find useful:
To address the make file comments below, your make file should have a line that is something like the following:
Above that, each of
COptions,Includes,AppObjects, andLibsneed to be defined.COptions
COptionsare the compiler options you want to use. Several possible options are in your "Verix eVo Volume III OS programming tools reference manual", but as an example, you might set it to:-pindicates that it is for the ARM11 processor (i.e., this code is for the 520, not the 570)-DLOGSYS_FLAGsays that you want to enable LOG_PRINTF statements and-DLOGSYS_NEW_API_STYLEindicates that you want to use the new macros (that don't require double parenthesis)Includes
Includesis how you tell the compiler where to look for your header (.h) files. Any time you use a#includestatement, you need to make sure that the directory where that.hfile lives is represented in yourIncludeslist. For example, if you want to#include <ceif.h>then you need to make sure you have-I$(EOSSDK)\includeas part of your includes path. An example of how you may set yourIncludesmight be:-Iin front of each. This tells the compiler that it is anIncludeand not a library file..\includepoints to my .h files that I made. Note that it uses a relative directory and so it assumes that my include folder is visible from the same place that my make file exists.EVOSDK,EOSSDK, andEVOACTwill probably be used in all your projectsEVOVCSis if you are using commserverEVOVMACis if you are using VMAC (which you will be if you are using commserver)AppObjects
For each
.cfile you have, you need to compile it into an object (.o) file. You could technically roll this up withLibsbelow as it is really the same thing. The only difference is that you made these; they aren't part of the SDK or anything.Libs
Libsmight look something like this:ceif.ois the object file that you'll need to use the things that are defined in ceif.h.\at the end of each line (except the last). That's just to tell nmake that this line continues. You could just as correctly remove each\and put it all on 1 line. This is just for readability.The last part,
-o $(OutDir)\Project.outis just saying where you want to output the result of your compilation.