Giter Site home page Giter Site logo

Comments (4)

ezefranca avatar ezefranca commented on June 1, 2024

Could you post the code of ViewController Class that causes the crash?

from fsk-arduino-ios.

hcivelek avatar hcivelek commented on June 1, 2024

//
// RobotDriver.m
// RobiPhoneApp
//
// Created by Hasan Civelek on 8/28/14.
// Copyright (c) 2014 Ubit. All rights reserved.
//

#import "RobotDriver.h"

#import "AudioSignalAnalyzer.h"
#import "FSKSerialGenerator.h"
#import "FSKRecognizer.h"

@implementation RobotDriver

@synthesize analyzer;
@synthesize generator;

  • (RobotDriver *)getInstance
    {
    static RobotDriver *getInstance;
    @synchronized(self)
    {
    if (!getInstance){
    getInstance = [[RobotDriver alloc] init];

    }
    return getInstance;
    

    }
    }

-(void)setup{
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setActive:YES error:nil];

if(session.inputAvailable){
    [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
}else{
    [session setCategory:AVAudioSessionCategoryPlayback error:nil];
}
[session setActive:YES error:nil];
[session setPreferredIOBufferDuration:0.023220 error:nil];

recognizer = [[FSKRecognizer alloc] init];

//[recognizer addReceiver:mainViewController];

generator = [[FSKSerialGenerator alloc] init];
[generator play];

analyzer = [[AudioSignalAnalyzer alloc] init];
[analyzer addRecognizer:recognizer];

if(session.inputAvailable){
    [analyzer record];
}

}

//delegate fonksiyonu degil.. ne iƟe yariyor bilmiyorum..

  • (void)inputIsAvailableChanged:(BOOL)isInputAvailable
    {
    NSLog(@"inputIsAvailableChanged %d",isInputAvailable);

    AVAudioSession *session = [AVAudioSession sharedInstance];

    [analyzer stop];
    [generator stop];

    if(isInputAvailable){
    [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
    [analyzer record];
    }else{
    [session setCategory:AVAudioSessionCategoryPlayback error:nil];
    }
    [generator play];
    }

-(void)modem:(NSString *)metin{
[generator writeByte:0xff];
[generator writeBytes:(const unsigned char *)[metin UTF8String]
length:(int)[metin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
}

-(void)motorKomut:(NSString *)komut degeri:(NSString *)deger suresi:(NSString *)sure{

}

-(void)aciKomut:(NSString *)komut degeri:(NSString *)deger{

}

@EnD

from fsk-arduino-ios.

ezefranca avatar ezefranca commented on June 1, 2024

I'm not comit the correct version of multidelegate, i forgotten to put this line (specifically the CharReceiver protocol).
@interface Multi Delegate : NSObject
Download and try again. Thank you.

from fsk-arduino-ios.

hcivelek avatar hcivelek commented on June 1, 2024

Thank you

from fsk-arduino-ios.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.