mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-18 22:20:51 +00:00
allow rotation, clean ups
This commit is contained in:
parent
8667373fa2
commit
9d6f5e03a6
@ -120,6 +120,9 @@ typedef enum {
|
||||
// Link Key Management
|
||||
-(void) dropLinkKeyForAddress:(bd_addr_t*) address;
|
||||
|
||||
// store remote names and link keys
|
||||
-(void)storeDeviceInfo;
|
||||
|
||||
// Connections
|
||||
-(BTstackError) createL2CAPChannelAtAddress:(bd_addr_t*) address withPSM:(uint16_t)psm authenticated:(BOOL)authentication;
|
||||
-(BTstackError) closeL2CAPChannelWithID:(uint16_t) channelID;
|
||||
@ -132,8 +135,6 @@ typedef enum {
|
||||
|
||||
// TODO add l2cap and rfcomm incoming commands
|
||||
|
||||
// store remote names and link keys
|
||||
-(void)storeDeviceInfo;
|
||||
|
||||
@property (nonatomic, assign) NSObject<BTstackManagerDelegate>* delegate;
|
||||
@property (nonatomic, retain) NSMutableDictionary *deviceInfo;
|
||||
|
@ -338,6 +338,12 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
return YES;
|
||||
// return NO;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -35,8 +35,8 @@
|
||||
// Created by Matthias Ringwald on 10/8/09.
|
||||
//
|
||||
|
||||
#import "BTInquiryViewController.h"
|
||||
#import "BTDevice.h"
|
||||
#import <BTstack/BTInquiryViewController.h>
|
||||
#import <BTstack/BTDevice.h>
|
||||
|
||||
#include <btstack/btstack.h>
|
||||
#include <dlfcn.h>
|
||||
@ -413,8 +413,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// return YES;
|
||||
return NO;
|
||||
return YES;
|
||||
// return NO;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
@ -635,5 +635,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -507,7 +507,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
linkKey = [deviceDict objectForKey:PREFS_LINK_KEY];
|
||||
}
|
||||
if (linkKey) {
|
||||
NSLog(@"Sending link key for %@, value %@", devAddress, linkKey);
|
||||
// NSLog(@"Sending link key for %@, value %@", devAddress, linkKey);
|
||||
bt_send_cmd(&hci_link_key_request_reply, &event_addr, [linkKey bytes]);
|
||||
} else {
|
||||
bt_send_cmd(&hci_link_key_request_negative_reply, &event_addr);
|
||||
@ -525,14 +525,14 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
[deviceInfo setObject:deviceDict forKey:devAddress];
|
||||
}
|
||||
[deviceDict setObject:linkKey forKey:PREFS_LINK_KEY];
|
||||
NSLog(@"Adding link key for %@, value %@", devAddress, linkKey);
|
||||
// NSLog(@"Adding link key for %@, value %@", devAddress, linkKey);
|
||||
}
|
||||
|
||||
-(void) dropLinkKeyForAddress:(bd_addr_t*) address {
|
||||
NSString *devAddress = [BTDevice stringForAddress:address];
|
||||
NSMutableDictionary * deviceDict = [deviceInfo objectForKey:devAddress];
|
||||
[deviceDict removeObjectForKey:PREFS_LINK_KEY];
|
||||
NSLog(@"Removing link key for %@", devAddress);
|
||||
// NSLog(@"Removing link key for %@", devAddress);
|
||||
}
|
||||
|
||||
-(void) handlePacketWithType:(uint8_t)packet_type forChannel:(uint16_t)channel andData:(uint8_t *)packet withLen:(uint16_t) size {
|
||||
|
Loading…
x
Reference in New Issue
Block a user