Guest User

Untitled

a guest
Jun 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. Type 'ViewController' does not conform to protocol
  2.  
  3. #import <Foundation/Foundation.h>
  4. #import <CoreBluetooth/CoreBluetooth.h>
  5.  
  6.  
  7. @protocol BT_BLE_LibDelegate;
  8. @interface BT_BLE_Lib : NSObject< CBCentralManagerDelegate>
  9. {
  10. NSObject<BT_BLE_LibDelegate> __weak *delegate;
  11. NSError *BTError;
  12. int BLEMode;
  13. }
  14. @property (nonatomic, weak) id<BT_BLE_LibDelegate> __weak delegate;
  15. - (void) UARTSend:(NSString*)message; // UART 送到藍芽
  16. - (int) iBeaconStartScan; // 找 iBeacon
  17. - (int) iBeaconStopScan; // 停止 iBeacon
  18. - (int) ConnectBlueTooth; // 連接藍芽
  19. - (int) BlueToothConnectStatus; // 藍芽連接情況
  20. - (void) DigitalOuts:(NSString*)sender; // 藍芽接腳數位輸出
  21. - (void) DigitalInput; // 藍芽接腳數位輸入
  22. @end
  23.  
  24. @protocol BT_BLE_LibDelegate
  25. - (void) BlueToothStatus:(NSString*)errorMsg; // 取的HW 藍牙的連接情況
  26.  
  27. - (void) DidReceiveData:(NSString*)message; // 收到資料
  28.  
  29. - (void) DidReadHardwareRevisionString:(NSString*)Msg; // 硬體相關的訊息
  30. - (void) DigitalInputPinsChanges:(NSString*)Msg; // 數位輸入的情況改變
  31. - (void) DidReceiveiBeacon:(NSString*)Name RSSI:(NSNumber *)RSSI Action:(NSString*)Action; // iBeacon 的情況
  32. @end
  33.  
  34. import UIKit
  35.  
  36. class ViewController: UIViewController , BT_BLE_LibDelegate{
  37.  
  38. var myObj : BT_BLE_Lib?
  39. override func viewDidLoad() {
  40.  
  41. super.viewDidLoad()
  42. myObj = BT_BLE_Lib()
  43. myObj?.delegate = self
  44.  
  45. }
  46.  
  47. func DidReceiveData(message: NSString?) {
  48.  
  49. }
  50.  
  51. func BlueToothStatus(errorMsg: NSString?) {
  52.  
  53. }// 取的HW 藍牙的連接情況
  54.  
  55. func DidReadHardwareRevisionString(Msg: NSString?) {
  56.  
  57. }// 硬體相關的訊息
  58. func DigitalInputPinsChanges(Msg: NSString?) {
  59.  
  60. }// 數位輸入的情況改變
  61. func DidReceiveiBeacon(Name: NSString?, RSSI: Int, Action: NSString?) {
  62.  
  63. }
  64.  
  65. func didReceiveData(_ message: String?) {
  66.  
  67. }
  68.  
  69. func blueToothStatus(_ errorMsg: String?) {
  70.  
  71. }
  72.  
  73. func didReadHardwareRevisionString(_ Msg: String?) {
  74.  
  75. }
  76.  
  77. func digitalInputPinsChanges(_ Msg: String?) {
  78.  
  79. }
  80.  
  81. func didReceiveiBeacon(_ Name: String?, rssi RSSI: NSNumber, action Action: String?) {
  82.  
  83. }
  84.  
  85. @protocol BT_BLE_LibDelegate
  86. - (void) blueToothStatus:(NSString* _Nullable)errorMsg; // 取的HW 藍牙的連接情況
  87.  
  88. - (void) didReceiveData:(NSString* _Nullable)message; // 收到資料
  89.  
  90. - (void) didReadHardwareRevisionString: (NSString* _Nullable)Msg; // 硬體相關的訊息
  91. - (void) digitalInputPinsChanges:(NSString* _Nullable)Msg; // 數位輸入的情況改變
  92. - (void) didReceiveiBeacon:(NSString* _Nullable)Name RSSI:(NSNumber * _Nonnull)RSSI Action:(NSString* _Nullable)Action; // iBeacon 的情況
  93. @end
  94.  
  95. public func didReceiveiBeacon(_ Name: String!, rssi RSSI: NSNumber!, action Action: String!)
Add Comment
Please, Sign In to add comment