SDK Flags

The vmc_configuration object allows you to set various configuration flags. When using the Marshall SDK, these determine the behavior and capabilities of the peripheral (originally intended for vending machine controller -VMC).

Configuration Flags

You can initiate these flags in the main method, as in the following code:

public static void main(string[] args) {
        vmc_config.multi_vend_support = false;
        vmc_config.multi_session_support = false;
        vmc_config.price_not_final_support = false;
        vmc_config.reader_always_on = false;
        vmc_config.always_idle = false;
        vmc_config.vend_denied_policy = vmc_configuration.vend_denied_policy_cancel;
        vmc_config.explicit_vend_success = false;
        vmc_config.long_price = false;

        vmc_config.mifare_approved_by_vmc_support = false;
        vmc_config.mag_card_approved_by_vmc_support = false;
        vmc_config.qr_approved_by_vmc_support = false;

        vmc_config.dump_packets_level = vmc_configuration.debug_level_dump_moderate;
        vmc_config.debug = true;
}
public class vend_machine
            vmc_config.multi_session_support = false;
            vmc_config.multi_vend_support = false;
            vmc_config.price_not_final_support = false;
            vmc_config.reader_always_on = false;
            vmc_config.always_idle = false;
            vmc_config.explicit_vend_success = false;
            vmc_config.vend_denied_policy = vmc_configuration.vend_denied_policy_cancel;
            vmc_config.long_price = true;

            vmc_config.mag_card_approved_by_vmc_support = false;
            vmc_config.mifare_approved_by_vmc_support = false;
static void vmc_init(void)
{
	config.multi_vend_support = __false;
	config.multi_session_support = __false;
	config.price_not_final_support = __false;
	config.reader_always_on = __false;
	config.always_idle = __false;
	config.explicit_vend_success = __false;
	config.vend_denied_policy = vend_denied_policy_persist_e;

	config.mifare_approved_by_vmc_support = __false;
	config.mag_card_approved_by_vmc_support = __false;
	config.qr_approved_by_vmc_support  = __false;

	config.dump_packets_level = debug_level_dump_moderate;
  config.debug = __true;
}

Flag Descriptions

The table below provides a more detailed description of the flags.

Parameter

Type

Description

multi_vend_support

boolean

Enabling the sale and differentiation of multiple products in a single transaction.

multi_session_support

boolean

Enables the device to handle multiple sessions simultaneously, which is useful for scenarios where various transactions may be open at the same time.

price_not_final_support

boolean

Relevant for multi-session (pre-selection) flow only. Indicates that the authorization price received from the server is not final, meaning using it alongside Multi-session would have it behave similarly to a pre-authorization process, ensuring the balance isn't captured for a few days. You can read more on that in the Multi-Session for more details.

reader_always_on

boolean

It keeps the device's reader always turned on and ready to start transactions from the device's end instead of the peripheral. When used, a trigger for the product selection would be a card presentation or touching a button on the device instead of selecting a product on the peripheral's end.

always_idle

boolean

The transaction starts with the consumer selecting a product on the peripheral. The peripheral can send the "Vend request" command without waiting for a "Begin Session" trigger.

vend_denied_policy

boolean

irrelevant, N/A.

explicit_vend_success

boolean

If you have a long vend operation you can set this flag to true, and then after you get the onVendApproved(), you can perform the slow vend operation and then on your time, call vend_status(true/false) for vend success/failure, in order to conclude the transaction.

(the onVendApproved would return a dummy "true", meaning it would release the thread but the SDK would still wait for your actual response regarding the vending result, which is what you'd do in the "vend_status" command)

long_price

boolean

Relevant only for VPOSM- allows for the price field to be 4 bytes long instead of 2 bytes

mifare_approved_by_vmc_support

boolean

Allows Mifare (prepaid) cards to be authorized by a third-party server. The card's data is being forwarded to the peripheral and it is up for it to approve/decline the card.

mag_card_approved_by_vmc_support

boolean

Allows magnetic stripe proprietary cards authorized by a third-party server. The card's data is being forwarded to the peripheral and it is up for it to approve/decline the card.

qr_approved_by_vmc_support

boolean

Allows QR codes to be authorized by a third-party server. The card's data is being forwarded to the peripheral and it is up for it to approve/decline the card.

debug

boolean

Enables or disables log generation.

dump_packets_level

vmc_configuration

Determines the level of detail required to log messages generated by the SDK. You can read more on that in the Log generation for more details.