Landfall

Annotated pkg/devices/keypad/src/client/keypad-client.cc

0:89a1bc19c1fc
2018-05-13 Paul Boddie Added device libraries and programs, configuration files and examples. Also added an installation script and copyright and licensing information.
paul@0 1
/*
paul@0 2
 * Keypad client to access keypad servers.
paul@0 3
 *
paul@0 4
 * (c) 2018 Paul Boddie <paul@boddie.org.uk>
paul@0 5
 *
paul@0 6
 * This program is free software; you can redistribute it and/or
paul@0 7
 * modify it under the terms of the GNU General Public License as
paul@0 8
 * published by the Free Software Foundation; either version 2 of
paul@0 9
 * the License, or (at your option) any later version.
paul@0 10
 *
paul@0 11
 * This program is distributed in the hope that it will be useful,
paul@0 12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@0 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
paul@0 14
 * GNU General Public License for more details.
paul@0 15
 *
paul@0 16
 * You should have received a copy of the GNU General Public License
paul@0 17
 * along with this program; if not, write to the Free Software
paul@0 18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
paul@0 19
 * Boston, MA  02110-1301, USA
paul@0 20
 */
paul@0 21
paul@0 22
#include <l4/cxx/ipc_stream>
paul@0 23
#include <l4/re/env>
paul@0 24
paul@0 25
#include "keypad-client.h"
paul@0 26
paul@0 27
int
paul@0 28
Keypad_device_interface::get_keypad_data(L4::Cap<L4Re::Dataspace> mem) throw()
paul@0 29
{
paul@0 30
  L4::Ipc::Iostream s(l4_utcb());
paul@0 31
paul@0 32
  /* Send a "receive item" for requesting a capability. */
paul@0 33
paul@0 34
  s << L4::Ipc::Small_buf(mem);
paul@0 35
paul@0 36
  return l4_error(s.call(cap(), Keypad_op_get_keypad_data));
paul@0 37
}