Coder Social home page Coder Social logo

avea-cli's People

Contributors

vfuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

reefaq

avea-cli's Issues

built.sh shows several errors with Swift version 3.0 (newbie to swift question)

Hi Jonas,

your work is very appreciating! Thank you!

But I ran into several errors (actual OSX) with built.sh:

Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file Avea.swift BluetoothManager.swift Color.swift main.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name avea -o /var/folders/nk/lr9q9gd91x34_sv6xrcmzmgw0000gn/T/Avea-74ed4f.o
BluetoothManager.swift:56:33: error: expected ',' joining parts of a multi-clause condition
                if let name = peripheral.name where name.containsString("Avea"){
                                              ^~~~~
                                              ,
BluetoothManager.swift:78:38: error: expected ',' joining parts of a multi-clause condition
                                if let peripherals = peripherals where peripherals.count > 0 {
                                                                 ^~~~~
                                                                 ,
main.swift:252:44: error: expected ',' joining parts of a multi-clause condition
        guard let red = Int(Process.arguments[2]) where (0...255).contains(red) else {
                                                  ^~~~~
                                                  ,
main.swift:257:47: error: expected ',' joining parts of a multi-clause condition
        guard let green  = Int(Process.arguments[3]) where (0...255).contains(green) else {
                                                     ^~~~~
                                                     ,
main.swift:262:46: error: expected ',' joining parts of a multi-clause condition
        guard let blue  = Int(Process.arguments[4]) where (0...255).contains(blue) else {
                                                    ^~~~~
                                                    ,
main.swift:267:46: error: expected ',' joining parts of a multi-clause condition
        guard let white = Int(Process.arguments[5]) where (0...255).contains(white) else {
                                                    ^~~~~
                                                    ,
main.swift:308:51: error: expected ',' joining parts of a multi-clause condition
        guard let brightness = Int(Process.arguments[2]) where (0...255).contains(brightness) else {
                                                         ^~~~~
                                                         ,
main.swift:347:44: error: expected ',' joining parts of a multi-clause condition
        guard let red = Int(Process.arguments[3]) where (0...255).contains(red) else {
                                                  ^~~~~
                                                  ,
main.swift:352:47: error: expected ',' joining parts of a multi-clause condition
        guard let green  = Int(Process.arguments[4]) where (0...255).contains(green) else {
                                                     ^~~~~
                                                     ,
main.swift:357:46: error: expected ',' joining parts of a multi-clause condition
        guard let blue  = Int(Process.arguments[5]) where (0...255).contains(blue) else {
                                                    ^~~~~
                                                    ,
main.swift:362:46: error: expected ',' joining parts of a multi-clause condition
        guard let white = Int(Process.arguments[6]) where (0...255).contains(white) else {
                                                    ^~~~~
                                                    ,
Avea.swift:15:95: error: single argument function types require parentheses
        private func send(bytes: [UInt8], peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
                                                                                                     ^~~~~~
                                                                                                     (     )
Avea.swift:31:89: error: single argument function types require parentheses
        func setColor(color: Color, peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
                                                                                               ^~~~~~
                                                                                               (     )
Avea.swift:35:97: error: single argument function types require parentheses
        func setBrightness(brightness: Int, peripheralUUIDs : [String]? = nil, newPeripheralHandler : (String -> Void)? = nil){
                                                                                                       ^~~~~~
                                                                                                       (     )
Avea.swift:17:13: error: 'dispatch_semaphore_create' has been replaced by 'DispatchSemaphore.init(value:)'
                let sem = dispatch_semaphore_create(0);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
                          DispatchSemaphore         value: 
<unknown>:0: note: 'dispatch_semaphore_create' has been explicitly marked unavailable here
BluetoothManager.swift:40:24: error: single argument function types require parentheses
        var newUUIDHandler : (String -> Void)?
                              ^~~~~~
                              (     )
BluetoothManager.swift:42:54: error: single argument function types require parentheses
        func sendBytes(bytes: [UInt8], completionHandler : (Void -> Void)? = nil){
                                                            ^~~~
                                                            (   )
Avea.swift:23:29: error: missing argument label 'bytes:' in call
                bluetoothManager.sendBytes(bytes, completionHandler: {
                                          ^
                                           bytes: 
Avea.swift:27:32: error: cannot convert value of type 'Int' to expected argument type 'dispatch_time_t' (aka 'UInt64')
                dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER)
                                             ^~~~~~~~~~~~~~~~~~~~~
                                             dispatch_time_t(     )
Avea.swift:32:8: error: use of unresolved identifier 'getBytesForColor'
                send(getBytesForColor(color), peripheralUUIDs: peripheralUUIDs, newPeripheralHandler: newPeripheralHandler)
                     ^~~~~~~~~~~~~~~~
Avea.swift:36:8: error: use of unresolved identifier 'getBytesForBrightness'
                send(getBytesForBrightness(brightness), peripheralUUIDs: peripheralUUIDs, newPeripheralHandler: newPeripheralHandler)
                     ^~~~~~~~~~~~~~~~~~~~~
Avea.swift:52:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(extended).1)
                                       ^
                                       word: 
Avea.swift:53:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(extended).0)
                                       ^
                                       word: 
Avea.swift:63:31: error: missing argument label 'prefix:' in call
                return colorEncodeWithPrefix(8, color: color)
                                            ^
                                             prefix: 
Avea.swift:67:31: error: missing argument label 'prefix:' in call
                return colorEncodeWithPrefix(3, color: color)
                                            ^
                                             prefix: 
Avea.swift:71:31: error: missing argument label 'prefix:' in call
                return colorEncodeWithPrefix(2, color: color)
                                            ^
                                             prefix: 
Avea.swift:75:31: error: missing argument label 'prefix:' in call
                return colorEncodeWithPrefix(1, color: color)
                                            ^
                                             prefix: 
Avea.swift:104:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeWhite(color.white)).0)
                                       ^
                                       word: 
Avea.swift:105:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeWhite(color.white)).1)
                                       ^
                                       word: 
Avea.swift:106:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeRed(color.red)).0)
                                       ^
                                       word: 
Avea.swift:107:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeRed(color.red)).1)
                                       ^
                                       word: 
Avea.swift:108:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeGreen(color.green)).0)
                                       ^
                                       word: 
Avea.swift:109:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeGreen(color.green)).1)
                                       ^
                                       word: 
Avea.swift:110:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeBlue(color.blue)).0)
                                       ^
                                       word: 
Avea.swift:111:26: error: missing argument label 'word:' in call
                bytes.append(splitWord(encodeBlue(color.blue)).1)
                                       ^
                                       word: 

Can you give me a hint what goes wrong?

Stefan

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.