aqc_embedded_doc
README. vend-ifaces. Vending machine communication interfaces

Hardware drivers for 'vend' application

Protected branches:

  • master

Общие сведения о сборке пакетов можно найти в Вики в статье Сборка пакетов и образов

Versioning guide:

Общие сведения о версионировании можно найти в Вики в статье Версионирование приложений aQsi

Logging categories

Используются следующие категории:

  • default - стандартная категория сообщений
  • aqsi.vi.edr - EvaDtsReporter
  • aqsi.vi.port - PortDriver
  • aqsi.vi.bv - MDBBillValidator
  • aqsi.vi.cc - MDBCoinChanger
  • aqsi.vi.cl - MDBCashless
  • aqsi.vi.cgw - MDBCommsGateway
  • aqsi.vi.fsc - MDBFiscal
  • aqsi.vi.uart - MDBSlaveUART

При выводе в лог имя категории упрощается до последнего слова (aqsi.vi.edr -> edr). Имя категории "default" не выводится.

DBus API

All methods and signals use following service/interface.

Service org.aqsi.Vi
Interface org.aqsi.Vi

Methods at object /

bool IsActive()

Return true if we successfully communicate with VMC

Methods at object /mdb/bill_validator

map GetStatus()

Get information about bill validator from sniffed commands and replies.

map["Setup"] -> dict of variants, result of Setup MDB command
map["Setup"]["raw"] -> byte array
map["Setup"]["level"] -> int32
map["Setup"]["country_raw"] -> uint16
map["Setup"]["country"] -> int, country code
map["Setup"]["country_type"] -> string, either "iso4217" or "phone", need to determine country code
map["Setup"]["scaling"] -> int32
map["Setup"]["decimal_places"] -> int32
map["Setup"]["stacker_capacity"] -> uint16
map["Setup"]["security_levels"] -> uint16
map["Setup"]["escrow"] -> bool
map["Setup"]["type_credit"] -> byte array
map["Security"] -> dict of variants, result of Security MDB command
map["raw"] -> byte array
map["type"] -> uint16
map["BillType"] -> dict of variants, result of BillType MDB command
map["raw"] -> byte array
map["bill_enable"] -> uint16
map["escrow_enable"] -> uint16
map["Stacker"] -> dict of variants, result of Stacker MDB command
map["raw"] -> byte array
map["is_full"] -> bool
map["bills"] -> int32
map["Poll"] -> dict of variants, result of Poll MDB command (only last char)
map["Poll"]["raw"] -> byte array
map["Poll"]["poll_type"] -> string, "bills_accepted", "status", "ftl"
For type "bills_accepted":
map["Poll"]["bill_type"] -> uchar
map["Poll"]["routing"] -> string
Possible values:
"stacked", "escrow", "returned", "to_recycler", "disabled_bill_rejected",
"to_recycler_manuall", "dispense_manual", "from_recycler", "unknown"
For type "status":
map["Poll"]["status"] -> string
Possible values:
"defective_motor", "sensor_problem", "validator_busy", "rom_checksum_error",
"valdator_jammed", "validator_was_reset", "bill_removed", "cashbox_out_of_position",
"validator_disabled", "invalid_escrow_request", "bill_rejected", "possible_credited_bill_removal",
"escrow_request", "dispenser_payout_busy", "dispenser_busy", "defective_dispenser_busy",
"dispenser_not_start", "dispenser_jam", "rom_checksum_error_recycle", "dispenser_disabled",
"bill_waiting", "filled_key_pressed"
Data for type "ftl" is not implemented

Methods at object /mdb/coin_changer

map GetStatus()

Get information about coin changer from sniffed commands and replies.

map["Setup"] -> dict of variants, resulut of Setup MDB command
map["Setup"]["raw"] -> byte array
map["Setup"]["level"] -> int32
map["Setup"]["country_raw"] -> uint16
map["Setup"]["country"] -> int, country code
map["Setup"]["country_type"] -> string, either "iso4217" or "phone", need to determine country code
map["Setup"]["scaling"] -> int32
map["Setup"]["decimal_places"] -> int32
map["Setup"]["type_routing"] -> uint16
map["Setup"]["type_credit"] -> byte array
map["TubeStatus"] -> dict of variants, resulut of TubeStatus MDB command
map["TubeStatus"]["raw"] -> byte array
map["TubeStatus"]["full_status"] -> uint16
map["TubeStatus"]["tube_status"] -> byte array
map["CoinType"] -> dict of variants, resulut of CoinType MDB command
map["CoinType"]["raw"] -> byte array
map["CoinType"]["enable"] -> uint16
map["CoinType"]["dispense_enable"] -> uint16

Methods at object /audit

string GetReport()

Get EVA-DTS audit from device and return as string. If "SalesStatisticSource" 0 or 1, check difference with previous report and send transactions info (refer to signal "Vended" in this object)


Signals at object /event

Started(bool ok)

Sends after startup. If ok = false, vend-ifaces faild to load config and closed.

Vended(map)

CGW sends this signal if new transaction happened.

map["id"] - string, item number
map["price"] - string, price
map["type"] - string, can be:
"CARD", "CASH", "UNKNOWN", "TOKEN",
"FREE", "TEST", "REVALUE", "NEGATIVE_VEND",
"VEND_LESS", "MANUAL_SERVICE", "CGW_VEND"

Signals at object /mdb

Active(bool active) Periodically emits this signal. active = false if VMC is inactive.

Signals at object /mdb/cashless

This signals used for communication with vend to make actual vending.

Request(uint32 price, uint16 id)

VMC asks cashless to purchase item 'id' with 'price' price.

Cancel()

After cancelled vend

Success(uint16 id)

After successufl vend

Failure()

After failing vend

SessionStarted()

After session has started

SessionComplete()

After session has completed

ReaderDisable()

Indicates cashless is not operable (e.g. door is open)

ReaderEnable()

Indicates cashless is operable

Signals at object /mdb/coin_changer

This signals contains map like in return of method GetStatus()

TubeStatus(map) Setup(map) CoinType(map)

Signals at object /mdb/bill_validator

This signals contains map like in return of method GetStatus(), expept Poll() - it contains array of maps for the case when we get many events in one poll

Security(map) Poll(map1, map2, ...) Setup(map) BillType(map) Stacker(map)

Signals at object /mdb/fiscal

Specific API for Jofemar machines with "fiscal" MDB device (address 0xF8)

Check(map)

map["product_id"] -> string
map["product_name"] -> string
map["number_of_products"] -> uchar
map["product_price"] -> string
map["credit"] -> string
map["change_given"] -> string
map["vend_result"] -> uchar
map["payment_type"] -> uchar

Signals at object /mdb/comms_gw

This signals sends after CGW income. Information formatted to EVA-DTS.

Setup(string) DtsEvent(string) Transaction(string)

Signals at object /exe/vmc

Credit()

Signals at object /audit

Vended(map1, map2, ...)

Sends after calculating difference between current audit and previous audit. Contains array of maps with data about vends for this period of time.

map["id"] - number of item
map["price"] - price of item
map["type"] - usually "UNKNOWN", if array of 1 item, can be "CARD", "CASH" or "MIXED"