UHNCGMController Class Reference

Inherits from NSObject
Declared in UHNCGMController.h

Overview

The UHNCGMController provides an interface to a BLE peripheral that implements the Continuous Glucose Monitoring and Device Information services. Other optional services that may be supported include Bond Management, Battery, and Current Time services. Through the inteface and delegate protocol, one should be able to easily make requests of a CGM sensor.

Warning: Support for Device Information, Bond Management, Battery, and Current Time services will be included in a future release.

Initialization of UHNCGMController

– initWithDelegate:

UHNCGMController is initialized with a delegate and optional required services. If only the CGM profile mandatory services are required, initialize using initWithDelegate:. Mandatory services include CGMS and DIS.

- (instancetype)initWithDelegate:(id<UHNCGMControllerDelegate>)delegate

Parameters

delegate

The delegate object that will received discovery, connectivity, and read/write events. This parameter is mandatory.

Return Value

Instance of a UHNCGMController

Declared In

UHNCGMController.h

– initWithDelegate:requiredServices:

UHNCGMController is initialized with a delegate and optional required services.

- (instancetype)initWithDelegate:(id<UHNCGMControllerDelegate>)delegate requiredServices:(NSArray *)serviceUUIDs

Parameters

delegate

The delegate object that will received discovery, connectivity, and read/write events. This parameter is mandatory.

serviceUUIDs

The required services used to filter eligibility of discovered peripherals. Only peripherals that advertist all the required services will be deemed eligible and reported to the delegate. If services is nil, only the peripherals discovered with the mandatory CGM profile services will be reported to the delegate. Mandatory services include CGMS and DIS.

Return Value

Instance of a UHNCGMController

Declared In

UHNCGMController.h

Connection Methods

– isConnected

Determine if a CGM sensor is connected

- (BOOL)isConnected

Return Value

YES if a CGM sensor is connected, otherwise NO

Declared In

UHNCGMController.h

– tryToReconnect

Try to reconnect to the previously connected CGM sensor

- (void)tryToReconnect

Declared In

UHNCGMController.h

– connectToDevice:

Try to connect to the CGM sensor advertising the device name

- (void)connectToDevice:(NSString *)deviceName

Parameters

deviceName

The name of the device with which a connection is desired. Device names are reported when the cgm sensors are discovered.

Declared In

UHNCGMController.h

– disconnect

Disconnect from the connected CGM sensor

- (void)disconnect

Declared In

UHNCGMController.h

CGM Service Characteristics

– readFeatures

Request a read of the supported features of the CGM sesnor

- (void)readFeatures

Discussion

If readFeatures is completed successfully, the delegete will receive the cgmController:didReadFeatures: notification

Declared In

UHNCGMController.h

– readSessionStartTime

Request a read of the CGM sensor session start time

- (void)readSessionStartTime

Discussion

If readSessionStartTime is completed successfully, the delegete will receive the cgmController:didReadSessionStartTime: notification

Declared In

UHNCGMController.h

– sendCurrentTime

Send the current time to the CGM sensor

- (void)sendCurrentTime

Discussion

This command is required at least once after a new session is started

Warning: When sendCurrentTime is completed successfully, it triggers a read of the session start time to see if it was updated after sending the current time. The delegate should wait for the cgmController:didReadSessionStartTime: invocation before proceeding

Declared In

UHNCGMController.h

– readSessionRunTime

Request a read of the CGM sensor session run time

- (void)readSessionRunTime

Discussion

If readSessionRunTime is completed successfully, the delegete will receive the cgmController:didReadSessionRunTime: notification

Declared In

UHNCGMController.h

– readStatus

Request a read of the CGM sensor status

- (void)readStatus

Discussion

If readStatus is completed successfully, the delegete will receive the cgmController:didReadStatus: notification

Declared In

UHNCGMController.h

– enableNotificationMeasurement:

Request that the measurement characteristic notifcations should be enabled or disabled

- (void)enableNotificationMeasurement:(BOOL)enable

Parameters

enable

If YES indicates that the notification should be enabled. NO indicates that the notification should be disabled

Discussion

If enableNotificationMeasurement: is completed successfully, the delegete will receive the cgmController:notificationMeasurement: notification

Declared In

UHNCGMController.h

– enableNotificationRACP:

Request that the RACP characteristic indicationss should be enabled or disabled

- (void)enableNotificationRACP:(BOOL)enable

Parameters

enable

If YES indicates that the indications should be enabled. NO indicates that the indications should be disabled

Discussion

If enableNotificationRACP: is completed successfully, the delegete will receive the cgmController:notificationRACP: notification

