Skip to main content

mergBLE

Type

library

Description

mergBLE is a LiveCode external for iOS and OS X that enables CoreBluetooth (BLE) functionality. You can use the external to discover and interact with peripherals or advertise your app as a peripheral for others to interact with.

Associated Syntax

Command

NameSummarySyntax
mergBLEInitializeInitialise the externalmergBLEInitialize
mergBLEScanForPeripheralsWithServicesScans for peripherals that are advertising servicesmergBLEScanForPeripheralsWithServices [<pUUIDs>]
mergBLEStopScanningForPeripheralsStop the scan begun by mergBLEScanForPeripheralsWithServicesmergBLEStopScanningForPeripherals
mergBLEConnectPeripheralEstablishes a local connection to a peripheralmergBLEConnectPeripheral <pUUID>
mergBLECancelConnectionToPeripheralCancel a pending or active connection to a peripheralmergBLECancelConnectionToPeripheral <pUUID>
mergBLEPeripheralDiscoverServicesDiscover the services offered by a peripheralmergBLEPeripheralDiscoverServices <pUUID>, [<pServiceUUIDs>]
mergBLEPeripheralDiscoverIncludedServicesForServiceWhen discovered the mergBLEPeripheralDidDiscoverIncludedServices is sent mergBLEPeripheralDiscoverIncludedServicesForService <pUUID>, <pService>, [<pServiceUUIDs>]
mergBLEPeripheralDiscoverCharacteristicsForServiceDiscover the characteristics of a servicemergBLEPeripheralDiscoverCharacteristicsForService <pUUID>, <pService>, [<pCharacteristicUUIDs>]
mergBLEPeripheralReadValueForCharacteristicRead the value of a service characteristicmergBLEPeripheralReadValueForCharacteristic <pUUID>, <pService>, <pCharacteristic>
mergBLEPeripheralWriteValueForCharacteristicWrite the value for a service characteristicmergBLEPeripheralWriteValueForCharacteristic <pUUID>, <pService>, <pCharacteristic>, <pValue>
mergBLEPeripheralSetNotificationsForCharacteristicSet notifications to service characteristic value changesmergBLEPeripheralSetNotificationsForCharacteristic <pUUID>, <pService>, <pCharacteristic>, <pNotify>
mergBLEPeripheralDiscoverDescriptorsForCharacteristicDiscover the descriptors of a service characteristicmergBLEPeripheralDiscoverDescriptorsForCharacteristic <pUUID>, <pService>, <pCharacteristic>
mergBLEPeripheralReadValueForDescriptorRead the value of a descriptor of a service characteristicmergBLEPeripheralReadValueForDescriptor <pUUID>, <pService>, <pCharacteristic>, <pDescriptor>
mergBLEPeripheralWriteValueForDescriptorWrite the value of a descriptor of a service characteristicmergBLEPeripheralWriteValueForDescriptor <pUUID>, <pService>, <pCharacteristic>, <pDescriptor>, <pValue>
mergBLEPeripheralReadRSSIRead the RSSI value which is returned via the mergBLEPeripheralDidUpdateRSSI message mergBLEPeripheralReadRSSI <pUUID>
mergBLECreateServiceCreate a service to advertisemergBLECreateService <pUUID>
mergBLEDeleteServiceDelete a servicemergBLEDeleteService <pUUID>
mergBLEAddCharacteristicToServiceAdd a characteristic to a previously created servicemergBLEAddCharacteristicToService <pUUID>, <pCharacteristic>, <pRead>, <pWriteWithoutResponse>, <pWrite>, <pNotify>, <pIndicate>, <pAuthenticatedSignedWrites>, <pNotifyEncryptionRequired>, <pIndicateEncryptionRequired>, [<pValue>]
mergBLEUpdateValueForCharacteristicOfServicemergBLEUpdateValueForCharacteristicOfService <pUUID>, <pCharacteristic>, <pValue>
mergBLERemoveCharacteristicFromServicemergBLERemoveCharacteristicFromService <pUUID>, <pCharacteristic>
mergBLEStartAdvertisingmergBLEStartAdvertising [<pName>]
mergBLEStopAdvertisingmergBLEStopAdvertising

Message

