// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MINIBIND_CHANNEL_H_ #define MINIBIND_CHANNEL_H_ #include #include #include "parcel.h" namespace minibind { class Command; class Channel { public: enum { FIRST_CALL_CODE = 0x00000001, LAST_CALL_CODE = 0x00ffffff, PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), }; explicit Channel(uint32_t handle); ~Channel(); int Call(uint32_t code, const Parcel& in, Parcel* out); Parcel* reader() { return &reader_; } uint32_t handle() const { return handle_; } private: uint32_t handle_; int driver_; Parcel reader_; }; } // namespace minibind #endif // MINIBIND_CHANNEL_H_