dom/bluetooth/bluetooth2/ipc/BluetoothTypes.ipdlh
author Jamin Liu <jaliu@mozilla.com>
Mon, 24 Aug 2015 10:29:56 +0800
changeset 291542 092034d8c3b1946e70b4bb875251a39604855571
parent 291254 00b847293e708b261f6963563e3f7536a92d377a
permissions -rw-r--r--
CLOSED TREE Bug 1180554 - Dispatch events to PBAP event handlers when the PBAP requests comes. r=btian, r=mrbkap

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

using mozilla::dom::bluetooth::BluetoothGattCharAttribute
  from "mozilla/dom/bluetooth/BluetoothCommon.h";
using mozilla::dom::bluetooth::BluetoothGattId
  from "mozilla/dom/bluetooth/BluetoothCommon.h";
using mozilla::dom::bluetooth::BluetoothGattServiceId
  from "mozilla/dom/bluetooth/BluetoothCommon.h";
using mozilla::dom::bluetooth::BluetoothGattWriteType
  from "mozilla/dom/bluetooth/BluetoothCommon.h";
using mozilla::dom::bluetooth::BluetoothSspVariant
  from "mozilla/dom/bluetooth/BluetoothCommon.h";
using mozilla::dom::bluetooth::BluetoothStatus
  from "mozilla/dom/bluetooth/BluetoothCommon.h";

namespace mozilla {
namespace dom {
namespace bluetooth {

/**
 * Value structure for returns from bluetooth. Currently modeled after dbus
 * returns, which can be a 32-bit int, an UTF16 string, a bool, or an array of
 * UTF16 strings. Can also hold key-value pairs for dictionary-ish access.
 */
union BluetoothValue
{
  int32_t;
  uint32_t;
  nsCString;
  nsString;
  bool;
  nsString[];
  uint8_t[];
  uint32_t[];
  BluetoothNamedValue[];
  BluetoothGattId;
  BluetoothGattId[];
  BluetoothGattServiceId;
  BluetoothGattServiceId[];
  BluetoothGattCharAttribute[];
};

/**
 * Key-value pair for dicts returned by the bluetooth backend. Used for things
 * like property updates, where the property will have a name and a type.
 */
struct BluetoothNamedValue
{
  nsString name;
  BluetoothValue value;
};

struct BluetoothSignal
{
  nsString name;
  nsString path;
  BluetoothValue value;
};

struct BluetoothReplySuccess
{
  BluetoothValue value;
};

struct BluetoothReplyError
{
  BluetoothStatus errorStatus;
  nsString errorString;
};

union BluetoothReply
{
  BluetoothReplySuccess;
  BluetoothReplyError;
};

}
}
}