logo
down
shadow

iOS connect/reconnect to Bluetooth device when using external-accessory and MFi


iOS connect/reconnect to Bluetooth device when using external-accessory and MFi

Content Index :

iOS connect/reconnect to Bluetooth device when using external-accessory and MFi
Tag : ios , By : Keniwan
Date : November 27 2020, 01:01 AM


Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Is there a way to connect android device to external printer through Bluetooth?


Tag : android , By : Jaya
Date : March 29 2020, 07:55 AM
it helps some times Peerke is correct. The printer uses rather common ESC/POS standard; you should be able to either find some Java library for this or write your own code to output to printer.
I did similar things for Zebra (CPCL standard) and Blackberry (again, Bluetooth and Java) and found it simple.

Can the External Accessory Framework connect to Bluetooth v4.0 classic?


Tag : ios , By : user186012
Date : March 29 2020, 07:55 AM
will be helpful for those in need So the problem was the wiring on the authentication coprocessor being wrong, as well as the firmware out of date.

Make a bytes packet and send to External accessory Device for print using Bluetooth in iOS


Tag : development , By : unfool
Date : March 29 2020, 07:55 AM
it should still fix some issue Here, I attached the sample code to make the packet and send to External Accessory Device (printer) using Objective C language.
- (void)PrintImage:(UIImage *)image
    {
        NSMutableData* imagedata = [UIImageJPEGRepresentation(image, 0.0) mutableCopy];

    NSMutableData *RequestData=[[NSMutableData alloc]init];

    NSString *bitSeries = @"";
    NSData *data = [[NSData alloc]init];
    //    1
    bitSeries = @"00011011";
    data=[self stringToData:bitSeries];
    NSLog(@"1 : %@", data);
    [RequestData appendData:data];
    //    2
    bitSeries = @"00101010";
    data=[self stringToData:bitSeries];
    NSLog(@"2 : %@", data);
    [RequestData appendData:data];
    //    3
    bitSeries = @"01000011";
    data=[self stringToData:bitSeries];
    NSLog(@"3 : %@", data);
    [RequestData appendData:data];
    //    4
    bitSeries = @"01000001";
    data=[self stringToData:bitSeries];
    NSLog(@"4 : %@", data);
    [RequestData appendData:data];
    //    5
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"5 : %@", data);
    [RequestData appendData:data];
    //    6
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"6 : %@", data);
    [RequestData appendData:data];
    //    7
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"7 : %@", data);
    [RequestData appendData:data];
    //    8
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"8 : %@", data);
    [RequestData appendData:data];
    //    9

    NSMutableArray *arrstr = [self intToBinary:(int)[imagedata length]];

    bitSeries = [arrstr objectAtIndex:0];
    data=[self stringToData:bitSeries];
    NSLog(@"9 : %@", data);
    [RequestData appendData:data];

    bitSeries = [arrstr objectAtIndex:1];
    data=[self stringToData:bitSeries];
    NSLog(@"9 : %@", data);
    [RequestData appendData:data];

    bitSeries =[arrstr objectAtIndex:2];
    data=[self stringToData:bitSeries];
    NSLog(@"9 : %@", data);
    [RequestData appendData:data];

    //    10
    bitSeries = @"00000001";
    data=[self stringToData:bitSeries];
    NSLog(@"10 : %@", data);
    [RequestData appendData:data];
    //    11
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"11 : %@", data);
    [RequestData appendData:data];
    //    12
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"12 : %@", data);
    [RequestData appendData:data];

    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"12 : %@", data);
    [RequestData appendData:data];

    //    13
    bitSeries = @"00000000";
    data=[self stringToData:bitSeries];
    NSLog(@"13 : %@", data);
    [RequestData appendData:data];

    NSLog(@"Final Data is : %@", RequestData);


    if (imagedata !=nil)
    {
        SessionData *obj=[SessionData sharedInstance];
        obj.imageData=imagedata;
        obj.RequestData = RequestData;
        [obj setupSessionManager];
    }
    else
    {
        [[[UIAlertView alloc]initWithTitle:@"Error" message:@"Please Select Image." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];
    }
}

-(NSData *)stringToData : (NSString *)bitSeries
{
    uint8_t value = strtoul([bitSeries UTF8String], NULL, 2);
    NSLog(@"bitSeries : %@ -------> Value : %u",bitSeries, value);
    NSData *data = [NSData dataWithBytes:&value length:sizeof(value)];
    return data;
}

