X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fcomms.php;h=610959e04d0482fe69d40541f9db5dd458a34038;hp=db0215e7d6999220cfb16c41412a0573c3285232;hb=175dadf56670772f8d889276df67471354a36f21;hpb=9d42ecae8d0c5139e119af983a5fe65f4b0fe149 diff --git a/libcbfwr/comms.php b/libcbfwr/comms.php index db0215e..610959e 100644 --- a/libcbfwr/comms.php +++ b/libcbfwr/comms.php @@ -15,23 +15,26 @@ class Comms { $this->msgres = msg_get_queue($MESSAGE_KEY, 0666); } - function getConfig() + function getConfig($type=0) { global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY; sem_acquire($this->semres); $shm_space = shm_attach($STORE_KEY, 16*1024*1024); - $config = shm_get_var($shm_space, 0); + $config = shm_get_var($shm_space, $type); sem_release($this->semres); return $config; } - function putConfig($config) + + // type = 0 for the main config + // type = 1 for the boot hardware config + function putConfig($config, $type=0) { global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY; sem_acquire($this->semres); $shm_space = shm_attach($STORE_KEY, 16*1024*1024); - shm_put_var($shm_space, 0, $config); + shm_put_var($shm_space, $type, $config); sem_release($this->semres); }