Latest | 1.0.2 |
---|---|
Homepage | https://github.com/smartfuturesg/MedCheckSDK_source_iOS |
License | MIT |
Platforms | ios 8.0 |
Authors |
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
MedCheckPod is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'MedCheckPod'
Usage
Pod Import
import BPTrackerPod
Get Shared Instance of BPMDataManager
let bluetoothManager = BPMDataManager.sharedInstance
Set delegate from ViewDidLoad()
override func viewDidLoad() { super.viewDidLoad() . . bluetoothManager.delegate = self bluetoothManager.didUpdateManager() }
Get BPMDataManager delegate method for scanned MedCheck devices
extension ViewController: BPMDataManagerDelegate{ func medcheckBLEDetected(_ peripheral: CBPeripheral, advertisementData: [String : Any], RSSI: NSNumber) { print(bluetoothManager.arrBLEList) } }
Connect to MedCheck BLE device
BPMDataManager.sharedInstance.connectPeripheral(peripheral: connectedPeripheral!)
Disconnect to MedCheck BLE device
BPMDataManager.sharedInstance.didDisconnectPeripheral(connectedPeripheral!)
Clear Blood Pressure data from MedCheck BLE device
BPMDataManager.sharedInstance.clearBPMDataCommand()
Synch current time with Blood Pressure data from MedCheck BLE device
BPMDataManager.sharedInstance.timeSyncOfBPM()
Synch current time with Blood Pressure data from MedCheck BLE device
BPMDataManager.sharedInstance.timeSyncOfBPM()
BPMDataManagerDelegate methods combined with CoreBluetoothManagerDelegate methods.
extension ViewController: BPMDataManagerDelegate{ func medcheckBLEDetected(_ peripheral: CBPeripheral, advertisementData: [String : Any], RSSI: NSNumber) { if bpmDataManager.bluetoothManager.connected { bpmDataManager.connectPeripheral(peripheral: bpmDataManager.connectedPeripheral!) } } func didMedCheckConnected(_ connectedPeripheral: CBPeripheral) { print("didMedCheckConnected (connectedPeripheral)") } func connectedUserData(_ connectedUser: [String : Any]) { print("connectedUserData (connectedUser)") } func willTakeNewReading(_ BLEName: CBPeripheral) { print("willStartDataReading (BLEName)") } func didSyncTime() { print("didSyncTime") } func didTakeNewReading(_ readingData: [String : Any]) { print("didTakeNewReading (jsonStringConvert(readingData))") } func showAlertMessage(_ title : String, message : String) { let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.cancel, handler: nil)) present(alert, animated: true, completion: nil) } func fetchAllDataFromMedCheck(_ readingData: [Any]) { print("fetchAllDataFromMedCheck (jsonStringConvert(readingData))") } func didClearedData() { print("didClearedData") } func willStartDataReading() { print("willStartDataReading") } func didEndDataReading() { print("didEndDataReading") } func jsonStringConvert(_ obj : Any) -> String { do { let jsonData = try JSONSerialization.data(withJSONObject: obj, options: JSONSerialization.WritingOptions.prettyPrinted) return String(data: jsonData, encoding: String.Encoding.utf8)! as String } catch { return "" } } }
Author
smartfuturesg, [email protected]
License
MedCheckPod is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "MedCheckPod", "version": "1.0.2", "summary": "This Pod will allow users to connect with MedCheck BLE Devices and read data from BLE.", "description": "This Pod will allow users to connect with MedCheck BLE Devices and read data from BLE. This SDK will return data.", "homepage": "https://github.com/smartfuturesg/MedCheckSDK_source_iOS", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Sumit Khemani": "[email protected]" }, "source": { "git": "https://github.com/smartfuturesg/MedCheckSDK_source_iOS.git", "tag": "1.0.2" }, "platforms": { "ios": "8.0" }, "source_files": "MedCheckPod/Classes/**/*", "pushed_with_swift_version": "3.0" }
Wed, 28 Feb 2018 13:20:30 +0000