NameSummarySyntax
mergBLEDidDiscoverPeripheralSent when a peripheral is discoveredmergBLEDidDiscoverPeripheral <pUUID>, <pName>, <pRSSI>, <pTx>, <pServiceUUIDs>, <pManufacturerData>
mergBLEDidConnectPeripheralSent when a peripheral connectedmergBLEDidConnectPeripheral <pUUID>
mergBLEDidFailToConnectPeripheralSent when a peripheral connection failedmergBLEDidFailToConnectPeripheral <pUUID>, <pError>
mergBLEDidDisconnectPeripheralSent when a peripheral is disconnectedmergBLEDidDisconnectPeripheral <pUUID>
mergBLEPeripheralDidDiscoverServicesSent when services are discoveredmergBLEPeripheralDidDiscoverServices <pUUID>, <pServices>
mergBLEPeripheralDidDiscoverIncludedServicesSent when services included in a service are discoveredmergBLEPeripheralDidDiscoverIncludedServices <pUUID>, <pService>, <pServices>
mergBLEPeripheralDidDiscoverCharacteristicsForServiceSent when characteristics of a service are discoveredmergBLEPeripheralDidDiscoverCharacteristicsForService <pUUID>, <pService>, <pCharacteristic>
mergBLEPeripheralDidUpdateValueForCharacteristicSent when a characteristic value is readmergBLEPeripheralDidUpdateValueForCharacteristic <pUUID>, <pCharacteristic>, <pValue>, <pError>
mergBLEPeripheralDidWriteValueForCharacteristicSent when a characteristic value is writtenmergBLEPeripheralDidWriteValueForCharacteristic <pUUID>, <pCharacteristic>, <pError>
mergBLEPeripheralDidUpdateNotificationStateForCharacteristicSent when the update notification state is set for a characterisitcmergBLEPeripheralDidUpdateNotificationStateForCharacteristic <pUUID>, <pCharacteristic>, <pError>
mergBLEPeripheralDidDiscoverDescriptorsForCharacteristicSent when the descriptors of a characteristic of a service are discovered mergBLEPeripheralDidDiscoverDescriptorsForCharacteristic <pUUID>, <pCharacteristic>, <pDescriptors>
mergBLEPeripheralDidUpdateValueForDescriptorSent when a descriptor value is readmergBLEPeripheralDidUpdateValueForDescriptor <pUUID>, <pDescriptor>, <pValue>, <pError>
mergBLEPeripheralDidWriteValueForDescriptorSent when a descriptor value is writtenmergBLEPeripheralDidWriteValueForDescriptor <pUUID>, <pDescriptor>, <pError>
mergBLECentralManagerDidUpdateStateSent when the central manager updates statemergBLECentralManagerDidUpdateState <pState>
mergBLEPeripheralDidUpdateRSSISent when the RSSI value is readmergBLEPeripheralDidUpdateRSSI <pUUID>, <pRSSI>, <pError>
mergBLEPeripheralDidModifyServicesSent when the peripheral adds or invalidates servicesmergBLEPeripheralDidModifyServices <pUUID>, <pInvalidatedServices>
mergBLEPeripheralManagerDidStartAdvertisingSent when the device starts advertising as a peripheralmergBLEPeripheralManagerDidStartAdvertising <pError>
mergBLECentralDidSubscribeToCharacteristicSent when a central subscribes to one of the advertised service characteristics mergBLECentralDidSubscribeToCharacteristic <pUUID>, <pCharacteristic>
mergBLECentralDidUnsubscribeToCharacteristicSent when a central unsubscribes from one of the advertised service characteristics mergBLECentralDidUnsubscribeToCharacteristic <pUUID>, <pCharacteristic>
mergBLECentralDidUpdateValueForCharacteristicSent when a central writes the value of a characteristicmergBLECentralDidUpdateValueForCharacteristic <pUUID>, <pCharacteristic>, <pValue>
mergBLEPeripheralManagerDidUpdateStateSent when the peripheral manager updates statemergBLEPeripheralManagerDidUpdateState <pState>

Function

NameSummarySyntax
mergBLEPeripheralServiceAdvertisementDataGet the advertisement data for a service from a peripheral discoverymergBLEPeripheralServiceAdvertisementData(<pUUID>, <pService>)
Thank you for your feedback!

Was this page helpful?