Permalink
Browse files

Adding box opener socket connection

  • Loading branch information...
1 parent 0cd7b5c commit 094e1dcf043f716b2f730edb97324fc3cf40829e @p-blomberg p-blomberg committed Mar 31, 2012
Showing with 12 additions and 0 deletions.
  1. +1 −0 controllers/Retail.php
  2. +8 −0 inc_app/open_box.php
  3. +1 −0 includes.php
  4. +2 −0 settings.php
View
@@ -57,6 +57,7 @@ public function make($params) {
}
$transaction->commit();
$db->commit();
+ open_box();
$_SESSION['random'] = ClientData::post('random');
kick("/Retail/create/$recieved");
}
View
@@ -0,0 +1,8 @@
+<?php
+function open_box() {
+ global $settings;
+ $sock = socket_create(AF_UNIX, SOCK_STREAM, 0);
+ socket_connect($sock, $settings['open_box_parport_socket_path']);
+ socket_write($sock, "strobe d0 500");
+ socket_close($sock);
+}
View
@@ -13,5 +13,6 @@
// Application
require_once "inc_app/application.php";
require_once "inc_app/helpers.php";
+require_once "inc_app/open_box.php";
?>
View
@@ -10,4 +10,6 @@
$webpage_stage = "nitroxy_retail";
$settings['coupon_url'] = null;
+
+$settings['open_box_parport_socket_path'] = "/home/nx-kiosk/parport_server/parserver.sock";
?>

0 comments on commit 094e1dc

Please sign in to comment.