1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bluetooth/ipc/BluetoothTypes.ipdlh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +namespace mozilla { 1.11 +namespace dom { 1.12 +namespace bluetooth { 1.13 + 1.14 +/** 1.15 + * Value structure for returns from bluetooth. Currently modeled after dbus 1.16 + * returns, which can be a 32-bit int, an UTF16 string, a bool, or an array of 1.17 + * UTF16 strings. Can also hold key-value pairs for dictionary-ish access. 1.18 + * 1.19 + */ 1.20 +union BluetoothValue 1.21 +{ 1.22 + uint32_t; 1.23 + nsString; 1.24 + bool; 1.25 + nsString[]; 1.26 + uint8_t[]; 1.27 + BluetoothNamedValue[]; 1.28 +}; 1.29 + 1.30 +/** 1.31 + * Key-value pair for dicts returned by the bluetooth backend. Used for things 1.32 + * like property updates, where the property will have a name and a type. 1.33 + * 1.34 + */ 1.35 +struct BluetoothNamedValue 1.36 +{ 1.37 + nsString name; 1.38 + BluetoothValue value; 1.39 +}; 1.40 + 1.41 +struct BluetoothSignal 1.42 +{ 1.43 + nsString name; 1.44 + nsString path; 1.45 + BluetoothValue value; 1.46 +}; 1.47 + 1.48 +struct BluetoothReplySuccess 1.49 +{ 1.50 + BluetoothValue value; 1.51 +}; 1.52 + 1.53 +struct BluetoothReplyError 1.54 +{ 1.55 + nsString error; 1.56 +}; 1.57 + 1.58 +union BluetoothReply 1.59 +{ 1.60 + BluetoothReplySuccess; 1.61 + BluetoothReplyError; 1.62 +}; 1.63 + 1.64 +} 1.65 +} 1.66 +}