-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Comparable
public final class BluetoothPeripheral extends Peripheral implements Comparable<BluetoothPeripheral>
The BluetoothPeripheral class represents Bluetooth peripheral models that can be discovered or read from by BluetoothPeripheralController. Information here reflects the bluetooth.json file retrieved to construct the supported peripherals list which is presented to the user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
BluetoothPeripheral.BluetoothPeripheralOption
Bluetooth options for the connection policy for a peripheral
BluetoothPeripheralOptionNone Default value of 0 indicating no peripheral options
BluetoothPeripheralOptionConnectsAfterMeasurement Indicates that a peripheral is only reachable via Bluetooth after a reading takes place. In this circumstance weimmediately send the callback onPeripheralDiscovered so the user can be prompted to begin taking a measurement
-
Field Summary
Fields Modifier and Type Field Description private Integer
options
private Integer
connectionTimeoutInterval
private Integer
readingTimeoutInterval
private String
version
private String
pairingInstruction
private String
instruction
private String
readingInstruction
private Pattern
regexPattern
private String
pinString
-
Constructor Summary
Constructors Constructor Description BluetoothPeripheral()
-
Method Summary
Modifier and Type Method Description Integer
getOptions()
Specialized configuration for the peripheral Integer
getConnectionTimeoutInterval()
Timeout for connecting/scanning Integer
getReadingTimeoutInterval()
Customer-facing instructions for reading String
getVersion()
Library version which supports this peripheral String
getPairingInstruction()
Text to be presented to the user when pairPeripheral is called and BluetoothPeripheral property, requiresPairing is TRUE String
getInstruction()
Text to be presented to the user when readFromPeripheral is called String
getReadingInstruction()
Text to be presented to the user when the (BluetoothPeripheralController, BluetoothPeripheral)callback is received during reading Pattern
getRegexPattern()
Regular expression used to filter advertised names for the broadcastingName of this peripheral String
getPinString()
Set the pinString for peripherals requiring it void
setPinString(String pinString)
Set the pinString for peripherals requiring it static List<BluetoothPeripheral>
getSupportedPeripherals()
List of supported BluetoothPeripheral objects. static BluetoothPeripheral
getPeripheralForID(int id)
Returns the peripheral give the getSupportedPeripherals id static List<BluetoothPeripheral>
getPeripheralsForType(Peripheral.PeripheralType peripheralType)
Returns the list of supported peripherals for a given PeripheralType. boolean
equals(Object o)
Boolean
requiresPairing()
Accessor for BluetoothPeripheral requiresPairing boolean
matchesRegexPattern(String advertisedPeripheralName)
Given the scanned peripheral name, see if it matches this sought peripheral's name in regex form. int
compareTo(BluetoothPeripheral bluetoothPeripheral)
-
Methods inherited from class com.validic.mobile.Peripheral
getConnectionType, getImageUrl, getManufacturer, getModel, getName, getPeripheralForConnectionTypeAndId, getPeripheralID, getPeripheralType, getType, isDisabled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getOptions
Integer getOptions()
Specialized configuration for the peripheral
-
getConnectionTimeoutInterval
Integer getConnectionTimeoutInterval()
Timeout for connecting/scanning
-
getReadingTimeoutInterval
Integer getReadingTimeoutInterval()
Customer-facing instructions for reading
-
getVersion
String getVersion()
Library version which supports this peripheral
-
getPairingInstruction
String getPairingInstruction()
Text to be presented to the user when pairPeripheral is called and BluetoothPeripheral property, requiresPairing is TRUE
-
getInstruction
String getInstruction()
Text to be presented to the user when readFromPeripheral is called
-
getReadingInstruction
String getReadingInstruction()
Text to be presented to the user when the (BluetoothPeripheralController, BluetoothPeripheral)callback is received during reading
-
getRegexPattern
Pattern getRegexPattern()
Regular expression used to filter advertised names for the broadcastingName of this peripheral
-
getPinString
String getPinString()
Set the pinString for peripherals requiring it
-
setPinString
void setPinString(String pinString)
Set the pinString for peripherals requiring it
-
getSupportedPeripherals
static List<BluetoothPeripheral> getSupportedPeripherals()
List of supported BluetoothPeripheral objects. These devices can be passed to BluetoothController
-
getPeripheralForID
static BluetoothPeripheral getPeripheralForID(int id)
Returns the peripheral give the getSupportedPeripherals id
- Parameters:
id
- for peripheral
-
getPeripheralsForType
static List<BluetoothPeripheral> getPeripheralsForType(Peripheral.PeripheralType peripheralType)
Returns the list of supported peripherals for a given PeripheralType.
-
requiresPairing
Boolean requiresPairing()
Accessor for BluetoothPeripheral requiresPairing
-
matchesRegexPattern
boolean matchesRegexPattern(String advertisedPeripheralName)
Given the scanned peripheral name, see if it matches this sought peripheral's name in regex form. Answers the question, "Is this peripheral's regex form of the broadcasting name a match for the advertising peripheral name we are being passed?
- Parameters:
advertisedPeripheralName
- the advertised name found in the scanning process
-
compareTo
int compareTo(BluetoothPeripheral bluetoothPeripheral)
-
-
-
-