updated as of: April 11, 2012
last author: Andy Theuninck
original author: Andy Theuninck
NewMagellan is one of the scale drivers included in this release. It works to connect IS4C to a Magellan scanner/scale, but it also serves as a base point for communicating with multiple external devices.

NewMagellan is written in C# .NET. All traces of winforms have been stripped out for the sake of mono compatibility. It doesn't require Visual Studio on Windows; the .NET 2 SDK includes a command line that's sufficient. Both a makefile for linux and a batch file for compiling on windows included.

How it works

Magellan reads ports.conf to see what drivers to use. Entries are just a port (COM1, /dev/Stty1, etc) and a driver name (e.g., SPH_Magellan_Scale). You can have more than one driver running - say a scanner/scale and a signature capture device.

Each driver is launched in its own thread. Other than implementing the SerialPortHandler class, there's no hard and fast requirements what a driver actually has to do. Reading from the relevant serial port would probably be the most common. Writing to the file system is the easiest way I've found to pass info to IS4C (similar to what ssd does).

After starting all the drivers, Magellan launches one more thread with a simple UDP server. All it does is listen (port 9450 by default) and pass any received messages to each driver. This way IS4C can send commands to devices directly without intermediary files.

The current version accepts command line input of messages, too. Re an init script to background the process see Installing NewMagellan Scanner/Scale Driver The windows version compiles a second executable that can be registered as a windows service.

Win32 service notes: the port/driver configuration is hard-coded into the executable, so you have to recompile to make changes (alternately you could hard-code the path to ports.conf, but that would mean a recompile too). The .NET SDK includes a utility called installutil.exe. To install, run installutil.exe posSVC.exe. To remove, run installutil.exe /u posSVC.exe. Installation prompts for a username and password. The username has to include the machine name (e.g., POS1\is4c_user) to work. It took me awhile to figure that out.

Currently Supported Input Messages

These are messages sent from POS to the driver via UDP.

Currently Supported Output Messages

These are messages sent from the driver to POS by writing a file in the ss-output directory. Output notes / stuff to be aware of:
Any output that begins with S is assumed to be scale-weight data. Non-scale-weight output containing a colon character is parsed entirely in the background. For example, if the cashier has typed "5*" in the input box and scans an item, the driver output will be combined with that "5*", where as a card type output would ignore the "5*". The colon is omitted from the signature data command intentionally because that command is typically not used in conjunction with the "main" pos2.php screen.