2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bluetooth.notification;
16 * The {@link BluetoothScanNotification} provides a notification of a received scan packet
18 * @author Chris Jackson - Initial contribution
20 public class BluetoothScanNotification extends BluetoothNotification {
22 * The receive signal strength for this beacon packet
24 private int rssi = Integer.MIN_VALUE;
29 private byte[] data = null;
32 * The manufacturer specific data
34 private byte[] manufacturerData = null;
39 private BluetoothBeaconType beaconType = BluetoothBeaconType.BEACON_UNKNOWN;
44 private String name = new String();
47 * An enumeration of basic beacon types
49 public enum BluetoothBeaconType {
56 * Sets the receive signal strength RSSI value for the scan
58 * param rssi the RSSI value for the scan packet in dBm
60 public void setRssi(int rssi) {
65 * Gets the receive signal strength RSSI value for the scan
67 * @return the RSSI value for the scan packet in dBm or Integer.MIN_VALUE if no RSSI is available.
69 public int getRssi() {
74 * Sets the scan packet data
76 * @param data a byte array containing the raw packet data;
78 public void setData(byte[] data) {
83 * Gets the scan packet data
85 * @return a byte array containing the data or null if none is set
87 public byte[] getData() {
92 * Sets the scan packet manufacturer specific data
94 * @param manufacturerData a byte array containing the manufacturer specific data
96 public void setManufacturerData(byte[] manufacturerData) {
97 this.manufacturerData = manufacturerData;
101 * Gets the scan packet manufacturer specific data
103 * @return a byte array containing the manufacturer specific data or null if none is set
105 public byte[] getManufacturerData() {
106 return manufacturerData;
110 * Sets the beacon type for this packet
112 * @beaconType the {@link BluetoothBeaconType} for this packet
114 public void setBeaconType(BluetoothBeaconType beaconType) {
115 this.beaconType = beaconType;
119 * Gets the beacon type for this packet
121 * @return the {@link BluetoothBeaconType} for this packet
123 public BluetoothBeaconType getBeaconType() {
128 * Sets the device name
130 * @param name {@link String} containing the device name
132 public void setDeviceName(String name) {
137 * Gets the device name
139 * @return {@link String} containing the device name
141 public String getDeviceName() {