iOS HMLocalDeviceConfiguration
HMLocalDeviceConfiguration is used to change some settings for the Bluetooth connection.
Initialising
Initialises the HMLocalDeviceConfiguration.
Declaration
init<C>(broadcastingFilter: C? = default, overrideAdvertisementName: Bool? = default) where C : Collection, C.Element == UInt8
Parameters
broadcastingFilter | (UInt8 Collection) sets the bluetooth advertisment filter (9 bytes) |
overrideAdvertisementName | (Bool) true will disable the HM 12345-type of device name |
Returns
HMLocalDeviceConfiguration
Example
import HMKit
let filter: [UInt8] = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09]
let configuration = HMLocalDeviceConfiguration(broadcastingFilter: filter,
overrideAdvertisementName: false)
Properties
Set the Bluetooth advertisement filter
Declaration
var broadcastingFilter: Data?
Discussion
Sets the advertisment data to contain the filter (i.e. a vehicle's serial), for the scanning device (i.e. the vehicle) to find this device more easily among many.
Value, if set, must be 9-bytes, otherwise change is ignored. If not set (nil
used) the filter is cleared.
Must restart broadcasting for changes to take effect.
Defaults to nil
Read More
Set the version of the secure container
Declaration
var containerVersion: ContainerVersion
Declaration
Changes the outgoing version, if the receiver uses a different one, the incoming version will be detected automatically.
Must restart communications for changes to take effect.
Defaults to `.two`
*Warning*: should not be changed if the receiver's version isn't known.
Read More
Enable encryption of commands
Declaration
var isEncryptionEnabled: Bool
Discussion
It's highly recommended to not change this.
Defaults to true
Disable the HM 12345-type of device name
Declaration
var overrideAdvertisementName: Bool
Discussion
Must restart broadcasting for changes to take effect.
Defaults to nil
Computed Properties
If the broadcasting filter is active in this configuration
Types
Container version
Declaration
public enum ContainerVersion {
case one
case two
}
Discussion
Version used for Secure Container and Telematics Container.