FD1 Client Protocol

Integrating FD1 into custom Apps

The key parts of Fd1 are deployed in DLL file. A host program loads the DLL and either lets fd1.dll manage communications directly, or provides these services itself and uses the API calls exported from fd1.dll

Host Program
Loads
Fd1.dll
Exported functionsOptional HTTP Server
(not HTTPS)
Optional Named Pipe
«-- Provides --»
  • Network interface
  • Pipes
  • Direct API calls

Standalone

In standalone mode, Fd1 is loaded via an external app and left to run itself. Fd1Start is the common tool to do this. Fd1start.exe loads Fd1.dll and passes control to it. Fd1start can be used either as a standalone program, or can be installed as a windows service.

Fd1Start.exe

Fd1start.exe can load and invoke fd1.dll in a number of ways. Fd1start does not open communication channels directly, it tells fd1.dll to open and manage anything required.

  1. If installed as a service, it loads fd1.dll and instructs fd1.dll to open network connections, pipes and other configured methods. From then on, fd1.dll runs everything. fd1start is only used to start the program
  2. Fd1start and fd1.dll can receive sockets with the WSADuplicateSocket functionality. This permits a web server to create a standalone process running fd1start/fd1 and hand all network connections to that process to manage. Broadly speaking, this is how fieldpine.com servers work - the initial connection is passed to a retailer specific process. Using DuplicateSocket is not currently documented.

Embedded

In embedded mode, Fd1 is loaded and relies on the host program for communication services. This is the opposite of Fd1start.exe. FieldpineDevices.exe provides this functionality on instore computers.

When the host program runs it does the following

  1. Dynamically loads fd1.dll with LoadLibrary()
  2. Calls WinJsonStart with a JSON initialisation packet
  3. Calls ApiExternal* functions to send and receive data from Fd1
  4. Provides network connections or other communicaton to the world. e.g. The host program runs a webserver, and marshalls HTTP requests into ApiExternal* function calls. fd1 does not directly interact with the client.

FieldpineDevices.exe

This program runs on client computers to provide local services. It can load and service fd1 requests locally. It is also able to expose local services to other systems, such as local printers, serial devices, eftpos, scales, scanners etc. Hence the name "Fieldpine Devices".

FieldpineDevices can automatically install a SSL certificate and manage DNS entries, so that the local PC can offer HTTPS services, which may be required for instore Web Apps to gain access. By using a SSL certificate, communication can be direct between devices on the LAN, which ensures uninterrupted operation when the cloud/internet are unavailable.

Node, Deno, MCP

To be completed.