- (NSMutableArray *)intToBinary:(int)number
{
    int bits =  sizeof(number) * 8;
    int bitcnt=bits;

    NSMutableArray *arrStr=[[NSMutableArray alloc]init];
    NSMutableString *binaryStr = [NSMutableString string];

    for (; bits > 0; bits--, number >>= 1)
    {
        [binaryStr insertString:((number & 1) ? @"1" : @"0") atIndex:0];
    }

    if (bitcnt == 32)
    {
        binaryStr=[[binaryStr substringFromIndex:8] mutableCopy];
    }
    else if(bitcnt ==16)
    {
        binaryStr = [[@"00000000" stringByAppendingString:binaryStr] mutableCopy];
    }
    else if (bitcnt == 8)
    {
        binaryStr = [[@"0000000000000000" stringByAppendingString:binaryStr] mutableCopy];
    }
    [arrStr addObject:[binaryStr substringToIndex:8]];
    [arrStr addObject:[binaryStr substringWithRange:NSMakeRange(8, 8)]];
    [arrStr addObject:[binaryStr substringFromIndex:16]];

    NSLog(@"%@",arrStr);

    return arrStr;
}

Get the MAC address of a Bluetooth device with Apples "External Accessory framework"


Tag : iphone , By : MJRider
Date : March 29 2020, 07:55 AM

Bluetooth standard profile to connect accessory to iOS device


Tag : ios , By : user182203
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • ARKit3 Hardware Requirement Clarification
  • ARKit3 How to use TrueDepth camera for face tracking and face meshes of other people?
  • How to discriminate while decoding using Codable Protocol in Swift?
  • 'IPA processing failed' while distributing build in Xcode Beta
  • How to debug a crash which happened when come back from background
  • Synchronising old data with NSPersistentCloudKitContainer
  • iOS app opened from web app with url redirects to Appstore
  • How to change the color of seperator in tableView?
  • Is there a better way to watch for a key-value change?
  • How to make UIBezierPath to fill from the center
  • Why on Xcode 11, UICollectionViewCell changes size as soon as you scroll (I already set size in sizeForItem AtIndexPath:
  • How to scan non LE devices using Swift?
  • Unable to infer closure type in the current context in SwiftUI
  • What is the best way to write common code and use it entire project
  • UISegmentedControl inside UIStackView, segments text not centered - iOS 13
  • Swift & ObjC bridge - cannot find protocol declaration for "WKNavigationDelegate"
  • SwiftUI How to push to next screen when tapping on Button
  • 'NSApp' is unavailable in UIKit for Mac: How to embed Mac only framework in iOS app on macOS?
  • UserDefaults Binding with Toggle in SwiftUI
  • How to create a color with an alpha value using SwiftUI?
  • SwiftUI creates destination views before the user navigates to them
  • Streaming video from https with AVPlayer causes initial delay
  • Tap Action not working when Color is clear SwiftUI
  • SwiftUI NavigationButton: How to navigate to different destinations
  • Supported default light/dark mode colors for Color vs UIColor
  • XCUITest wait for a cell with a specific static text inside it
  • Not able to enable Development mode on iOS 13
  • How to hide the home indicator with SwiftUI?
  • How to write if condition with using label text (Int) values
  • Swift Cannot use instance member within property initializer
  • Issue while getting the frame of the keyboard
  • dynamicMemberLoookup ExpressibleByStringLiteral parameter swift
  • iOS Unity Firebase Messenger Xcode Compile Error: FIRDynamicLinks
  • Firebase Storage Image Cache not updating SWIFT
  • unhandled js exception: application main has not been registered expo TestFlight
  • App freezes on IOS when navigate to another screen - React Navigation
  • How to create haptic feedback for a Button in SwiftUI?
  • How can I achieve automatic scrolling in my text view when text comes down to the keyboard level in Swift?
  • how to get the location with the CLLocationManager every 10 secondes?
  • Calling completion handler of a function from Timer selector function Swift
  • How to make SwiftUI view fullscreen?
  • RAM, JSC, Views, UI and JS usage table appearing whenever I launch my react native app. How to remove this table?
  • Change status bar background color using UIStatusBarManager
  • Should we make tapGesture component an IBAction or IBOutlet to capture the tap event?
  • Iframe automatically goes full screen using Ionic 3.9.2 on iOS
  • How to calculate score out of 1000 given some seconds (In Double)
  • How to calculate time (minutes) between two dates in swift?
  • There was problem loading requested app.it looks like you may be using LAN URL
  • Swift circular corners doesn't work properly on different screen sizes
  • How change .navigationBarTitle font in SwiftUI?
  • What happens if `MPSCNNConvolutionDataSource` protocol's `load` method return false?
  • Why does the UIBarButtonItem not show up when I create it with code?
  • How to prevent following view controller inheriting navigation view controller bar?
  • What does it mean when .xcodeproj files are shown in red in Xcode?
  • Xcode SwiftUI how to scroll the Preview Canvas?
  • Expand tableview and increase scrollview content size by an appropriate difference on clicking a button inside a table c
  • xcodebuild failed with return code: 65 - using CLI/Appcenter but no error messages
  • "'isDeveloperModeEnabled' is deprecated: This no longer needs to be set during development. " What is isDevelo
  • Right click in UIKit for Mac
  • How we Support Dark Mode in Current iOS App with iOS 13?
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com