The CGM RACP Characteristic needs to be enabled to conduct RACP procedures. Also some RACP procedures also require CGM Measurement Characteristic notification enabled

Declared In

UHNCGMController.h

– enableNotificationCGMCP:

Request that the CGMCP characteristic indicationss should be enabled or disabled

- (void)enableNotificationCGMCP:(BOOL)enable

Parameters

enable

If YES indicates that the indications should be enabled. NO indicates that the indications should be disabled

Discussion

If enableNotificationCGMCP: is completed successfully, the delegete will receive the cgmController:notificationCGMCP: notification

The CGMCP Characteristic needs to be enabled to conduct CGMCP procedures.

Declared In

UHNCGMController.h

Specific Ops Control Point

– startSession

Request the start of a new CGM session

- (void)startSession

Discussion

If startSession is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidStartSession: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘startSessionis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification

Declared In

UHNCGMController.h

– stopSession

Request the stop of a CGM session

- (void)stopSession

Discussion

If stopSession is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidStopSession: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘stopSessionis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification

Declared In

UHNCGMController.h

– resetDeviceSpecificAlert

Request the reset of the device specific alert

- (void)resetDeviceSpecificAlert

Discussion

If resetDeviceSpecificAlert is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidResetDeviceSpecificAlert: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘resetDeviceSpecificAlertis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getCommunicationInterval

Request the current communication interval from the CGM sensor

- (void)getCommunicationInterval

Discussion

If getCommunicationInterval is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetCommunicationInterval: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getCommunicationIntervalis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getMostCurrentCalibrationDataRecord

Request the most current calibration data records from the CGM sensor

- (void)getMostCurrentCalibrationDataRecord

Discussion

If getMostCurrentCalibrationValue is completed successfully, the delegete will receive the cgmController:didGetCalibrationDetails:.

If ‘getMostCurrentCalibrationValueis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getCalibrationDataRecord:

Request the calibration data record from the CGM sensor with specified record number

- (void)getCalibrationDataRecord:(uint16_t)recordNumber

Parameters

recordNumber

The record number of the requested calibration data record

Discussion

If getCalibrationDataRecord: is completed successfully, the delegete will receive the cgmController:didGetCalibrationDetails:.

If ‘getCalibrationDataRecord:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getPatientAlertLevelHigh

Request the current patient high alert level from the CGM sensor

- (void)getPatientAlertLevelHigh

Discussion

If getPatientAlertLevelHigh is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetPatientAlertLevelHigh: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getPatientAlertLevelHighis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getPatientAlertLevelLow

Request the current patient low alert level from the CGM sensor

- (void)getPatientAlertLevelLow

Discussion

If getPatientAlertLevelLow is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetPatientAlertLevelLow: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getPatientAlertLevelLowis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getAlertLevelHypo

Request the current hypo alert level from the CGM sensor

- (void)getAlertLevelHypo

Discussion

If getAlertLevelHypo is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetAlertLevelHypo: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getAlertLevelHypois unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getAlertLevelHyper

Request the current hyper alert level from the CGM sensor

- (void)getAlertLevelHyper

Discussion

If getAlertLevelHyper is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetAlertLevelHyper: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getAlertLevelHyperis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getAlertLevelRateDecrease

Request the current rate of decrease alert level from the CGM sensor

- (void)getAlertLevelRateDecrease

Discussion

If getAlertLevelRateDecrease is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetAlertLevelRateDecrease: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getAlertLevelRateDecreaseis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getAlertLevelRateIncrease

Request the current rate of increase alert level from the CGM sensor

- (void)getAlertLevelRateIncrease

Discussion

If getAlertLevelRateIncrease is completed successfully, the delegete will receive the cgmController:CGMCPResponseOpCode:didGetValue: and/or cgmController:didGetAlertLevelRateIncrease: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getAlertLevelRateIncreaseis unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setCommunicationInterval:

Request to set the current communication interval to the specified value

- (void)setCommunicationInterval:(uint8_t)intervalInMinutes

Parameters

intervalInMinutes

The communication interval to set

Discussion

If setCommunicationInterval: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetCommunicationInterval: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setCommunicationInterval:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– disablePeriodicCommunication

Request to disable periodic communication with the CGM sensor

- (void)disablePeriodicCommunication

Discussion

If disablePeriodicCommunication: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetCommunicationInterval: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘disablePeriodicCommunication:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setFastestCommunicationInterval

Request to set the fastest communication interval supported

- (void)setFastestCommunicationInterval

Discussion

