Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Type 'ViewController' does not conform to protocol
- #import <Foundation/Foundation.h>
- #import <CoreBluetooth/CoreBluetooth.h>
- @protocol BT_BLE_LibDelegate;
- @interface BT_BLE_Lib : NSObject< CBCentralManagerDelegate>
- {
- NSObject<BT_BLE_LibDelegate> __weak *delegate;
- NSError *BTError;
- int BLEMode;
- }
- @property (nonatomic, weak) id<BT_BLE_LibDelegate> __weak delegate;
- - (void) UARTSend:(NSString*)message; // UART 送到藍芽
- - (int) iBeaconStartScan; // 找 iBeacon
- - (int) iBeaconStopScan; // 停止 iBeacon
- - (int) ConnectBlueTooth; // 連接藍芽
- - (int) BlueToothConnectStatus; // 藍芽連接情況
- - (void) DigitalOuts:(NSString*)sender; // 藍芽接腳數位輸出
- - (void) DigitalInput; // 藍芽接腳數位輸入
- @end
- @protocol BT_BLE_LibDelegate
- - (void) BlueToothStatus:(NSString*)errorMsg; // 取的HW 藍牙的連接情況
- - (void) DidReceiveData:(NSString*)message; // 收到資料
- - (void) DidReadHardwareRevisionString:(NSString*)Msg; // 硬體相關的訊息
- - (void) DigitalInputPinsChanges:(NSString*)Msg; // 數位輸入的情況改變
- - (void) DidReceiveiBeacon:(NSString*)Name RSSI:(NSNumber *)RSSI Action:(NSString*)Action; // iBeacon 的情況
- @end
- import UIKit
- class ViewController: UIViewController , BT_BLE_LibDelegate{
- var myObj : BT_BLE_Lib?
- override func viewDidLoad() {
- super.viewDidLoad()
- myObj = BT_BLE_Lib()
- myObj?.delegate = self
- }
- func DidReceiveData(message: NSString?) {
- }
- func BlueToothStatus(errorMsg: NSString?) {
- }// 取的HW 藍牙的連接情況
- func DidReadHardwareRevisionString(Msg: NSString?) {
- }// 硬體相關的訊息
- func DigitalInputPinsChanges(Msg: NSString?) {
- }// 數位輸入的情況改變
- func DidReceiveiBeacon(Name: NSString?, RSSI: Int, Action: NSString?) {
- }
- func didReceiveData(_ message: String?) {
- }
- func blueToothStatus(_ errorMsg: String?) {
- }
- func didReadHardwareRevisionString(_ Msg: String?) {
- }
- func digitalInputPinsChanges(_ Msg: String?) {
- }
- func didReceiveiBeacon(_ Name: String?, rssi RSSI: NSNumber, action Action: String?) {
- }
- @protocol BT_BLE_LibDelegate
- - (void) blueToothStatus:(NSString* _Nullable)errorMsg; // 取的HW 藍牙的連接情況
- - (void) didReceiveData:(NSString* _Nullable)message; // 收到資料
- - (void) didReadHardwareRevisionString: (NSString* _Nullable)Msg; // 硬體相關的訊息
- - (void) digitalInputPinsChanges:(NSString* _Nullable)Msg; // 數位輸入的情況改變
- - (void) didReceiveiBeacon:(NSString* _Nullable)Name RSSI:(NSNumber * _Nonnull)RSSI Action:(NSString* _Nullable)Action; // iBeacon 的情況
- @end
- public func didReceiveiBeacon(_ Name: String!, rssi RSSI: NSNumber!, action Action: String!)
Add Comment
Please, Sign In to add comment