diff options
Diffstat (limited to 'chromium/content/common/bluetooth')
-rw-r--r-- | chromium/content/common/bluetooth/bluetooth_device.cc | 28 | ||||
-rw-r--r-- | chromium/content/common/bluetooth/bluetooth_device.h | 21 | ||||
-rw-r--r-- | chromium/content/common/bluetooth/bluetooth_messages.h | 171 |
3 files changed, 0 insertions, 220 deletions
diff --git a/chromium/content/common/bluetooth/bluetooth_device.cc b/chromium/content/common/bluetooth/bluetooth_device.cc index e89e0195a09..4b07d329f4d 100644 --- a/chromium/content/common/bluetooth/bluetooth_device.cc +++ b/chromium/content/common/bluetooth/bluetooth_device.cc @@ -11,36 +11,14 @@ namespace content { BluetoothDevice::BluetoothDevice() : id(""), name(base::string16()), - tx_power(device::BluetoothDevice::kUnknownPower), - rssi(device::BluetoothDevice::kUnknownPower), - device_class(0), - vendor_id_source( - device::BluetoothDevice::VendorIDSource::VENDOR_ID_UNKNOWN), - vendor_id(0), - product_id(0), - product_version(0), uuids() {} BluetoothDevice::BluetoothDevice( const std::string& id, const base::string16& name, - int8_t tx_power, - int8_t rssi, - uint32_t device_class, - device::BluetoothDevice::VendorIDSource vendor_id_source, - uint16_t vendor_id, - uint16_t product_id, - uint16_t product_version, const std::vector<std::string>& uuids) : id(id), name(name), - tx_power(tx_power), - rssi(rssi), - device_class(device_class), - vendor_id_source(vendor_id_source), - vendor_id(vendor_id), - product_id(product_id), - product_version(product_version), uuids(uuids) {} BluetoothDevice::~BluetoothDevice() { @@ -56,10 +34,4 @@ std::vector<std::string> BluetoothDevice::UUIDsFromBluetoothUUIDs( return uuids; } -// static -int8_t BluetoothDevice::ValidatePower(int16_t power) { - return ((power < -127) || (power > 127)) ? BluetoothDevice::kUnknownPower - : power; -} - } // namespace content diff --git a/chromium/content/common/bluetooth/bluetooth_device.h b/chromium/content/common/bluetooth/bluetooth_device.h index 7350efc30d2..5d731a96d1f 100644 --- a/chromium/content/common/bluetooth/bluetooth_device.h +++ b/chromium/content/common/bluetooth/bluetooth_device.h @@ -21,35 +21,14 @@ struct CONTENT_EXPORT BluetoothDevice { BluetoothDevice(); BluetoothDevice(const std::string& id, const base::string16& name, - int8_t tx_power, - int8_t rssi, - uint32_t device_class, - device::BluetoothDevice::VendorIDSource vendor_id_source, - uint16_t vendor_id, - uint16_t product_id, - uint16_t product_version, const std::vector<std::string>& uuids); ~BluetoothDevice(); static std::vector<std::string> UUIDsFromBluetoothUUIDs( const device::BluetoothDevice::UUIDList& uuid_list); - // 127 is used as Unknown Power. According to the Bluetooth spec valid powers - // are between [-127, 127]. Anything outside this range will be considered - // Unknown Power. - static int8_t ValidatePower(int16_t power); - // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different - // values. Add kUnknownTxPower when implemented: http://crbug.com/551572 - const static int8_t kUnknownPower = 127; std::string id; base::string16 name; - int8_t tx_power; - int8_t rssi; - uint32_t device_class; - device::BluetoothDevice::VendorIDSource vendor_id_source; - uint16_t vendor_id; - uint16_t product_id; - uint16_t product_version; std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars. }; diff --git a/chromium/content/common/bluetooth/bluetooth_messages.h b/chromium/content/common/bluetooth/bluetooth_messages.h index 68b51e34f61..a51ebf1854f 100644 --- a/chromium/content/common/bluetooth/bluetooth_messages.h +++ b/chromium/content/common/bluetooth/bluetooth_messages.h @@ -88,20 +88,9 @@ #define IPC_MESSAGE_START BluetoothMsgStart -IPC_ENUM_TRAITS_MAX_VALUE( - device::BluetoothDevice::VendorIDSource, - device::BluetoothDevice::VendorIDSource::VENDOR_ID_MAX_VALUE) - IPC_STRUCT_TRAITS_BEGIN(content::BluetoothDevice) IPC_STRUCT_TRAITS_MEMBER(id) IPC_STRUCT_TRAITS_MEMBER(name) - IPC_STRUCT_TRAITS_MEMBER(tx_power) - IPC_STRUCT_TRAITS_MEMBER(rssi) - IPC_STRUCT_TRAITS_MEMBER(device_class) - IPC_STRUCT_TRAITS_MEMBER(vendor_id_source) - IPC_STRUCT_TRAITS_MEMBER(vendor_id) - IPC_STRUCT_TRAITS_MEMBER(product_id) - IPC_STRUCT_TRAITS_MEMBER(product_version) IPC_STRUCT_TRAITS_MEMBER(uuids) IPC_STRUCT_TRAITS_END() @@ -128,96 +117,6 @@ IPC_MESSAGE_CONTROL3(BluetoothMsg_RequestDeviceError, int /* request_id */, blink::WebBluetoothError /* result */) -// Informs the renderer that the connection request |request_id| succeeded. -IPC_MESSAGE_CONTROL2(BluetoothMsg_GATTServerConnectSuccess, - int /* thread_id */, - int /* request_id */) - -// Informs the renderer that the connection request |request_id| failed. -IPC_MESSAGE_CONTROL3(BluetoothMsg_GATTServerConnectError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError /* result */) - -// Informs the renderer that primary service request |request_id| succeeded. -IPC_MESSAGE_CONTROL3(BluetoothMsg_GetPrimaryServiceSuccess, - int /* thread_id */, - int /* request_id */, - std::string /* service_instance_id */) - -// Informs the renderer that the primary service request |request_id| failed. -IPC_MESSAGE_CONTROL3(BluetoothMsg_GetPrimaryServiceError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError /* result */) - -// Informs the renderer that characteristic request |request_id| succeeded. -IPC_MESSAGE_CONTROL4(BluetoothMsg_GetCharacteristicSuccess, - int /* thread_id */, - int /* request_id */, - std::string /* characteristic_instance_id */, - uint32_t /* characteristic_properties */) - -// Informs the renderer that the characteristic request |request_id| failed. -IPC_MESSAGE_CONTROL3(BluetoothMsg_GetCharacteristicError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError /* result */) - -// Informs the renderer that the multiple-characteristic request |request_id| -// succeeded. -IPC_MESSAGE_CONTROL5( - BluetoothMsg_GetCharacteristicsSuccess, - int /* thread_id */, - int /* request_id */, - std::vector<std::string> /* characteristics_instance_ids */, - std::vector<std::string> /* characteristics_uuids */, - std::vector<uint32_t> /* characteristics_properties */) - -// Informs the renderer that the multiple-characteristic request |request_id| -// failed. -IPC_MESSAGE_CONTROL3(BluetoothMsg_GetCharacteristicsError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError /* result */) - -// Informs the renderer that the value has been read. -IPC_MESSAGE_CONTROL3(BluetoothMsg_ReadCharacteristicValueSuccess, - int /* thread_id */, - int /* request_id */, - std::vector<uint8_t> /* value */) - -// Informs the renderer that an error occurred while reading the value. -IPC_MESSAGE_CONTROL3(BluetoothMsg_ReadCharacteristicValueError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError /* result */) - -// Informs the renderer that the user has successfully subscribed to -// notifications from the device. -IPC_MESSAGE_CONTROL2(BluetoothMsg_StartNotificationsSuccess, - int /* thread_id */, - int /* request_id */) - -// Informs the renderer that an error ocurred when trying to subscribe to -// notifications from the device. -IPC_MESSAGE_CONTROL3(BluetoothMsg_StartNotificationsError, - int /* thread_id */, - int /* request_id */, - blink::WebBluetoothError) - -// Informs the renderer that the user has successfully unsubscribed from -// notifications. -IPC_MESSAGE_CONTROL2(BluetoothMsg_StopNotificationsSuccess, - int /* thread_id */, - int /* request_id */) - -// Informs the renderer that a characteristic's value changed. -IPC_MESSAGE_CONTROL3(BluetoothMsg_CharacteristicValueChanged, - int /* thread_id */, - std::string /* characteristic_instance_id */, - std::vector<uint8_t> /* value */) - // Messages sent from the renderer to the browser. // Requests a bluetooth device from the browser. @@ -227,73 +126,3 @@ IPC_MESSAGE_CONTROL5(BluetoothHostMsg_RequestDevice, int /* frame_routing_id */, std::vector<content::BluetoothScanFilter>, std::vector<device::BluetoothUUID> /* optional_services */) - -// Connects to a bluetooth device. -IPC_MESSAGE_CONTROL4(BluetoothHostMsg_GATTServerConnect, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* device_id */) - -// Disconnect from a device. -IPC_MESSAGE_CONTROL3(BluetoothHostMsg_GATTServerDisconnect, - int /* thread_id */, - int /* frame_routing_id */, - std::string /* device_id */) - -// Gets primary service from bluetooth device. -IPC_MESSAGE_CONTROL5(BluetoothHostMsg_GetPrimaryService, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* device_id */, - std::string /* service_uuid */) - -// Gets a GATT Characteristic within a GATT Service. -IPC_MESSAGE_CONTROL5(BluetoothHostMsg_GetCharacteristic, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* service_instance_id */, - std::string /* characteristic_uuid */) - -// Gets GATT Characteristics within a GATT Service. -IPC_MESSAGE_CONTROL5(BluetoothHostMsg_GetCharacteristics, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* service_instance_id */, - std::string /* characteristics_uuid */) - -// Reads the characteristics value from a bluetooth device. -IPC_MESSAGE_CONTROL4(BluetoothHostMsg_ReadValue, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* characteristic_instance_id */) - -// Subscribes to notifications from a device's characteristic. -IPC_MESSAGE_CONTROL4(BluetoothHostMsg_StartNotifications, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* characteristic_instance_id */) - -// Unsubscribes from notifications from a device's characteristic. -IPC_MESSAGE_CONTROL4(BluetoothHostMsg_StopNotifications, - int /* thread_id */, - int /* request_id */, - int /* frame_routing_id */, - std::string /* characteristic_instance_id */) - -// Register to receive characteristic value changed events. -IPC_MESSAGE_CONTROL3(BluetoothHostMsg_RegisterCharacteristic, - int /* thread_id */, - int /* frame_routing_id */, - std::string /* characteristics_instance_id */) - -// Unregister from characteristic value changed events. -IPC_MESSAGE_CONTROL3(BluetoothHostMsg_UnregisterCharacteristic, - int /* thread_id */, - int /* frame_routing_id */, - std::string /* characteristics_instance_id */) |