Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 设置用户使用蓝牙_Ios_Iphone_Core Bluetooth - Fatal编程技术网

Ios 设置用户使用蓝牙

Ios 设置用户使用蓝牙,ios,iphone,core-bluetooth,Ios,Iphone,Core Bluetooth,如何将用户设置为中央/外围设备,以便他们可以在登录时从彼此获取数据?我需要设置自定义UUID服务吗 我的应用程序使用照片。当用户点击一张照片时,我想让它拍下发布照片的用户的照片。我想使用AVFoundation框架中的snapStillImage。如果您有任何蓝牙经验,或非常棒的教程可供参考;让我们谈谈 我想在用户使用某种类型的自定义蓝牙外围服务点击另一个用户的照片时触发此方法 -(void)snapStillImage //this is being called on did load {

如何将用户设置为中央/外围设备,以便他们可以在登录时从彼此获取数据?我需要设置自定义UUID服务吗

我的应用程序使用照片。当用户点击一张照片时,我想让它拍下发布照片的用户的照片。我想使用AVFoundation框架中的snapStillImage。如果您有任何蓝牙经验,或非常棒的教程可供参考;让我们谈谈

我想在用户使用某种类型的自定义蓝牙外围服务点击另一个用户的照片时触发此方法

-(void)snapStillImage //this is being called on did load
{
dispatch_async([self sessionQueue], ^{
    // Update the orientation on the still image output video connection before capturing.
    [[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[(AVCaptureVideoPreviewLayer *)[[self previewView] layer] connection] videoOrientation]];
    // Flash set to Auto for Still Capture
    [ViewController5 setFlashMode:AVCaptureFlashModeAuto forDevice:[[self videoDeviceInput] device]];
    // Capture a still image.
    [[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {
        if (imageDataSampleBuffer)
        {
            NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];

            photo.image = [[UIImage alloc] initWithData:imageData];
            [[[ALAssetsLibrary alloc] init] writeImageToSavedPhotosAlbum:[photo.image CGImage] orientation:(ALAssetOrientation)[photo.image imageOrientation] completionBlock:nil];
            [self uploadPhoto];
}
    }];
});
}
点击照片时触发的当前代码


我想你没有说清楚。我已经使用基于
核心蓝牙的蓝牙功能实现了一个应用程序。请详细描述您的问题。好的,此应用程序允许用户登录、拍照和上传照片。用户可以在UIScrollView中浏览照片。当点击照片时,它会转到新的视图控制器,以全屏显示图像。我们如何使之在点击图像时,上传图像设备的用户拍摄一张照片并将其显示给使用蓝牙触发点击的用户?我认为如果我们使用snapStillImage方法设置外围设备/服务/特性是可能的,对吗?所以你不再使用Multipeer:?否:蓝牙功能是第一位的。此外,强积金更注重地点。对我来说,可以补充的是,蓝牙低能量,有效带宽为0.27 Mbit/s,并不是发送照片的最佳选择(可以有几兆字节)。此外,Multipeer连接在引擎盖下使用蓝牙,并完成所有无聊的任务,如发现、为您设置中央/外围设备。你为什么要用蓝牙呢?你所说的强积金更注重地点是什么意思?它的范围与蓝牙大致相同。
-(void)didSelectPhoto:(PhotoView*)sender {
//photo selected - show it full screen
[self performSegueWithIdentifier:@"ShowPhoto" sender:[NSNumber numberWithInt:sender.tag]];
}
//face value zap method
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([@"ShowPhoto" compare: segue.identifier]==NSOrderedSame) {
    StreamPhotoScreen* streamPhotoScreen = segue.destinationViewController;
    streamPhotoScreen.IdPhoto = sender;
}
}