If setFastestCommunicationInterval: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetCommunicationInterval: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setFastestCommunicationInterval:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setCalibrationValue:fluidType:sampleLocation:date:

Request to set a calibration as specified

- (void)setCalibrationValue:(shortFloat)value fluidType:(GlucoseFluidTypeOption)type sampleLocation:(GlucoseSampleLocationOption)location date:(NSDate *)date

Parameters

value

The glucose concentration value with which to calibration. The short float type is defined in UHNBLETypes.h

type

The fluid type with which the glucose concentration was measured

location

The sample location where the glucose concentration was measured

date

The date the glucose concentration was measured

Discussion

If setCalibrationValue:fluidType:sampleLocation:date: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetCalibration: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setCalibrationValue:fluidType:sampleLocation:date:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setPatientHighLevel:

Request to set the patient high alert level

- (void)setPatientHighLevel:(shortFloat)value

Parameters

value

The value of the patient high alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setPatientHighLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelPatientHigh: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setPatientHighLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setPatientLowLevel:

Request to set the patient low alert level

- (void)setPatientLowLevel:(shortFloat)value

Parameters

value

The value of the patient low alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setPatientLowLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelPatientLow: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setPatientLowLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setHypoLevel:

Request to set the hypo alert level

- (void)setHypoLevel:(shortFloat)value

Parameters

value

The value of the hypo alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setHypoLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelHypo: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setHypoLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setHyperLevel:

Request to set the hyper alert level

- (void)setHyperLevel:(shortFloat)value

Parameters

value

The value of the hyper alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setHyperLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelHyper: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setHyperLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setRateDecreaseLevel:

Request to set the rate decrease alert level

- (void)setRateDecreaseLevel:(shortFloat)value

Parameters

value

The value of the rate decrease alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setRateDecreaseLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelRateDecrease: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setRateDecreaseLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

– setRateIncreaseLevel:

Request to set the rate increase alert level

- (void)setRateIncreaseLevel:(shortFloat)value

Parameters

value

The value of the rate increase alert level. The short float type is defined in UHNBLETypes.h

Discussion

If setRateIncreaseLevel: is completed successfully, the delegete will receive the cgmController:CGMCPOperationSuccessful: and/or cgmControllerDidSetAlertLevelRateIncrease: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘setRateIncreaseLevel:is unsuccessful, the delegate will receive thecgmController:CGMCPOperation:failed:` notification.

Declared In

UHNCGMController.h

Record Access Control Point

– getAllStoredRecords

Request to get all stored records from the CGM sensor

- (void)getAllStoredRecords

Discussion

If getAllStoredRecords is completed successfully, the delegete will receive the cgmController:RACPOperationSuccessful: and/or cgmControllerDidGetStoredRecords: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getAllStoredRecordsis unsuccessful, the delegate will receive thecgmController:RACPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getStoredRecordsGreatThanEqualTo:

Request to get stored records greater than or eqaul to the specified date

- (void)getStoredRecordsGreatThanEqualTo:(NSDate *)date

Parameters

date

The date for which the requested records should be greater than or equal to

Discussion

If getStoredRecordsGreatThanEqualTo: is completed successfully, the delegete will receive the cgmController:RACPOperationSuccessful: and/or cgmControllerDidGetStoredRecords: notification (depending on which protocol methods are used). This is left up to the implementation.

If ‘getStoredRecordsGreatThanEqualTo:is unsuccessful, the delegate will receive thecgmController:RACPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getNumberOfStoredRecords

Request to get the number of all the stored records from the CGM sensor

- (void)getNumberOfStoredRecords

Discussion

If getNumberOfStoredRecords is completed successfully, the delegete will receive the cgmController:didGetNumberOfStoredRecords: notification

If ‘getNumberOfStoredRecordsis unsuccessful, the delegate will receive thecgmController:RACPOperation:failed:` notification.

Declared In

UHNCGMController.h

– getNumberOfStoredRecordsGreatThanEqualTo:

Request to get the number of stored records greater than or eqaul to the specified date

- (void)getNumberOfStoredRecordsGreatThanEqualTo:(NSDate *)date

Parameters

date

The date for which the requested records should be greater than or equal to

Discussion

If getNumberOfStoredRecordsGreatThanEqualTo: is completed successfully, the delegete will receive the cgmController:didGetNumberOfStoredRecords: notification

If ‘getNumberOfStoredRecordsGreatThanEqualTo:is unsuccessful, the delegate will receive thecgmController:RACPOperation:failed:` notification.

Declared In

UHNCGMController.h