SambaPOS Inter-Process Communication

Hi everyone!

So I am trying to use winSCard API from Windows to utilize NFC reader/writer to improve on a RFID card feature that needs much needed improvement.

A = SambaPOS
B = SmartCard application written in C++
C = Reader/Writer

1. Is there a built in way in SambaPOS do IPC with other applications?
I know its possible to pass on the parameter I want SmartCard app to write on to the card using Start Process action and using command line parameter. (but its kind of a dirt hack lol)
However, even if I did, there is no way to to communicate what the process B has done back to SambaPOS.

2. Is there a way I can use built in JScript to open socket (using .NET framework or some other libraries) and communicate to another process?

3. Does SQL have a message passing ability that I can use to pass the messages from process B to back to SambaPOS?
Without actually storing it in the database table.

Has anyone worked with something like this in the past? I am not going to lie, allocating buffers, byte sizes and stuff is a bit beyond me so all ideas are welcome.

P.S. I completely want to avoid building a Web App and using REST API to do something like this as its an overkill to build just for this.

1 Like

Sambapos uses SignalR thru server-sent events to stream unidirectional notifications, this is how the message server works, you can use server sent event events in c++ to listen messages from sambapos with broadcast message action from samba side to sent notifications and you can send a message from your app thru graphql api using broadcast message mutation. If you don’t need to listen messages from sambapos use only graphql api from your app.

To write in the db you can use addTask and updateTask mutation. The information is stored in Tasks table.

These two mutations are kinda buggy, you can test them before doing any integration, sometimes when you use addTasks mutation in some way the another terminals cant see that change.

What are the interactions that your app would have with samba?

Initially what I want to achieve, as proof of concept, is for SambaPOS to send SmartCard app an entity name on automation command. Which is possible as a command line parameter to an .exe file on Start Process action.

SmartCard will then run the app, initialize first NFC reader available and then write that entity name to NFC chip.

And when SmartCard finish that task, I want to return whether that was a success or not by passing on variable from SmartCard to SambaPOS. But this step is not possible unless I can figure out how to share variables between two different processes running on the same terminal.