{"id":58,"date":"2014-11-05T12:15:13","date_gmt":"2014-11-05T04:15:13","guid":{"rendered":"http:\/\/www.ifroglab.com\/?p=58"},"modified":"2016-10-16T07:48:51","modified_gmt":"2016-10-15T23:48:51","slug":"ifroglab-ibeacon-ios-api-sdk-%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.ifroglab.com\/tw\/?p=58","title":{"rendered":"iFrogLab ios API SDK \u6587\u4ef6 \u3010iFrogLab\u3011"},"content":{"rendered":"<h2>\u4ecb\u7d39<\/h2>\n<p>\u672c\u7248 ios API SDK \u6587\u4ef6\u5305\u542b<\/p>\n<ul>\n<li>BT_BLE_Lib.framework<\/li>\n<li>BT_BLE_Lib.h<\/li>\n<\/ul>\n<p>\u5b98\u65b9\u7bc4\u4f8b\u53ef\u4ee5<a href=\"http:\/\/www.ifroglab.com\/?p=24\">\u5728\u6b64<\/a>\u53d6\u5f97<\/p>\n<h2>iFrogLAB BT_BLE_LibDelegate API \u51fd\u6578\u6709<\/h2>\n<ul>\n<li>&#8211; (void) UARTSend:(NSString*)message; \/\/ UART \u9001\u5230\u85cd\u82bd<\/li>\n<li>&#8211; (int) iBeaconStartScan; \/\/ \u627e iBeacon<\/li>\n<li>&#8211; (int) iBeaconStopScan; \/\/ \u505c\u6b62 iBeacon<\/li>\n<li>&#8211; (int) ConnectBlueTooth; \/\/ \u9023\u63a5\u85cd\u82bd<\/li>\n<li>&#8211; (int) BlueToothConnectStatus; \/\/ \u85cd\u82bd\u9023\u63a5\u60c5\u6cc1<\/li>\n<li>&#8211; (void) DigitalOuts:(NSString*)sender; \/\/ \u85cd\u82bd\u63a5\u8173\u6578\u4f4d\u8f38\u51fa<\/li>\n<li>&#8211; (void) DigitalInput; \/\/ \u85cd\u82bd\u63a5\u8173\u6578\u4f4d\u8f38\u5165<\/li>\n<\/ul>\n<h2>iFrogLAB BT_BLE_LibDelegate \u89f8\u767c\u4e8b\u4ef6\u6709<\/h2>\n<ul>\n<li>&#8211; (void) BlueToothStatus:(NSString*)errorMsg; \/\/ \u53d6\u7684HW \u85cd\u7259\u7684\u9023\u63a5\u60c5\u6cc1<\/li>\n<li>&#8211; (void) DidReceiveData:(NSString*)message; \/\/ \u6536\u5230\u8cc7\u6599<\/li>\n<li>&#8211; (void) DidReadHardwareRevisionString:(NSString*)Msg; \/\/ \u786c\u9ad4\u76f8\u95dc\u7684\u8a0a\u606f<\/li>\n<li>&#8211; (void) DigitalInputPinsChanges:(NSString*)Msg; \/\/ \u6578\u4f4d\u8f38\u5165\u7684\u60c5\u6cc1\u6539\u8b8a<\/li>\n<li>&#8211; (void) DidReceiveiBeacon:(NSString*)Name RSSI:(NSNumber *)RSSI Action:(NSString*)Action; \/\/ iBeacon \u7684\u60c5\u6cc1<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u5feb\u901f\u4e0a\u624b<\/h2>\n<h3>\u7b2c1\u6b65\uff1a\u52a0\u4e0a\u51fd\u793a\u5eab<\/h3>\n<p>\u8acb\u5728iOS\u5c08\u6848\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u6a94\u6848\u3002<\/p>\n<ul>\n<li>BT_BLE_Lib.framework<\/li>\n<li>BT_BLE_Lib.h<\/li>\n<\/ul>\n<h3>\u7b2c2\u6b65\uff1a\u65b0\u589e\u985e\u5225\u8b8a\u6578<\/h3>\n<p><code><br \/>\n#import \"BT_BLE_Lib.h\"<br \/>\n@interface ViewController : UIViewController&lt;UITableViewDelegate, UITableViewDataSource,BT_BLE_LibDelegate&gt;<br \/>\n{<br \/>\nBT_BLE_Lib* m_BT_BLE_Lib;<br \/>\n}<br \/>\n<\/code><\/p>\n<h3>\u7b2c2\u6b65\uff1a\u85cd\u82bd\u985e\u5225\u521d\u59cb\u5316<\/h3>\n<p><code><br \/>\n- (void)viewDidLoad {<br \/>\n[super viewDidLoad];<br \/>\nself.title=@\"iFrogLab iBeacon\";<br \/>\n\/\/ \u85cd\u82bd\u521d\u59cb\u5316<br \/>\nif(m_BT_BLE_Lib==nil){<br \/>\nm_BT_BLE_Lib=[[BT_BLE_Lib alloc] init]; \/\/ \u521d\u59cb\u5316<br \/>\nm_BT_BLE_Lib.delegate=self; \/\/ \u63a5\u6536\u53cd\u61c9\u7684class \u6307\u5b9a\u70ba\u9019\u500b<br \/>\n}<\/code><\/p>\n<p>}<\/p>\n<h3>\u7b2c4\u6b65\uff1a\u85cd\u82bdiBeacon\u555f\u52d5<\/h3>\n<p><code><br \/>\n[m_BT_BLE_Lib iBeaconStartScan];<br \/>\n<\/code><\/p>\n<h3>\u7b2c5\u6b65\uff1a\u85cd\u82bdiBeacon \u56de\u50b3\u6240\u627e\u5230\u7684\u8a2d\u5099<\/h3>\n<p><code><br \/>\n- (void) DidReceiveiBeacon:(NSString*)Name RSSI:(NSNumber *)RSSI Action:(NSString*)Action \/\/ iBeacon \u7684\u60c5\u6cc1<br \/>\n{<br \/>\nNSLog(@\"Discovered %@ at %@, Action=%@\", Name, RSSI,Action);<br \/>\n}<br \/>\n<\/code><\/p>\n<h3>\u7b2c6\u6b65\uff1a\u7d50\u679c<\/h3>\n<p><a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-05-at-12.32.51-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-65\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-05-at-12.32.51-PM.jpg\" alt=\"Screen Shot 2014-11-05 at 12.32.51 PM\" width=\"485\" height=\"234\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-05-at-12.32.51-PM.jpg 485w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-05-at-12.32.51-PM-300x144.jpg 300w\" sizes=\"(max-width: 485px) 100vw, 485px\" \/><\/a><\/p>\n<h3>\u7b2c7\u6b65\uff1a\u5be6\u505a<\/h3>\n<p>\u5b98\u65b9\u7bc4\u4f8b\u53ef\u4ee5<a href=\"http:\/\/www.ifroglab.com\/?p=24\">\u5728\u6b64<\/a>\u53d6\u5f97<br \/>\n<a href=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-06-at-7.38.35-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-144\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2014\/11\/Screen-Shot-2014-11-06-at-7.38.35-PM.jpg\" alt=\"Screen Shot 2014-11-06 at 7.38.35 PM\" width=\"220\" height=\"150\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7d39 \u672c\u7248 ios API SDK \u6587\u4ef6\u5305\u542b BT_BLE_Lib.framew [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":59,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,90,88,5],"tags":[],"class_list":{"0":"post-58","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-1-","8":"category-1--ibeacon","10":"category-5"},"_links":{"self":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/58"}],"collection":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":11,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":7409,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/7409"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/media\/59"}],"wp:attachment":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}